-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy patheslint.config.mjs
More file actions
53 lines (44 loc) · 1.32 KB
/
eslint.config.mjs
File metadata and controls
53 lines (44 loc) · 1.32 KB
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
import js from '@eslint/js';
import nextCoreWebVitals from 'eslint-config-next/core-web-vitals';
import nextTypescript from 'eslint-config-next/typescript';
import prettierPlugin from 'eslint-plugin-prettier';
const config = [
// 1. JS recommended
js.configs.recommended,
// 2. Next.js + Core Web Vitals + TypeScript (flat config from eslint-config-next@16)
...nextCoreWebVitals,
...nextTypescript,
// 3. Custom rule
{
plugins: {
prettier: prettierPlugin,
},
rules: {
// Prettier
'prettier/prettier': 'error',
// React / Next
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'react/no-unescaped-entities': 'off',
// A11y
'jsx-a11y/anchor-is-valid': [
'error',
{
components: ['Link'],
specialLink: ['hrefLeft', 'hrefRight'],
aspects: ['invalidHref', 'preferButton'],
},
],
// TypeScript
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
},
},
// 4. Ignore files
{
ignores: ['.next/**', 'out/**', 'build/**', 'next-env.d.ts', 'tailwind.config.js', './.contentlayer/**'],
},
];
export default config;