Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script to create eslint distributable #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions script/eslint_builder.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/sh

yarn add rollup --dev
yarn add @rollup/plugin-node-resolve --dev
yarn add @rollup/plugin-commonjs --dev
yarn add @rollup/plugin-json --dev
yarn add eslint --dev
cat > rollup.config.js <<EOF
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';

export default {
input: '-',
shimMissingExports: true,
output: {
file: 'eslint.js',
format: 'cjs',
name: 'Boo'
},
plugins: [
resolve({preferBuiltins: true}),
commonjs(),
json()
],
}
EOF

yarn run rollup -c <<EOF
import eslint from "eslint";
import format from "eslint/lib/cli-engine/formatters/compact.js";

function main() {
const cli = new (eslint.CLIEngine)({
envs: ["es6", "mocha"],
useEslintrc: false
});

const report = cli.executeOnFiles(["vdom_test.js"]);
console.log(format(report.results));
}

main();

EOF

rm rollup.config.js
yarn remove @rollup/plugin-json
yarn remove @rollup/plugin-node-resolve
yarn remove @rollup/plugin-commonjs
yarn remove rollup
yarn remove eslint