-
Notifications
You must be signed in to change notification settings - Fork 159
Expand file tree
/
Copy patheslint.config.mjs
More file actions
66 lines (63 loc) · 1.88 KB
/
eslint.config.mjs
File metadata and controls
66 lines (63 loc) · 1.88 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
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import jsdoc from 'eslint-plugin-jsdoc';
import tsParser from '@typescript-eslint/parser';
export default [
{
files: ['**/*.ts', '**/*.js'],
ignores: ['node_modules/**', 'dist/**', 'out/**', '**/vitest.config.*'],
languageOptions: {
parser: tsParser,
parserOptions: {
project: './tsconfig.json',
sourceType: 'module',
ecmaVersion: 'latest',
},
globals: {
node: true,
es6: true,
},
},
plugins: {
'@typescript-eslint': typescriptEslint,
jsdoc: jsdoc,
},
rules: {
// Basic indentation and spacing
indent: ['error', 2],
'brace-style': ['error', '1tbs'],
'eol-last': 'error',
eqeqeq: ['error', 'smart'],
'guard-for-in': 'error',
'no-throw-literal': 'error',
'no-trailing-spaces': 'error',
'no-var': 'error',
'prefer-const': 'error',
quotes: ['error', 'single'],
semi: ['error', 'always'],
'spaced-comment': [
'error',
'always',
{
markers: ['/'],
},
],
// TypeScript-specific rules
'@typescript-eslint/naming-convention': 'error',
'@typescript-eslint/no-shadow': [
'error',
{
hoist: 'all',
},
],
'@typescript-eslint/prefer-namespace-keyword': 'error',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
'@typescript-eslint/no-explicit-any': 'off', // Allow any for this project
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'no-shadow': 'off', // Turn off base rule to use TypeScript version
// JSDoc rules
'jsdoc/check-alignment': 'error',
'jsdoc/check-indentation': 'error',
},
},
];