This requires a switch to the configuration file format described at https://eslint.org/docs/latest/use/configure/configuration-files. I used the automatic tool to generate the new file, with some simplifications around defaults. - Removed no-cond-assign override, it is no longer needed. - Fixed `catch (e)` where `e` is not used. This seems a little pedantic to me, but seems like a relatively easy fix to just remove it, and I believe the syntax without the variable has been supported for quite some time. Alternatively it could also be `_e`, or explicitly allowed. - Added `--no-warn-ignored` to the script since it was very noisy.
72 lines
2 KiB
JavaScript
72 lines
2 KiB
JavaScript
import { defineConfig, globalIgnores } from "eslint/config";
|
|
|
|
export default defineConfig([
|
|
globalIgnores(["**/**min.js", "**/highlight.js", "**/playground_editor/*"]),
|
|
{
|
|
rules: {
|
|
indent: ["error", 4],
|
|
"linebreak-style": ["error", "unix"],
|
|
quotes: ["error", "single"],
|
|
semi: ["error", "always"],
|
|
|
|
"brace-style": ["error", "1tbs", {
|
|
allowSingleLine: false,
|
|
}],
|
|
|
|
curly: "error",
|
|
"no-trailing-spaces": "error",
|
|
"no-multi-spaces": "error",
|
|
|
|
"keyword-spacing": ["error", {
|
|
before: true,
|
|
after: true,
|
|
}],
|
|
|
|
"comma-spacing": ["error", {
|
|
before: false,
|
|
after: true,
|
|
}],
|
|
|
|
"arrow-spacing": ["error", {
|
|
before: true,
|
|
after: true,
|
|
}],
|
|
|
|
"key-spacing": ["error", {
|
|
beforeColon: false,
|
|
afterColon: true,
|
|
mode: "strict",
|
|
}],
|
|
|
|
"func-call-spacing": ["error", "never"],
|
|
"space-infix-ops": "error",
|
|
"space-before-function-paren": ["error", "never"],
|
|
"space-before-blocks": "error",
|
|
|
|
"no-console": ["error", {
|
|
allow: ["warn", "error"],
|
|
}],
|
|
|
|
"comma-dangle": ["error", "always-multiline"],
|
|
"comma-style": ["error", "last"],
|
|
|
|
"max-len": ["error", {
|
|
code: 100,
|
|
tabWidth: 2,
|
|
}],
|
|
|
|
"eol-last": ["error", "always"],
|
|
"no-extra-parens": "error",
|
|
"arrow-parens": ["error", "as-needed"],
|
|
|
|
"no-unused-vars": ["error", {
|
|
argsIgnorePattern: "^_",
|
|
varsIgnorePattern: "^_",
|
|
}],
|
|
|
|
"prefer-const": ["error"],
|
|
"no-var": "error",
|
|
eqeqeq: "error",
|
|
},
|
|
},
|
|
]);
|