-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.js
More file actions
59 lines (57 loc) · 1.64 KB
/
Copy path.eslintrc.js
File metadata and controls
59 lines (57 loc) · 1.64 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
module.exports = {
env: {
node: true,
es2022: true,
jest: true,
},
extends: [
'eslint:recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
},
rules: {
// Modern JavaScript/TypeScript preferences
'no-console': 'off', // CLI tool needs console output
'prefer-const': 'error',
'no-var': 'error',
'object-shorthand': 'error',
'prefer-template': 'error',
'prefer-arrow-callback': 'error',
'arrow-spacing': 'error',
'template-curly-spacing': ['error', 'never'],
// Code style - Modern approach (no semicolons, single quotes)
'eqeqeq': ['error', 'always'],
'curly': ['error', 'multi-line'],
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
'comma-dangle': ['error', 'always-multiline'],
'quotes': ['error', 'single', { avoidEscape: true }],
'semi': ['error', 'never'],
'space-before-function-paren': ['error', 'never'],
'indent': ['error', 2, { SwitchCase: 1 }],
'no-trailing-spaces': 'error',
'no-multiple-empty-lines': ['error', { max: 2, maxEOF: 1 }],
'padded-blocks': ['error', 'never'],
// Turn off some rules for TypeScript files
'no-undef': 'off', // TypeScript handles this
'no-unused-vars': 'off', // TypeScript handles this
},
ignorePatterns: [
'dist/**/*',
'bin/**/*',
'node_modules/**/*',
'**/*.js',
'__tests__/tmp/**/*',
],
overrides: [
{
files: ['*.ts'],
rules: {
// Additional TypeScript-specific rules can go here
'no-unused-vars': 'off', // Let TypeScript handle unused vars
}
}
]
}