-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
53 lines (49 loc) · 1.45 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
import eslint from '@eslint/js';
import mm from '@maxmilton/eslint-config';
import security from 'eslint-plugin-security';
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,
security.configs.recommended,
{
linterOptions: {
reportUnusedDisableDirectives: ERROR,
},
languageOptions: {
parserOptions: {
project: ['tsconfig.json', 'tsconfig.node.json'],
projectService: {
allowDefaultProject: ['*.mjs'],
},
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
// bad browser support
'unicorn/prefer-at': OFF,
// prefer to clearly separate Bun and DOM
'unicorn/prefer-global-this': OFF,
/* Performance and byte savings */
// byte savings
'no-plusplus': 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/**'],
},
);