-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.mjs
63 lines (62 loc) · 2.19 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
// @ts-check
import lovePreset from 'eslint-config-love'
import prettier from 'eslint-plugin-prettier/recommended'
import globals from 'globals'
import tseslint from 'typescript-eslint'
export default tseslint.config(
lovePreset,
prettier,
{
files: ['**/*.{js,mjs,cjs}', '**/*.{ts,tsx,mts,cts}'],
},
{
ignores: ['dist', 'styled-system', 'vite.config.ts.timestamp-*.mjs'],
},
{
languageOptions: {
globals: globals.webextensions,
},
rules: {
'@typescript-eslint/prefer-destructuring': 'off', // false positives, less readable sometimes
'@typescript-eslint/no-magic-numbers': 'off', // too many false positives
'@typescript-eslint/init-declarations': 'off', // too many false positives
'@typescript-eslint/no-empty-function': 'off', // useless,
'@typescript-eslint/no-unsafe-type-assertion': 'off', // doesn't allow type assertions where they are necessary
'@typescript-eslint/class-methods-use-this': 'off', // useless,
'@typescript-eslint/no-deprecated': 'off', // false positives, example: chrome namespace
'import/order': [
'error',
{
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
pathGroups: [
{ pattern: 'solid-js', group: 'external', position: 'before' },
{ pattern: 'solid-js/**', group: 'external', position: 'before' },
{ pattern: 'styled-system', group: 'external', position: 'before' },
{ pattern: 'styled-system/**', group: 'external', position: 'before' },
{ pattern: '@test/**', group: 'internal', position: 'after' },
{ pattern: '@/**', group: 'internal', position: 'after' },
],
pathGroupsExcludedImportTypes: [],
'newlines-between': 'never',
},
],
'sort-imports': [
'error',
{
ignoreCase: true,
ignoreDeclarationSort: true,
},
],
},
},
{
files: ['**/*.test.{js,mjs,cjs}', '**/*.test.{ts,tsx,mts,cts}'],
rules: {
'@typescript-eslint/no-unsafe-assignment': 'off',
},
},
)