forked from leydel/continuity
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.ts
89 lines (84 loc) · 2.76 KB
/
eslint.config.ts
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
import { includeIgnoreFile } from "@eslint/compat";
import path from "node:path";
import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
import tsParser from '@typescript-eslint/parser';
import typeScriptPlugin from '@typescript-eslint/eslint-plugin';
import importPlugin from 'eslint-plugin-import';
import nPlugin from 'eslint-plugin-n';
import prettierConfig from 'eslint-config-prettier';
export default [
includeIgnoreFile(path.resolve(import.meta.dirname, ".gitignore")),
{
ignores: ['*.config.*']
},
{
files: ['**/*.ts'],
languageOptions: {
parser: tsParser,
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: import.meta.dirname,
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
experimentalDecorators: true,
legacyDecorators: true
}
}
},
plugins: {
'@typescript-eslint': typeScriptPlugin,
import: importPlugin,
n: nPlugin
},
rules: {
// Core TypeScript rules
'@typescript-eslint/no-unused-vars': [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/explicit-member-accessibility': [
'error',
{ accessibility: 'explicit' }
],
// Decorator-specific rules
'@typescript-eslint/no-unsafe-declaration-merging': 'warn',
// Import/export rules
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
alphabetize: { order: 'asc', caseInsensitive: true }
}
],
// Node.js/ESM rules
'n/no-missing-import': 'off',
'n/no-unsupported-features/es-syntax': [
'error',
{ ignores: ['modules'] }
]
},
settings: {
'import/resolver': {
typescript: {
alwaysTryTypes: true,
project: './tsconfig.json'
}
}
}
},
{
files: ['**/*.decorator.ts'],
rules: {
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-explicit-any': 'off'
}
},
// Prettier config must come last
prettierConfig
] satisfies FlatConfig.ConfigArray;