-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.eslintrc
49 lines (49 loc) · 1.59 KB
/
.eslintrc
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
// https://eslintconfig.dev/cra/typescript-prettier
// https://dev.to/benweiser/how-to-set-up-eslint-typescript-prettier-with-create-react-app-3675
// -----------
// https://www.robertcooper.me/using-eslint-and-prettier-in-a-typescript-project
{
"env": {
"browser": true,
// "es2021": true,
"jasmine": true,
"jest": true,
"es6": true
},
"extends": [
"react-app", // Uses the recommended rules Create React App
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from @typescript-eslint/eslint-plugin
"prettier/react",
"prettier/@typescript-eslint", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
"prettier",
"plugin:prettier/recommended" // Should be last in the list. Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true // Allows for the parsing of JSX
},
"ecmaVersion": 2020,
"sourceType": "module"
},
"plugins": ["react", "@typescript-eslint", "prettier"],
"settings": {
"react": {
"pragma": "React",
"version": "detect"
}
},
"rules": {
"prettier/prettier": [
"warn",
{
"singleQuote": true,
// https://stackoverflow.com/a/53769213/9184658
"endOfLine": "auto"
}
]
// "semi": "error"
}
}