-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy patheslint.config.mjs
More file actions
81 lines (78 loc) · 2.47 KB
/
eslint.config.mjs
File metadata and controls
81 lines (78 loc) · 2.47 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
75
76
77
78
79
80
81
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
import storybook from 'eslint-plugin-storybook';
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import pluginReact from 'eslint-plugin-react';
import pluginReactHooks from 'eslint-plugin-react-hooks';
export default [
{
ignores: [
'eslint.config.mjs',
'**/dist/*',
'**/*.config.{js,mjs,cjs,ts}',
'**/node_modules/*',
'src/component-list.js',
'src/index.js',
],
},
pluginJs.configs.recommended,
{
files: ['**/*.{js,ts,jsx,tsx}'],
settings: {
react: {
version: 'detect',
},
},
languageOptions: {
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
},
{ languageOptions: { globals: globals.browser } },
...tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
{
plugins: {
'react-hooks': pluginReactHooks,
},
rules: {
'react/react-in-jsx-scope': 'off',
...pluginReactHooks.configs.recommended.rules,
},
ignores: ['*.test.tsx'],
}, // Custom Rules should be added below so that they overwrite any defaults in the above default setup
{
rules: {
// Prettier recommends running separately from a linter.
// https://prettier.io/docs/en/integrating-with-linters.html#notes
'prettier/prettier': 'off',
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'import/extensions': ['off', 'never'],
'import/named': 'off',
'import/no-cycle': 'off',
'import/no-duplicates': 'off',
'import/no-relative-packages': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-named-as-default': 'off',
'import/no-named-as-default-member': 'off',
'import/no-self-import': 'off',
'import/no-unresolved': 'off',
'import/no-useless-path-segments': 'off',
'import/order': 'off',
'jest/expect-expect': 'off',
'testing-library/no-container': 'off',
'testing-library/no-node-access': 'off',
'react-hooks/exhaustive-deps': 'off',
// Temporarily disable new React Compiler strict rules pending refactor
'react-hooks/set-state-in-effect': 'off',
'react-hooks/preserve-manual-memoization': 'off',
},
},
...storybook.configs['flat/recommended'],
];