generated from truonghungit/react-starter-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.json
60 lines (60 loc) · 2.09 KB
/
.eslintrc.json
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
{
"root": true,
"env": {
"es6": true, // enable ES2015 features.
"browser": true, // enable use of global browser variables like `windows`.
"node": true // enable use of global node variables like `process`.
},
"parser": "@typescript-eslint/parser", // Allows Eslint to understand TypeScript syntax.
"plugins": [
"react",
"react-hooks",
"jsx-a11y",
"@typescript-eslint",
"import",
"simple-import-sort" // Plugin for sorting imports in file.
],
"extends": [
"eslint:recommended", // Eslint recommended configuration by eslint.
"plugin:@typescript-eslint/recommended", // Turns on rules from TypeScript-specific plugin.
"plugin:import/recommended", // Linting of ES2015+ import/export syntax.
"plugin:react/recommended", // Recommended react linting configs.
"plugin:react-hooks/recommended", // Recommended react hooks linting configs.
"plugin:jsx-a11y/recommended", // Turns on a11y rules for JSX.
"plugin:prettier/recommended" // Turns off all rules that are unnecessary or might conflict with Prettier.
],
"settings": {
"react": {
"version": "detect" // auto-detect React version from package.json.
},
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"] // use typescript-eslint parser for .ts|tsx files.
},
"import/resolver": {
"typescript": {
"alwaysTryTypes": true // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`.
}
}
},
"rules": {
"import/first": "warn",
"import/newline-after-import": "warn",
"import/no-duplicates": "error",
"import/no-named-as-default-member": "off",
"import/default": "off",
"simple-import-sort/imports": "warn",
"simple-import-sort/exports": "warn",
"react/prop-types": "off",
"react/react-in-jsx-scope": "off",
"react/jsx-sort-props": [
"warn",
{
"callbacksLast": true,
"shorthandFirst": true,
"ignoreCase": true,
"reservedFirst": true,
"noSortAlphabetically": true
}
]
}
}