Repository navigation
Expand file tree
/
Copy patheslint.config.mjs
More file actions
68 lines (53 loc) · 1.61 KB
/
Copy patheslint.config.mjs
File metadata and controls
68 lines (53 loc) · 1.61 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
// @ts-check
/**
* ESLint configuration for the project.
*
* Uses Nuxt's default ESLint setup and extends it
* with additional rules for:
* - Type safety (TypeScript)
* - Code quality
* - Security best practices
*/
import withNuxt from './.nuxt/eslint.config.mjs'
export default withNuxt({
rules: {
/**
* =========================
* TypeScript Rules
* =========================
*/
// Disallow usage of `any` to enforce strict typing
'@typescript-eslint/no-explicit-any': 'error',
// Warn about unused variables (ignore variables starting with "_")
'@typescript-eslint/no-unused-vars': ['warn', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_'
}],
/**
* =========================
* JavaScript / Code Quality
* =========================
*/
// Enforce strict equality (=== instead of ==)
'eqeqeq': ['error', 'always'],
// Prevent usage of debugger statements
'no-debugger': 'error',
// Prefer const over let when variables are not reassigned
'prefer-const': 'error',
// Disallow usage of var (use let/const instead)
'no-var': 'error',
// Warn on console usage (allow warn and error)
'no-console': ['warn', { allow: ['warn', 'error'] }],
/**
* =========================
* Security Rules
* =========================
*/
// Disallow use of eval() (major security risk)
'no-eval': 'error',
// Disallow indirect eval (e.g. setTimeout with string)
'no-implied-eval': 'error',
// Disallow Function constructor (similar risk as eval)
'no-new-func': 'error'
}
})