Repository navigation
Expand file tree
/
Copy path.eslintrc.js
More file actions
65 lines (63 loc) · 1.68 KB
/
Copy path.eslintrc.js
File metadata and controls
65 lines (63 loc) · 1.68 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
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
plugins: ['react', 'react-hooks', '@typescript-eslint', 'prettier'],
env: {
browser: true,
es6: true,
node: true,
},
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
settings: {
react: {
version: 'detect',
},
},
rules: {
// TypeScript specific rules
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
// React specific rules
'react/prop-types': 'off', // Not needed with TypeScript
'react/react-in-jsx-scope': 'off', // Not needed with React 17+
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
// General code style rules
'no-console': ['warn', { allow: ['warn', 'error'] }],
'prettier/prettier': 'warn',
},
overrides: [
{
files: ['**/*.stories.*'],
rules: {
// Relax rules for Storybook files
'import/no-anonymous-default-export': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
},
},
{
files: ['**/*.test.*', '**/*.spec.*'],
env: {
jest: true,
},
rules: {
// Relax rules for test files
'@typescript-eslint/no-explicit-any': 'off',
},
},
],
};