forked from sanity-io/sanity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
55 lines (55 loc) · 1.45 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
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
globals: {
__DEV__: true,
JSX: true,
},
env: {
node: true,
browser: true,
},
settings: {
react: {version: '16.9.0'},
},
extends: [
'sanity',
'sanity/react',
'sanity/import',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'sanity/typescript',
'prettier/@typescript-eslint',
'prettier',
'prettier/react',
],
rules: {
'import/no-extraneous-dependencies': 'off', // because of parts
camelcase: ['error', {allow: ['^unstable_', '^Unstable_']}],
'import/no-unresolved': ['error', {ignore: ['.*:.*']}], // because of parts
'prettier/prettier': 'error',
'sort-imports': 'off', // prefer import/order
},
plugins: ['import', '@typescript-eslint', 'prettier', 'react'],
overrides: [
{
files: ['*.{ts,tsx}'],
rules: {
'import/no-unresolved': 'off',
'no-undef': 'off',
'import/named': 'off',
// the normal `no-dupe-class-members` doesn't work with TS overrides
'no-dupe-class-members': 'off',
'@typescript-eslint/no-dupe-class-members': ['error'],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['warn'],
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
},
},
{
files: ['./test/jest-setup.js', '*.test.{js,ts,tsx}'],
env: {jest: true},
},
],
}