-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy patheslint.config.mjs
71 lines (67 loc) · 1.75 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
// @ts-check
import { FlatCompat } from '@eslint/eslintrc';
import eslint from '@eslint/js';
import tsParser from '@typescript-eslint/parser';
import reactCompiler from 'eslint-plugin-react-compiler';
import unusedImports from 'eslint-plugin-unused-imports';
import tseslint from 'typescript-eslint';
const compat = new FlatCompat({
baseDirectory: import.meta.dirname,
});
const nextEslintConfig = [
...compat.extends('next/core-web-vitals', 'next/typescript'),
];
export default tseslint.config(
nextEslintConfig,
eslint.configs.recommended,
tseslint.configs.recommended,
{
ignores: [
'**/**/node_modules',
'**/**/.next',
'**/**/public',
'components/ui',
'env.js',
'**/.eslintrc.cjs',
'**/*.config.js',
'**/*.config.cjs',
'**/*.config.mjs',
'.next',
'dist',
'pnpm-lock.yaml',
],
},
{
plugins: {
'unused-imports': unusedImports,
'react-compiler': reactCompiler,
},
languageOptions: {
parser: tsParser,
ecmaVersion: 'latest',
sourceType: 'module',
parserOptions: {
project: ['./tsconfig.json'],
},
},
},
{
rules: {
'react/prop-types': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/consistent-type-imports': [
'warn',
{ prefer: 'type-imports', fixStyle: 'separate-type-imports' },
],
'@typescript-eslint/no-misused-promises': [
2,
{ checksVoidReturn: { attributes: false } },
],
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
},
}
);