-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy path.eslintrc.yml
91 lines (86 loc) · 2.3 KB
/
.eslintrc.yml
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
82
83
84
85
86
87
88
89
90
91
env:
browser: true
es6: true
jest: true
node: true
cypress/globals: true
ignorePatterns:
- 'node_modules/'
- '/**/node_modules/'
- '**/node_modules/'
extends:
- 'eslint:recommended'
- 'plugin:react/recommended'
- 'plugin:@typescript-eslint/recommended' # Add TypeScript rules
- 'plugin:import/errors'
- 'plugin:import/warnings'
- 'plugin:import/typescript' # Import plugin with TypeScript support
- 'plugin:jsx-a11y/recommended'
- 'prettier' # If you use Prettier
parser: '@typescript-eslint/parser' # Use the TypeScript parser
parserOptions:
ecmaFeatures:
jsx: true
sourceType: module
project: './tsconfig.json' # Required for full TypeScript support
plugins:
- react
- jsx-a11y
- import
- '@typescript-eslint'
- simple-import-sort
- cypress
- chai-friendly
settings:
react:
version: detect
import/resolver:
typescript: {}
node:
extensions:
- .js
- .jsx
- .ts
- .tsx
paths:
- src
rules:
# Base rules
linebreak-style: ['error', 'unix']
quotes: ['warn', 'single', { avoidEscape: true }]
semi: ['error', 'never']
no-console: ['error']
prefer-const: ['warn']
curly: ['error']
import/no-named-as-default-member: ['off']
# Import sorting
simple-import-sort/imports: ['error']
import/first: ['warn']
# TypeScript-specific rules
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }]
'@typescript-eslint/no-explicit-any': ['warn']
'@typescript-eslint/explicit-function-return-type': ['off']
'@typescript-eslint/no-empty-function': ['warn']
# React rules
react/display-name: ['warn']
react/jsx-indent: ['warn', 2]
react/jsx-max-props-per-line: ['warn', { when: 'multiline' }]
react/no-array-index-key: ['warn']
react/prop-types: ['off']
# Accessibility rules
jsx-a11y/anchor-is-valid:
- warn
- components: ['Link']
specialLink: ['to']
jsx-a11y/label-has-associated-control: ['warn']
jsx-a11y/media-has-caption: ['warn']
react/no-unescaped-entities: ['warn']
overrides:
- files: ['**/__tests__/**/*.[jt]s?(x)', '**/*.test.[jt]s?(x)', '**/*.spec.[jt]s?(x)']
rules:
react/react-in-jsx-scope: 'off'
'@typescript-eslint/no-unused-expressions': 'off'
globals:
snapshot: false
snapshotReducer: false
snapshotComponent: false