generated from archoleat/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
62 lines (61 loc) · 1.8 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
53
54
55
56
57
58
59
60
61
62
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 nextPlugin from '@next/eslint-plugin-next';
import parser from '@typescript-eslint/parser';
import prettierConfig from 'eslint-config-prettier';
import unicornPlugin from 'eslint-plugin-unicorn';
export default defineFlatConfig([
...extend('airbnb', 'airbnb-typescript', 'plugin:react/jsx-runtime'),
{
files: ['src/**/*.tsx', 'src/**/*.ts'],
languageOptions: {
parser,
globals: {
...globals.browser,
...globals.es2015,
},
parserOptions: {
ecmaVersion: 'latest',
project: 'tsconfig.json',
},
sourceType: 'module',
},
settings: {
'import/resolver': {
typescript: {
project: 'tsconfig.json',
},
},
},
plugins: {
'simple-import-sort': importSortPlugin,
next: nextPlugin,
unicorn: unicornPlugin,
},
rules: {
'func-style': ['error', 'expression'],
'simple-import-sort/imports': 'warn',
'simple-import-sort/exports': 'warn',
'import/exports-last': 'error',
'import/group-exports': 'error',
'import/no-commonjs': 'error',
'import/no-default-export': 'off',
'import/no-namespace': 'error',
'import/no-unassigned-import': 'off',
'import/prefer-default-export': 'off',
'react/function-component-definition': [
'error',
{
namedComponents: 'arrow-function',
unnamedComponents: 'arrow-function',
},
],
'react/jsx-sort-props': 'warn',
'unicorn/no-unused-properties': 'warn',
'unicorn/string-content': 'warn',
},
},
prettierConfig,
]);