generated from archoleat/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
52 lines (51 loc) · 1.49 KB
/
eslint.config.js
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
import { defineFlatConfig } from 'eslint-define-config';
import { extend } from '@archoleat/eslint-flat-compatibility';
import globals from 'globals';
import importSortPlugin from 'eslint-plugin-simple-import-sort';
import parser from '@typescript-eslint/parser';
import prettierConfig from 'eslint-config-prettier';
import unicornPlugin from 'eslint-plugin-unicorn';
export default defineFlatConfig([
...extend('airbnb-base', 'airbnb-typescript/base'),
{
files: ['src/**/*.ts'],
languageOptions: {
parser,
globals: {
...globals.node,
...globals.es2015,
},
parserOptions: {
ecmaVersion: 'latest',
project: 'tsconfig.json',
},
sourceType: 'module',
},
settings: {
'import/resolver': {
typescript: {
project: 'tsconfig.json',
},
},
},
plugins: {
'simple-import-sort': importSortPlugin,
unicorn: unicornPlugin,
},
rules: {
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'import/exports-last': 'error',
'import/extensions': ['error', { ts: 'always' }],
'import/group-exports': 'error',
'import/no-commonjs': 'error',
'import/no-default-export': 'off',
'import/no-namespace': 'error',
'import/no-unassigned-import': 'error',
'import/prefer-default-export': 'off',
'unicorn/no-unused-properties': 'error',
'unicorn/string-content': 'error',
},
},
prettierConfig,
]);