-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.mjs
56 lines (51 loc) · 1.65 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
import eslint from '@eslint/js';
import mm from '@maxmilton/eslint-config';
import unicorn from 'eslint-plugin-unicorn';
import ts from 'typescript-eslint';
const OFF = 0;
const ERROR = 2;
export default ts.config(
eslint.configs.recommended,
...ts.configs.strictTypeChecked,
...ts.configs.stylisticTypeChecked,
unicorn.configs['flat/recommended'],
mm.configs.recommended,
{
linterOptions: {
reportUnusedDisableDirectives: ERROR,
},
languageOptions: {
parserOptions: {
project: ['tsconfig.json', 'tsconfig.node.json'],
projectService: {
allowDefaultProject: ['*.mjs'],
},
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
// FIXME: Remove this once fixed upstream (incorrectly reports chrome as deprecated).
'@typescript-eslint/no-deprecated': OFF,
// prefer to clearly separate Bun and DOM
'unicorn/prefer-global-this': OFF,
/* Performance and byte savings */
// byte savings
'no-plusplus': OFF,
// forEach is often faster (in Chrome and Bun but not Firefox)
'unicorn/no-array-for-each': OFF,
// bad browser support and slower
'unicorn/prefer-string-replace-all': OFF,
// byte savings (minification doesn't currently automatically remove)
'unicorn/switch-case-braces': [ERROR, 'avoid'],
/* stage1 */
// underscores in synthetic event handler names
'no-underscore-dangle': OFF,
'unicorn/prefer-add-event-listener': OFF,
'unicorn/prefer-dom-node-append': OFF,
'unicorn/prefer-query-selector': OFF,
},
},
{
ignores: ['*.bak', 'coverage/**', 'dist/**'],
},
);