-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy patheslint.config.mjs
80 lines (70 loc) · 2.38 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// @ts-check
import globals from 'globals';
import js from '@eslint/js';
import ts from 'typescript-eslint';
export default ts.config(
{
files: ['src/**/*.ts', 'tests/**/*.ts'],
extends: [
js.configs.recommended,
...ts.configs.recommendedTypeChecked,
...ts.configs.stylisticTypeChecked,
],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
globals: globals.node,
},
rules: {
// We are *way* past this point lmao
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
// Only way I can do indentation in ts-doc
'no-irregular-whitespace': 'off',
// no.
'@typescript-eslint/restrict-template-expressions': 'off',
// sorry :(
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/consistent-type-assertions': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/no-empty-function': 'off',
// Makes underscore variables not throw a fit
'@typescript-eslint/no-unused-vars': ['error', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
}],
// Sometimes 'requires' is necessary
'@typescript-eslint/no-require-imports': 'off',
// https://stackoverflow.com/questions/49743842/javascript-unexpected-control-characters-in-regular-expression
'no-control-regex': 'off',
// Linting
'semi': 'error',
'comma-dangle': ['error', 'always-multiline'],
'@typescript-eslint/consistent-type-exports': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
},
},
{
// Laxer rules for test files
files: ['tests/**/*.ts'],
rules: {
'@typescript-eslint/no-magic-numbers': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/no-implied-eval': 'off',
'@typescript-eslint/dot-notation': 'off',
},
},
{
// Disable type-aware linting on JS files
files: ['**/*.*js'],
...ts.configs.disableTypeChecked,
rules: { 'no-undef': 'off' },
},
);