-
Notifications
You must be signed in to change notification settings - Fork 112
/
eslint.config.js
70 lines (67 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Run `npx @eslint/config-inspector` to inspect the config.
import globals from 'globals';
import js from '@eslint/js';
import importPlugin from 'eslint-plugin-import';
import jsdoc from 'eslint-plugin-jsdoc';
import jsxA11y from 'eslint-plugin-jsx-a11y';
import reactPlugin from 'eslint-plugin-react';
import pluginCypress from 'eslint-plugin-cypress/flat';
import eslintConfigPrettier from 'eslint-config-prettier';
export default [
{
ignores: ['.tox', 'cfgov/static_built', 'collectstatic'],
},
js.configs.recommended,
importPlugin.flatConfigs.recommended,
jsdoc.configs['flat/recommended'],
jsxA11y.flatConfigs.recommended,
reactPlugin.configs.flat.recommended,
pluginCypress.configs.recommended,
eslintConfigPrettier,
{
languageOptions: {
ecmaVersion: 2023,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
globals: {
...globals.browser,
...globals.node,
...globals.jest,
...globals.serviceworker,
},
},
settings: {
'import/resolver': {
node: {
paths: ['src'],
extensions: ['.js', '.ts', '.d.ts', '.tsx'],
moduleDirectory: ['node_modules'],
},
},
react: {
version: 'detect',
},
},
// Some plugins are automatically included.
// plugins: {},
rules: {
'jsdoc/require-hyphen-before-param-description': ['warn', 'always'],
'no-console': ['warn'],
'no-use-before-define': ['error', 'nofunc'],
'no-unused-vars': [
'error',
{
vars: 'all',
args: 'after-used',
ignoreRestSiblings: false,
},
],
'no-var': ['error'],
'prefer-const': ['error'],
radix: ['error'],
},
},
];