-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy patheslint.config.js
More file actions
52 lines (49 loc) · 1.33 KB
/
eslint.config.js
File metadata and controls
52 lines (49 loc) · 1.33 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
import js from '@eslint/js';
import typescript from '@typescript-eslint/eslint-plugin';
import typescriptParser from '@typescript-eslint/parser';
import prettier from 'eslint-config-prettier';
import importPlugin from 'eslint-plugin-import-x';
import jsdoc from 'eslint-plugin-jsdoc';
import globals from 'globals';
export default [
js.configs.recommended,
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
globals: {
...globals.node,
...globals.jest,
...globals.jasmine,
},
parser: typescriptParser,
parserOptions: {
project: './tsconfig.json',
sourceType: 'module',
},
},
plugins: {
'@typescript-eslint': typescript,
'import-x': importPlugin,
jsdoc: jsdoc,
},
rules: {
// TypeScript-specific rules
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
// General JavaScript/TypeScript rules
'no-var': 'error',
'no-eval': 'error',
'no-duplicate-imports': 'error',
'no-throw-literal': 'error',
'no-unused-vars': 'off',
eqeqeq: ['error', 'smart'],
curly: ['error', 'multi-line'],
// Import rules
'import-x/no-deprecated': 'error',
},
},
prettier,
];