forked from lightningpixel/modly
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
63 lines (62 loc) · 1.91 KB
/
Copy patheslint.config.mjs
File metadata and controls
63 lines (62 loc) · 1.91 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
import js from '@eslint/js'
import tseslint from 'typescript-eslint'
import reactHooks from 'eslint-plugin-react-hooks'
import globals from 'globals'
export default tseslint.config(
{
ignores: [
'dist/**',
'out/**',
'node_modules/**',
'resources/**',
'api/**',
'arch/**',
'docs/**',
'**/*.test.mjs'
]
},
js.configs.recommended,
...tseslint.configs.recommended,
// Renderer (React, browser environment)
{
files: ['src/**/*.{ts,tsx}'],
plugins: { 'react-hooks': reactHooks },
languageOptions: {
globals: { ...globals.browser }
},
rules: {
// Proven, high-value hook rules. The v7 "recommended" set adds many
// opinionated React-Compiler-era rules that flood a legacy codebase.
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn'
}
},
// Main / preload / scripts (Node environment)
{
files: ['electron/**/*.{ts,mts,mjs}', 'scripts/**/*.{js,mjs,cjs}', 'tools/**/*.{ts,mjs}'],
languageOptions: {
globals: { ...globals.node }
}
},
// CommonJS files (Node, require/module)
{
files: ['scripts/**/*.{js,cjs}', 'tailwind.config.js', 'postcss.config.js', '**/*.cjs'],
languageOptions: {
sourceType: 'commonjs',
globals: { ...globals.node }
}
},
// Project-wide rule tuning
{
rules: {
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
'@typescript-eslint/no-explicit-any': 'off',
// require() is used intentionally in Electron main and Node build scripts
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-unused-expressions': ['error', { allowShortCircuit: true, allowTernary: true }],
// Stripping ANSI escape codes requires control chars in regex
'no-control-regex': 'off',
'no-empty': ['warn', { allowEmptyCatch: true }]
}
}
)