-
Notifications
You must be signed in to change notification settings - Fork 214
/
.eslintrc.cjs
173 lines (158 loc) · 5.7 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
const {getESLintConfig} = require('@vis.gl/dev-tools/configuration');
// Make any changes to default config here
module.exports = getESLintConfig({
overrides: {
plugins: ['tree-shaking'],
env: {
browser: true,
es2020: true,
node: true
},
rules: {
// disabled after ocular upgrade to unbreak build
'prefer-rest-params': 'warn',
'import/named': 'off',
// disabled by choice
'no-unused-expressions': 'warn',
'no-console': 'warn',
'no-continue': 'warn',
'callback-return': 0,
'accessor-pairs': 0,
'max-depth': ['warn', 4],
camelcase: 0,
complexity: 0,
'max-statements': 0,
'default-case': 'warn',
radix: 0,
// handled by prettier
quotes: 0,
indent: 0
},
overrides: [
{
files: ['**/*.ts', '**/*.tsx', '**/*.d.ts'],
rules: {
'@typescript-eslint/no-explicit-any': 'off', // 'warn',
// typescript-eslint 6.0
'@typescript-eslint/no-unsafe-argument': 0,
'@typescript-eslint/no-redundant-type-constituents': 0,
'@typescript-eslint/no-unsafe-enum-comparison': 1,
'@typescript-eslint/no-duplicate-type-constituents': 1,
'@typescript-eslint/no-base-to-string': 1,
'@typescript-eslint/no-loss-of-precision': 1,
'@typescript-eslint/no-duplicate-enum-values': 0,
'consistent-return': 0, // We use typescript noImplicitReturn
'default-case': 0, // We rely on typescript
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/no-misused-promises': 0,
'@typescript-eslint/no-floating-promises': 0,
// For parquet module
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/no-non-null-asserted-optional-chain': 0,
// Gradually enable
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/ban-types': 0,
'@typescript-eslint/no-unsafe-member-access': 0,
'@typescript-eslint/no-unsafe-assignment': 0,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/no-unused-vars': [
'warn',
{vars: 'all', args: 'none', ignoreRestSiblings: false}
],
// We always want explicit typing, e.g `field: string = ''`
'@typescript-eslint/no-inferrable-types': 0,
'@typescript-eslint/restrict-template-expressions': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/require-await': 0,
'@typescript-eslint/no-unsafe-return': 0,
'@typescript-eslint/no-unsafe-call': 0,
'@typescript-eslint/no-empty-interface': 0
}
},
// tests are run with aliases set up in node and webpack.
// This means lint will not find the imported files and generate false warnings
{
// scripts use devDependencies
files: ['**/test/**/*.ts', '**/test/**/*.js', '**/scripts/**/*.js', '*.config.ts', '*.config.js', '*.config.local.js'],
rules: {
'import/no-unresolved': 0,
'import/no-extraneous-dependencies': 0
}
},
{
files: ['**/modules/webgpu/**/*.ts', '**/modules/webgpu/**/*.js', "examples/webgpu/**/*.ts"],
globals: {
// TODO - find eslint definitions for WebGPU
"GPU": true,
"GPUAdapter": true,
"GPUAdapterInfo": true,
"GPUBindGroup": true,
"GPUBindGroupLayout": true,
"GPUBuffer": true,
"GPUCanvasContext": true,
"GPUCommandBuffer": true,
"GPUCommandEncoder": true,
"GPUCompilationInfo": true,
"GPUCompilationMessage": true,
"GPUComputePassEncoder": true,
"GPUComputePipeline": true,
"GPUDevice": true,
"GPUDeviceLostInfo": true,
"GPUError": true,
"GPUExternalTexture": true,
"GPUFeatureName": true,
"GPUInternalError": true,
"GPUOutOfMemoryError": true,
"GPUPipelineError": true,
"GPUPipelineLayout": true,
"GPUQuerySet": true,
"GPUQueue": true,
"GPURenderBundle": true,
"GPURenderBundleEncoder": true,
"GPURenderPassEncoder": true,
"GPURenderPipeline": true,
"GPUSampler": true,
"GPUShaderModule": true,
"GPUSupportedLimits": true,
"GPUTexture": true,
"GPUTextureView": true,
"GPUUncapturedErrorEvent": true,
"GPUValidationError": true,
"GPUVertexBufferLayout": true,
"GPUVertexState": true,
"GPUVertexAttribute": true,
"GPUFragmentState": true,
"GPUIndexFormat": true,
"GPURenderPipelineDescriptor": true,
"GPUBufferUsage": true,
"GPUColorWrite": true,
"GPUMapMode": true,
"GPUShaderStage": true,
"GPUTextureUsage": true,
"GPUImageCopyTexture": true,
"GPUImageCopyBuffer": true,
"GPUExtent3D": true,
"GPURenderPassColorAttachment": true,
"GPURenderPassDepthStencilAttachment": true,
"GPUDepthStencilState": true,
"GPUColorTargetState": true,
"GPUBindGroupEntry": true,
"GPUTextureFormat": true,
"GPUVertexFormat": true,
"GPURenderPassDescriptor": true,
"GPUComputePassTimestampWrites": true,
"GPUStencilFaceState": true,
}
}
],
settings: {
// Ensure eslint finds typescript files
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.mjs', '.ts', '.tsx']
}
}
}
},
debug: false
});