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 "app/assets/javascripts/i18n/",
19 "@stylistic": stylisticJs
33 updateLinks: "readonly"
37 // The "unused disable directive" is set to "warn" by default.
38 // For the ERB plugin to work correctly, you must disable
39 // this directive to avoid issues described here
40 // https://github.com/eslint/eslint/discussions/18114
41 // If you're using the CLI, you might also use the following flag:
42 // --report-unused-disable-directives-severity=off
43 reportUnusedDisableDirectives: "off"
46 "@stylistic/array-bracket-newline": ["error", "consistent"],
47 "@stylistic/array-bracket-spacing": "error",
48 "@stylistic/block-spacing": "error",
49 "@stylistic/brace-style": ["error", "1tbs", { allowSingleLine: true }],
50 "@stylistic/comma-dangle": "error",
51 "@stylistic/comma-spacing": "error",
52 "@stylistic/comma-style": "error",
53 "@stylistic/computed-property-spacing": "error",
54 "@stylistic/dot-location": ["error", "property"],
55 "@stylistic/eol-last": "error",
56 "@stylistic/func-call-spacing": "error",
57 "@stylistic/indent": ["error", 2, {
58 CallExpression: { arguments: "first" },
59 FunctionDeclaration: { parameters: "first" },
60 FunctionExpression: { parameters: "first" },
62 VariableDeclarator: "first"
64 "@stylistic/key-spacing": "error",
65 "@stylistic/keyword-spacing": "error",
66 "@stylistic/max-statements-per-line": "error",
67 "@stylistic/no-floating-decimal": "error",
68 "@stylistic/no-mixed-operators": "error",
69 "@stylistic/no-multi-spaces": "error",
70 "@stylistic/no-multiple-empty-lines": "error",
71 "@stylistic/no-trailing-spaces": "error",
72 "@stylistic/no-whitespace-before-property": "error",
73 "@stylistic/object-curly-newline": ["error", { consistent: true }],
74 "@stylistic/object-curly-spacing": ["error", "always"],
75 "@stylistic/object-property-newline": ["error", { allowAllPropertiesOnSameLine: true }],
76 "@stylistic/one-var-declaration-per-line": "error",
77 "@stylistic/operator-linebreak": ["error", "after"],
78 "@stylistic/padded-blocks": ["error", "never"],
79 "@stylistic/quote-props": ["error", "consistent-as-needed", { keywords: true, numbers: true }],
80 "@stylistic/quotes": ["error", "double"],
81 "@stylistic/semi": ["error", "always"],
82 "@stylistic/semi-spacing": "error",
83 "@stylistic/semi-style": "error",
84 "@stylistic/space-before-blocks": "error",
85 "@stylistic/space-before-function-paren": ["error", { named: "never" }],
86 "@stylistic/space-in-parens": "error",
87 "@stylistic/space-infix-ops": "error",
88 "@stylistic/space-unary-ops": "error",
89 "@stylistic/switch-colon-spacing": "error",
90 "@stylistic/wrap-iife": "error",
91 "@stylistic/wrap-regex": "error",
93 "accessor-pairs": "error",
94 "array-callback-return": "error",
95 "block-scoped-var": "error",
96 "curly": ["error", "multi-line", "consistent"],
97 "dot-notation": "error",
98 "eqeqeq": ["error", "smart"],
100 "no-array-constructor": "error",
101 "no-caller": "error",
102 "no-console": "warn",
103 "no-div-regex": "error",
104 "no-else-return": ["error", { allowElseIf: false }],
105 "no-eq-null": "error",
107 "no-extend-native": "error",
108 "no-extra-bind": "error",
109 "no-extra-label": "error",
110 "no-implicit-coercion": "warn",
111 "no-implicit-globals": "error",
112 "no-implied-eval": "error",
113 "no-invalid-this": "error",
114 "no-iterator": "error",
115 "no-label-var": "error",
116 "no-labels": "error",
117 "no-lone-blocks": "error",
118 "no-lonely-if": "error",
119 "no-loop-func": "error",
120 "no-multi-str": "error",
121 "no-negated-condition": "error",
122 "no-nested-ternary": "error",
124 "no-new-func": "error",
125 "no-new-wrappers": "error",
126 "no-object-constructor": "error",
127 "no-octal-escape": "error",
128 "no-param-reassign": "error",
130 "no-script-url": "error",
131 "no-self-compare": "error",
132 "no-sequences": "error",
133 "no-throw-literal": "error",
134 "no-undef-init": "error",
135 "no-undefined": "error",
136 "no-unmodified-loop-condition": "error",
137 "no-unneeded-ternary": "error",
138 "no-unused-expressions": "off",
139 "no-unused-vars": ["error", { caughtErrors: "none" }],
140 "no-use-before-define": ["error", { functions: false }],
141 "no-useless-call": "error",
142 "no-useless-concat": "error",
143 "no-useless-return": "error",
146 "no-warning-comments": "warn",
147 "operator-assignment": "error",
148 "prefer-const": "error",
149 "prefer-object-spread": "error",
150 "radix": ["error", "always"],
155 // Additional configuration for test files
156 files: ["test/**/*.js"],
167 files: ["config/eslint.js"],
170 sourceType: "commonjs",
176 "sort-keys": ["error", "asc", { minKeys: 5 }]