-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
56 lines (55 loc) · 1.55 KB
/
.eslintrc.js
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
const restrictedGlobals = require('confusing-browser-globals')
const standard = require('eslint-config-standard')
/** @type {import('eslint').Linter.Config} */
module.exports = {
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname
},
extends: ['standard', 'prettier'],
plugins: ['prettier'],
rules: {
'prettier/prettier': 'error',
'no-restricted-globals': ['error', ...restrictedGlobals]
},
overrides: [
{
files: '*.{jsx,tsx}',
extends: [
'standard-jsx',
'standard-react',
'plugin:react-hooks/recommended',
'prettier'
],
rules: {
// Too many false negatives.
'react/no-unknown-property': 'off'
}
},
{
files: '*.{ts,tsx}',
extends: [
'standard-with-typescript',
'plugin:react-hooks/recommended',
'prettier'
],
rules: {
// Prefer type checking in TypeScript.
'react/prop-types': 'off',
// Use underscore for discarding required variables.
'@typescript-eslint/no-unused-vars': [
standard.rules['no-unused-vars'][0],
{
...standard.rules['no-unused-vars'][1],
varsIgnorePattern: '^_$'
}
],
// It's not harmful.
'@typescript-eslint/no-empty-interface': 'off',
// It's not so harmful to cast values to string implicitly, especially
// inside template strings that we often construct messages from.
'@typescript-eslint/restrict-template-expressions': 'off'
}
}
]
}