-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.yml
61 lines (61 loc) · 2.08 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
# References:
# - https://typescript-eslint.io/getting-started/#step-2-configuration
# - https://stackoverflow.com/a/75108187
root: true
parser: '@typescript-eslint/parser'
extends:
- eslint:recommended
- plugin:require-extensions/recommended
- plugin:react/recommended
- plugin:react-hooks/recommended
- plugin:cypress/recommended
- plugin:jsx-a11y/recommended
- airbnb
plugins:
- '@typescript-eslint'
- require-extensions
- react
- react-hooks
- cypress
- react-refresh
- import
- jsx-a11y
settings:
react:
version: detect
env:
browser: true
cypress/globals: true
rules:
no-console: [2, { "allow": ["warn", "error", "info", "groupCollapsed", "groupEnd"]}]
# My practice is to use "log" for messages I intend to clean up before merging.
# All these others reflect the intension that they should be left in the codebase.
react/jsx-filename-extension: [0] # Imports don't work if I change extension.
react/sort-comp: [0] # Non-alphabetical groupings can make more sense.
react/jsx-one-expression-per-line: [0] # Makes punctuation after tab awkward.
react/prop-types: [0]
react/require-default-props: [0]
react/react-in-jsx-scope: [0]
react/jsx-curly-newline: [0]
object-curly-newline: [0]
react/jsx-no-bind: [0] # Allow passing functions as JSX props
import/no-extraneous-dependencies: [1, { "devDependencies": ["**/*.test.{ts,js,jsx,tsx}", "**/*.spec.{ts,js,jsx,tsx}"] }]
react/jsx-props-no-multi-spaces: [0]
no-plusplus: [0]
react-refresh/only-export-components: [2, { "checkJS": true }]
import/no-duplicates: [2]
import/extensions: [0] # Using require-extensions instead.
import/prefer-default-export: [0]
overrides:
- files: 'sites/docs/src/{pages,theme}/**'
rules:
import/no-unresolved: [0] # Allow @theme/ and @docusaurus/ imports
'@typescript-eslint/no-var-requires': [0]
no-undef: [0]
- files: '**/*.{ts,tsx}'
extends:
- plugin:@typescript-eslint/eslint-recommended
- plugin:@typescript-eslint/recommended
rules:
# Allow importing js/ts files without extension
import/no-unresolved: [0]