-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
88 lines (87 loc) · 2.08 KB
/
.eslintrc.cjs
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
82
83
84
85
86
87
88
const path = require('path');
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 13,
sourceType: 'module',
},
plugins: [
'@typescript-eslint',
'import',
'sort-imports-es6-autofix',
'unused-imports',
],
rules: {
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-unused-vars': 'off',
// "graphql/named-operations": ["warn", { env: "apollo" }],
// "graphql/required-fields": [
// "warn",
// { env: "apollo", requiredFields: ["id"] },
// ],
// "graphql/template-strings": ["error", { env: "apollo" }],
'sort-imports-es6-autofix/sort-imports-es6': [
'warn',
{
ignoreCase: false,
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
},
],
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
},
],
},
settings: {
'import/extensions': ['.js', '.jsx', '.tsx', '.ts'],
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'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`
project: path.resolve(__dirname, './tsconfig.json'),
},
},
react: {
version: 'detect',
},
},
overrides: [
{
files: ['*.graphql'],
parser: '@graphql-eslint/eslint-plugin',
plugins: ['@graphql-eslint'],
rules: {
'@graphql-eslint/known-type-names': 'error',
},
},
{
files: ['*.cjs'],
rules: {
'@typescript-eslint/no-var-requires': 0,
},
},
],
};