This repository has been archived by the owner on Feb 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
.eslintrc.json
81 lines (63 loc) · 2.43 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{
"extends": [
// From @eslint-plugin-react
"plugin:react/recommended",
// From eslint-plugin-react-hooks
"plugin:react-hooks/recommended",
// From @typescript-eslint/eslint-plugin
"plugin:@typescript-eslint/recommended",
// From eslint-config-prettier
"prettier/@typescript-eslint",
// From eslint-plugin-prettier
"plugin:prettier/recommended"
],
"plugins": [
"filenames",
"simple-import-sort"
],
"rules": {
// This is a living list! If an eslint rule does more harm than good, just
// add it below to disable it. Write a comment above each rule explaining
// why the exception is made, so we know whether to keep it in the future.
// NOTE: Keep the rules sorted in alphabetical order!
// Sometimes the return type can be obviously inferred.
"@typescript-eslint/explicit-function-return-type": "off",
// Sometimes types are tricky and we just want to get a feature out!
// `any`s are also easy to check for after the fact with a search.
"@typescript-eslint/no-explicit-any": "off",
// Allow unused variables that start with "_"
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_"
}
],
// Ensure default exports have the same name as the file.
"filenames/match-exported": "error",
// https://jamie.build/const
// https://twitter.com/dan_abramov/status/1208369896880558080
"prefer-const": "off",
// Note: Module-level variables and the return values of React Hooks should
// generally always use const. If there were an eslint rule to enforce that,
// then that would be great.
// Disabling this for now. When moving code around, this rule will become
// very noisy with Prettier violations that get autocorrected anyway.
"prettier/prettier": "off",
// Quotes and apostrophes are more readable when not escaped.
"react/no-unescaped-entities": "off",
// We use TypeScript props interfaces, which is mostly redundant with prop
// types.
"react/prop-types": "off",
// Reduces the number of ways we can write an element with no children.
"react/self-closing-comp": "warn",
// Because we want imports sorted!
// The built-in "sort-imports" doesn't seem to be sufficient, and the
// "eslint-plugin-import" doesn't seem to work.
"simple-import-sort/sort": "warn"
},
"settings": {
"react": {
"version": "detect"
}
}
}