-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.ts
More file actions
67 lines (64 loc) · 2.08 KB
/
eslint.config.ts
File metadata and controls
67 lines (64 loc) · 2.08 KB
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
import antfu, { perfectionist } from '@antfu/eslint-config';
// ref: https://github.com/antfu/eslint-config/issues/661#issuecomment-2632730969
const perfectionistRules = await perfectionist();
export default antfu({
ignores: [],
stylistic: {
quotes: 'single',
semi: true,
overrides: {
'comma-dangle': ['error', 'always-multiline'],
'jsonc/comma-dangle': ['error', 'always-multiline'],
'arrow-body-style': ['error', 'as-needed'],
'no-restricted-imports': ['error', { patterns: ['../*'] }],
'unused-imports/no-unused-imports': 'warn',
'style/arrow-parens': ['error', 'always'],
'style/brace-style': ['error', '1tbs'],
},
},
typescript: {
parserOptions: {
project: ['./tsconfig.json'],
},
overrides: {
'ts/consistent-type-definitions': ['error', 'type'],
'ts/explicit-function-return-type': ['error'],
'ts/explicit-member-accessibility': ['error'],
'ts/naming-convention': [
'error',
{
selector: 'variable',
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
leadingUnderscore: 'allowSingleOrDouble',
},
],
'ts/no-floating-promises': ['error'],
'ts/no-misused-promises': ['error'],
'ts/no-confusing-void-expression': ['error'],
'ts/strict-boolean-expressions': ['error'],
'ts/switch-exhaustiveness-check': ['error'],
'ts/array-type': ['error', { default: 'array-simple' }],
'ts/no-restricted-types': [
'error',
{ types: { Omit: 'Use `OmitStrict`.' } },
],
'ts/no-unsafe-argument': 'error',
// https://typescript-eslint.io/rules/dot-notation/
'dot-notation': 'off',
'ts/dot-notation': 'error',
},
},
rules: {
'antfu/no-top-level-await': 'off',
'perfectionist/sort-imports': [
'error',
{
// @ts-expect-error: import のソート順序の決定を perfectionist に任せる
...perfectionistRules[0].rules['perfectionist/sort-imports'][1],
environment: 'bun',
},
],
},
formatters: true,
isInEditor: false,
});