I experimented with simplifying the eslint config to just use eslint-config-standard and eslint-config-prettier. There were too many errors to make it a quick change, but I did find a few useful rules we could adopt instead. --- * lint: Remove useless return statements http://eslint.org/docs/rules/no-useless-return * lint: Split declarations into multiple statements http://eslint.org/docs/rules/one-var * lint: Remove unneeded ternary operators http://eslint.org/docs/rules/no-unneeded-ternary * lint: Require symbol descriptions http://eslint.org/docs/rules/symbol-description * lint: Disallow declarations in nested blocks http://eslint.org/docs/rules/no-inner-declarations * lint: Disallow yoda conditions http://eslint.org/docs/rules/yoda * Revert "lint: Disallow yoda conditions" See discussion at https://github.com/prettier/prettier/pull/2401#discussion_r125750068 This reverts commit f3b568d5bd48a742460cb0f805d1be38d8f61a40.
46 lines
1.0 KiB
JavaScript
46 lines
1.0 KiB
JavaScript
import baseConfig from "./rollup.base.config.js";
|
|
import resolve from "rollup-plugin-node-resolve";
|
|
import commonjs from "rollup-plugin-commonjs";
|
|
import json from "rollup-plugin-json";
|
|
import replace from "rollup-plugin-replace";
|
|
import uglify from "uglify-es";
|
|
|
|
const parser = process.env.parser;
|
|
|
|
export default Object.assign(baseConfig, {
|
|
entry: "src/parser-" + parser + ".js",
|
|
dest: "dist/parser-" + parser + ".js",
|
|
format: "cjs",
|
|
plugins: [
|
|
parser === "typescript"
|
|
? replace({
|
|
"exports.Syntax =": "1,",
|
|
include: "node_modules/typescript-eslint-parser/parser.js"
|
|
})
|
|
: {},
|
|
json(),
|
|
resolve({ preferBuiltins: true }),
|
|
commonjs(),
|
|
{
|
|
transformBundle(code) {
|
|
const result = uglify.minify(code, {});
|
|
if (result.error) {
|
|
throw result.error;
|
|
}
|
|
return result;
|
|
}
|
|
}
|
|
],
|
|
external: [
|
|
"fs",
|
|
"buffer",
|
|
"path",
|
|
"module",
|
|
"assert",
|
|
"util",
|
|
"os",
|
|
"crypto"
|
|
],
|
|
useStrict: parser !== "flow"
|
|
});
|