-
Notifications
You must be signed in to change notification settings - Fork 202
/
.eslintrc.cjs
130 lines (129 loc) · 3.87 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
// see docs: https://eslint.org/docs/user-guide/configuring
module.exports = {
ignorePatterns: [
'node_modules',
//
'.commitlintrc.cjs',
'.eslintrc.cjs',
'.lintstagedrc.mjs',
'babel.config.mjs',
'rollup.config.mjs',
'vite.config.mjs',
//
'packages/g-devtool',
'packages/g-webgpu-compiler',
'packages/site',
//
'build',
'coverage',
'esm',
'lib',
'dist',
'rust',
'__tests__',
'scripts',
'types',
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'airbnb',
'airbnb/hooks',
'airbnb-typescript',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
},
plugins: ['eslint-plugin-tsdoc', 'jest'],
root: true,
env: {
node: true,
browser: true,
'jest/globals': true,
},
rules: {
'import/no-cycle': 'warn',
'import/no-duplicates': 'warn',
'class-methods-use-this': 'warn',
'no-plusplus': [
'warn',
{
allowForLoopAfterthoughts: true,
},
],
'no-restricted-globals': 'warn',
'no-continue': 'warn',
'no-multi-assign': 'warn',
'no-cond-assign': 'warn',
'no-return-assign': 'warn',
'no-new': 'warn',
'new-cap': 'warn',
'default-case': 'warn',
'consistent-return': 'warn',
'prefer-regex-literals': 'warn',
'guard-for-in': 'warn',
'no-underscore-dangle': 'off',
'no-fallthrough': 'off',
'no-empty': 'off',
'no-param-reassign': 'off',
'no-redeclare': 'off',
'no-useless-escape': 'off',
'no-case-declarations': 'off',
'no-constant-condition': 'off',
'import/prefer-default-export': 'off',
'prefer-destructuring': 'off',
'no-restricted-syntax': 'off',
'no-bitwise': 'off',
//
'@typescript-eslint/naming-convention': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'warn',
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-return': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/no-unsafe-call': 'warn',
'@typescript-eslint/no-unsafe-function-type': 'warn',
'@typescript-eslint/no-unsafe-enum-comparison': 'warn',
'@typescript-eslint/no-redundant-type-constituents': 'warn',
'@typescript-eslint/no-floating-promises': 'warn',
'@typescript-eslint/no-misused-promises': [
'warn',
{
checksConditionals: false,
},
],
'@typescript-eslint/no-unused-vars': [
'error',
{ args: 'none', ignoreRestSiblings: true },
],
'@typescript-eslint/no-unused-expressions': 'warn',
'@typescript-eslint/no-base-to-string': 'warn',
'@typescript-eslint/no-use-before-define': [
'error',
{ functions: false, classes: false },
],
'@typescript-eslint/no-redeclare': ['error'],
'@typescript-eslint/no-this-alias': ['error', { allowedNames: ['self'] }],
'@typescript-eslint/restrict-template-expressions': 'warn',
'@typescript-eslint/return-await': 'warn',
'@typescript-eslint/default-param-last': 'warn',
'@typescript-eslint/prefer-promise-reject-errors': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-shadow': 'off',
'@typescript-eslint/no-parameter-properties': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-invalid-this': 'off',
// not found
'@typescript-eslint/lines-between-class-members': 'off',
'@typescript-eslint/no-throw-literal': 'off',
'@typescript-eslint/ban-types': 'off',
//
'tsdoc/syntax': 'warn',
},
globals: { G: true, window: true, document: true, module: true },
};