-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.mjs
51 lines (49 loc) · 1.52 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
import nextPlugin from '@next/eslint-plugin-next';
import tsPlugin from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import prettierPlugin from 'eslint-plugin-prettier';
import prettierConfig from 'eslint-config-prettier';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
/** @type {import('eslint').Linter.Config[]} */
const config = [
{
files: ['**/*.{ts,tsx}'],
ignores: ['.next/**', 'node_modules/**'],
plugins: {
'@typescript-eslint': tsPlugin,
'@next/next': nextPlugin,
prettier: prettierPlugin,
'react-hooks': reactHooksPlugin,
},
languageOptions: {
parser: tsParser,
parserOptions: {
project: './tsconfig.json',
ecmaVersion: 2022,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
},
settings: {
react: {
version: 'detect',
},
},
rules: {
...tsPlugin.configs.recommended.rules,
...tsPlugin.configs['recommended-requiring-type-checking'].rules,
...nextPlugin.configs.recommended.rules,
...nextPlugin.configs['core-web-vitals'].rules,
...reactHooksPlugin.configs.recommended.rules,
'prettier/prettier': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/explicit-function-return-type': 'warn',
'@typescript-eslint/explicit-module-boundary-types': 'warn',
},
},
prettierConfig,
];
export default config;