-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
46 lines (36 loc) · 1.39 KB
/
.eslintrc.js
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
/* eslint-disable no-undef */
module.exports = {
parser: '@typescript-eslint/parser',
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
plugins: ['@typescript-eslint', 'import'],
rules: {
// TypeScript specific rules
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
// General JavaScript/TypeScript rules
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-debugger': 'warn',
'no-duplicate-imports': 'error',
'no-var': 'error',
'spaced-comment': ['error', 'always', { markers: ['/'] }],
// Async/Promise rules
'no-async-promise-executor': 'error',
'no-await-in-loop': 'warn',
'prefer-promise-reject-errors': 'error',
// Object rules
'object-shorthand': ['error', 'always'],
'quote-props': ['error', 'as-needed'],
// Array rules
'array-callback-return': 'error',
// Function rules
'no-loop-func': 'error',
// Variable rules
'no-use-before-define': ['error', { functions: false, classes: true, variables: true }],
// Error handling
'no-throw-literal': 'error',
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }],
'no-trailing-spaces': 'error',
},
};