1 const globals = require("globals");
2 const js = require("@eslint/js");
3 const erb = require("eslint-plugin-erb");
4 const stylisticJs = require("@stylistic/eslint-plugin-js");
7 js.configs.recommended,
8 erb.configs.recommended,
11 "@stylistic": stylisticJs
25 updateLinks: "readonly"
29 // The "unused disable directive" is set to "warn" by default.
30 // For the ERB plugin to work correctly, you must disable
31 // this directive to avoid issues described here
32 // https://github.com/eslint/eslint/discussions/18114
33 // If you're using the CLI, you might also use the following flag:
34 // --report-unused-disable-directives-severity=off
35 reportUnusedDisableDirectives: "off"
38 "@stylistic/array-bracket-newline": ["error", "consistent"],
39 "@stylistic/array-bracket-spacing": "error",
40 "@stylistic/block-spacing": "error",
41 "@stylistic/brace-style": ["error", "1tbs", { allowSingleLine: true }],
42 "@stylistic/comma-dangle": "error",
43 "@stylistic/comma-spacing": "error",
44 "@stylistic/comma-style": "error",
45 "@stylistic/computed-property-spacing": "error",
46 "@stylistic/dot-location": ["error", "property"],
47 "@stylistic/eol-last": "error",
48 "@stylistic/func-call-spacing": "error",
49 "@stylistic/indent": ["error", 2, {
51 VariableDeclarator: "first",
52 FunctionDeclaration: { parameters: "first" },
53 FunctionExpression: { parameters: "first" },
54 CallExpression: { arguments: "first" }
56 "@stylistic/key-spacing": "error",
57 "@stylistic/keyword-spacing": "error",
58 "@stylistic/no-floating-decimal": "error",
59 "@stylistic/no-mixed-operators": "error",
60 "@stylistic/no-multiple-empty-lines": "error",
61 "@stylistic/no-multi-spaces": "error",
62 "@stylistic/no-trailing-spaces": "error",
63 "@stylistic/no-whitespace-before-property": "error",
64 "@stylistic/object-curly-newline": ["error", { consistent: true }],
65 "@stylistic/object-curly-spacing": ["error", "always"],
66 "@stylistic/object-property-newline": ["error", { allowAllPropertiesOnSameLine: true }],
67 "@stylistic/operator-linebreak": ["error", "after"],
68 "@stylistic/padded-blocks": ["error", "never"],
69 "@stylistic/quote-props": ["error", "consistent-as-needed", { keywords: true, numbers: true }],
70 "@stylistic/quotes": ["error", "double"],
71 "@stylistic/semi": ["error", "always"],
72 "@stylistic/semi-spacing": "error",
73 "@stylistic/semi-style": "error",
74 "@stylistic/space-before-blocks": "error",
75 "@stylistic/space-before-function-paren": ["error", { named: "never" }],
76 "@stylistic/space-in-parens": "error",
77 "@stylistic/space-infix-ops": "error",
78 "@stylistic/space-unary-ops": "error",
79 "@stylistic/switch-colon-spacing": "error",
80 "@stylistic/wrap-iife": "error",
81 "@stylistic/wrap-regex": "error",
83 "accessor-pairs": "error",
84 "array-callback-return": "error",
85 "block-scoped-var": "error",
86 "curly": ["error", "multi-line", "consistent"],
87 "dot-notation": "error",
88 "eqeqeq": ["error", "smart"],
90 "no-array-constructor": "error",
93 "no-div-regex": "error",
94 "no-eq-null": "error",
96 "no-extend-native": "error",
97 "no-extra-bind": "error",
98 "no-extra-label": "error",
99 "no-implicit-coercion": "warn",
100 "no-implicit-globals": "warn",
101 "no-implied-eval": "error",
102 "no-invalid-this": "error",
103 "no-iterator": "error",
104 "no-labels": "error",
105 "no-label-var": "error",
106 "no-lone-blocks": "error",
107 "no-lonely-if": "error",
108 "no-loop-func": "error",
109 "no-multi-str": "error",
110 "no-negated-condition": "error",
111 "no-nested-ternary": "error",
113 "no-new-func": "error",
114 "no-new-wrappers": "error",
115 "no-object-constructor": "error",
116 "no-octal-escape": "error",
117 "no-param-reassign": "error",
119 "no-script-url": "error",
120 "no-self-compare": "error",
121 "no-sequences": "error",
122 "no-throw-literal": "error",
123 "no-undef-init": "error",
124 "no-undefined": "error",
125 "no-unmodified-loop-condition": "error",
126 "no-unneeded-ternary": "error",
127 "no-unused-expressions": "off",
128 "no-unused-vars": ["error", { caughtErrors: "none" }],
129 "no-useless-call": "error",
130 "no-useless-concat": "error",
131 "no-useless-return": "error",
132 "no-use-before-define": ["error", { functions: false }],
134 "no-warning-comments": "warn",
135 "radix": ["error", "always"],
140 // Additional configuration for test files
141 files: ["test/**/*.js"],
152 files: ["config/eslint.js"],
155 sourceType: "commonjs",