-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
53 lines (51 loc) · 1.75 KB
/
eslint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// eslint.config.js
import js from "@eslint/js";
import jest from "eslint-plugin-jest";
import babelParser from "@babel/eslint-parser";
export default [
{
...js.configs.recommended,
ignores: [
'!.*',
'**/assets/**',
'**/node_modules/**',
'**/dist/**',
'./coverage/**',
'*.json',
'**/.git/**'
],
rules: {
"no-console": "warn", // Warns about console.log statements
"no-unused-vars": ["warn", { "vars": "all", "args": "after-used", "ignoreRestSiblings": false }],
"consistent-return": "error", // Ensure consistent return statements in functions
"curly": ["error", "multi-line"], // Enforce consistent brace style for all control statements
"eqeqeq": ["error", "always"], // Require the use of === and !==
"no-duplicate-imports": "error", // Disallow duplicate imports
"prefer-const": "error", // Prefer const over let for variables that are never reassigned
"no-var": "error", // Disallow the use of var and encourage let or const
camelcase: 'off',
'eslint-comments/no-use': 'off',
'eslint-comments/no-unused-disable': 'off',
'import/no-commonjs': 'off',
'import/no-namespace': 'off',
semi: 'off'
},
plugins: {
jest
},
languageOptions: {
parser: babelParser,
parserOptions: {
ecmaVersion: 2023, // Support for modern ECMAScript features
requireConfigFile: false, // Optional: If you don't have a Babel config file
babelOptions: {
presets: ["jest"] // Ensure you have this preset installed
},
sourceType: "module", // Allows for the use of imports
ecmaFeatures: {
jsx: true // Enable JSX if you're using React
}
}
},
}
]