-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
74 lines (71 loc) · 2.1 KB
/
eslint.config.mjs
File metadata and controls
74 lines (71 loc) · 2.1 KB
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
74
import globals from 'globals';
import babelParser from '@babel/eslint-parser';
import reactPlugin from 'eslint-plugin-react';
import storybookPlugin from 'eslint-plugin-storybook';
export default [
{
files: ['**/*.{js,jsx}'],
languageOptions: {
parser: babelParser,
parserOptions: {
sourceType: 'module',
},
globals: {
...globals.browser,
...globals.es2015,
...globals.mocha,
...globals.node,
},
},
plugins: {
react: reactPlugin,
},
settings: {
react: {
version: 'detect',
},
},
rules: {
// ESLint recommended
...reactPlugin.configs.recommended.rules,
// General
'array-callback-return': ['warn'],
'eqeqeq': ['warn', 'always', { null: 'ignore' }],
'new-parens': ['warn'],
'no-array-constructor': ['warn'],
'no-caller': ['warn'],
'no-cond-assign': ['warn', 'always'],
'no-console': ['warn', { allow: ['warn', 'error', 'reportException'] }],
'no-eval': ['warn'],
'no-extend-native': ['warn'],
'no-extra-bind': ['warn'],
'no-implied-eval': ['warn'],
'no-iterator': ['warn'],
'no-lone-blocks': ['warn'],
'no-loop-func': ['warn'],
'no-multi-str': ['warn'],
'no-global-assign': ['warn'],
'no-new-wrappers': ['warn'],
'no-script-url': ['warn'],
'no-self-compare': ['warn'],
'no-shadow-restricted-names': ['warn'],
'no-template-curly-in-string': ['warn'],
'no-throw-literal': ['warn'],
'no-unused-vars': ['warn', { args: 'none', ignoreRestSiblings: true }],
'no-use-before-define': ['warn'],
'no-useless-computed-key': ['warn'],
'no-useless-concat': ['warn'],
'no-useless-constructor': ['warn'],
'no-useless-rename': ['warn'],
'no-whitespace-before-property': ['warn'],
// React
'react/prop-types': ['off'],
'react/no-unescaped-entities': ['off'],
'react/style-prop-object': ['warn'],
},
},
...storybookPlugin.configs['flat/recommended'],
{
ignores: ['lib/**', 'docs/**', 'node_modules/**'],
},
];