-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
68 lines (67 loc) · 1.96 KB
/
Copy patheslint.config.js
File metadata and controls
68 lines (67 loc) · 1.96 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
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
export default tseslint.config(
{
ignores: ['dist/**', 'node_modules/**', 'coverage/**', 'docs/.vitepress/cache/**', 'docs/.vitepress/dist/**', 'docs/.vitepress/theme/mere/**', 'docs-worker/**', 'eslint.config.js']
},
js.configs.recommended,
...tseslint.configs.strictTypeChecked,
{
languageOptions: {
parserOptions: {
project: ['./tsconfig.json', './tsconfig.test.json'],
tsconfigRootDir: import.meta.dirname
}
},
rules: {
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }],
'@typescript-eslint/explicit-function-return-type': ['error', { allowExpressions: true }],
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-unnecessary-condition': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
'@typescript-eslint/no-unnecessary-type-parameters': 'off',
'@typescript-eslint/restrict-template-expressions': ['error', {
allowBoolean: true,
allowNullish: true,
allowNumber: true
}]
}
},
{
files: ['src/**/*.ts'],
rules: {
'no-restricted-imports': ['error', {
paths: [
{
name: 'node:child_process',
importNames: ['spawnSync'],
message: 'Use src/runtime/mere.ts so subprocess JSON/error handling stays typed and testable.'
},
{
name: 'yaml',
message: 'Use src/runtime/yaml.ts so YAML parsing errors stay normalized.'
}
]
}],
'no-restricted-properties': ['error', {
object: 'JSON',
property: 'parse',
message: 'Use src/runtime/json.ts so external JSON is parsed at typed boundaries.'
}]
}
},
{
files: ['src/runtime/json.ts', 'src/runtime/mere.ts', 'src/runtime/yaml.ts'],
rules: {
'no-restricted-imports': 'off',
'no-restricted-properties': 'off'
}
},
{
files: ['test/**/*.ts'],
rules: {
'@typescript-eslint/no-floating-promises': 'off'
}
}
);