-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
75 lines (74 loc) · 1.98 KB
/
Copy patheslint.config.js
File metadata and controls
75 lines (74 loc) · 1.98 KB
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
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import prettier from 'eslint-config-prettier/flat';
import eslintPluginPrettier from 'eslint-plugin-prettier';
export default tseslint.config(
{
ignores: [
'dist/**',
'node_modules/**',
'canvases/*/bin/**',
'canvases/*/target/**',
'*.config.js',
],
},
{
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
parser: tseslint.parser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
globals: {
// Node.js globals
console: 'readonly',
process: 'readonly',
Buffer: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
ReadableStream: 'readonly',
Response: 'readonly',
AbortSignal: 'readonly',
crypto: 'readonly',
// Bun globals
Bun: 'readonly',
},
},
plugins: {
'@typescript-eslint': tseslint.plugin,
prettier: eslintPluginPrettier,
},
rules: {
...js.configs.recommended.rules,
...tseslint.configs.recommended.rules,
...prettier.rules,
'prettier/prettier': 'error',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'no-unused-vars': 'off',
// Terminal mouse protocols intentionally match the ESC control byte.
'no-control-regex': 'off',
'no-console': 'error',
},
},
{
files: ['canvases/_sdk/use-mouse.ts'],
rules: {
// Escaped opening brackets make terminal escape-sequence regexes easier to audit.
'no-useless-escape': 'off',
},
}
);