generated from ChrisMBarr/npm-typescript-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.mjs
55 lines (52 loc) · 1.81 KB
/
eslint.config.mjs
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
// @ts-check
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import eslintPluginSimpleImportSort from 'eslint-plugin-simple-import-sort';
export default tseslint.config(
{
files: ['src/**/*.ts'],
extends: [eslint.configs.recommended, ...tseslint.configs.strict],
plugins: {
'simple-import-sort': eslintPluginSimpleImportSort,
},
languageOptions: {
parserOptions: {
project: true,
},
},
rules: {
'@typescript-eslint/explicit-function-return-type': 'warn',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'no-invalid-this': 'off',
'@typescript-eslint/no-invalid-this': 'warn',
'no-loop-func': 'off',
'@typescript-eslint/no-loop-func': 'warn',
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': 'warn',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'warn',
'no-use-before-define': 'off',
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/no-use-before-define': 'warn',
'@typescript-eslint/no-unnecessary-qualifier': 'warn',
'@typescript-eslint/prefer-readonly': 'warn',
'@typescript-eslint/prefer-regexp-exec': 'warn',
'no-return-await': 'off',
'@typescript-eslint/return-await': 'warn',
'@typescript-eslint/strict-boolean-expressions': 'warn',
'array-callback-return': 'warn',
complexity: ['warn', { max: 8 }],
eqeqeq: ['warn', 'always', { null: 'ignore' }],
'no-unused-vars': 'warn',
'object-shorthand': ['warn', 'always'],
'simple-import-sort/imports': 'warn',
},
},
{
files: ['*.spec.ts', 'test/**/*.ts'],
rules: {
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
},
}
);