-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
74 lines (72 loc) · 2.18 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
64
65
66
67
68
69
70
71
72
73
74
import tsEslintPlugin from '@typescript-eslint/eslint-plugin';
import tsEslintParser from '@typescript-eslint/parser';
import eslintConfigPrettier from 'eslint-config-prettier';
import eslintPluginImport from 'eslint-plugin-import-x';
import eslintPluginReactHooks from 'eslint-plugin-react-hooks';
import eslintPluginReact from 'eslint-plugin-react';
import eslintPluginTailwind from 'eslint-plugin-tailwindcss';
import globals from 'globals';
export default [
{
files: ['src/**.*.js', 'src/**/*.ts', 'src/**/*.tsx'],
languageOptions: {
parser: tsEslintParser,
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
},
globals: {
...globals.node,
},
},
plugins: {
'@typescript-eslint': tsEslintPlugin,
'import-x': eslintPluginImport,
'react-hooks': eslintPluginReactHooks,
'react': eslintPluginReact,
'tailwindcss': eslintPluginTailwind,
},
settings: {
'import-x/resolver': {
typescript: true,
node: true,
},
},
rules: {
...eslintConfigPrettier.rules,
...tsEslintPlugin.configs.recommended.rules,
...eslintPluginImport.configs.recommended.rules,
...eslintPluginReact.configs.recommended.rules,
...eslintPluginReactHooks.configs.recommended.rules,
...eslintPluginTailwind.configs.recommended.rules,
'import-x/order': [
'warn',
{
'groups': ['builtin', 'external'],
'alphabetize': {
order: 'asc',
caseInsensitive: true,
},
'newlines-between': 'always',
'pathGroupsExcludedImportTypes': ['type'],
},
],
'no-console': ['error', { allow: ['info', 'warn', 'error'] }],
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['src/*'],
message: 'Imports must be relative to the src directory.',
},
],
},
],
'@typescript-eslint/no-unused-vars': [
'error',
{ ignoreRestSiblings: true, argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' },
],
},
},
];