-
Notifications
You must be signed in to change notification settings - Fork 13
/
eslint.config.js
73 lines (71 loc) · 1.76 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
71
72
73
// 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: [
'.yarn/',
'docs/_site/',
'docs/dist/',
'test/unit-test-coverage/',
'packages/cfpb-design-system/dist/',
],
},
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,
},
},
settings: {
'import/resolver': {
node: {
paths: ['src'],
extensions: ['.js', '.ts', '.d.ts', '.tsx'],
},
},
react: {
version: 'detect',
},
},
// Some plugins are automatically included.
// plugins: {},
rules: {
'jsdoc/require-hyphen-before-param-description': 'warn',
'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'],
},
},
];