-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.mjs
More file actions
37 lines (33 loc) · 874 Bytes
/
.eslintrc.mjs
File metadata and controls
37 lines (33 loc) · 874 Bytes
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
// .eslintrc.mjs
import { FlatCompat } from '@eslint/eslintrc';
import { fileURLToPath } from 'url';
import { dirname } from 'path';
const __dirname = dirname(fileURLToPath(import.meta.url));
const compat = new FlatCompat({ baseDirectory: __dirname });
export default [
// lump Next.js + Prettier presets together
...compat.extends('next/core-web-vitals', 'prettier'),
// global ignores
{
ignores: [
'node_modules/**',
'.next/**',
'out/**',
'build/**',
'.vercel/**',
'coverage/**',
'*.tsbuildinfo',
'next-env.d.ts',
],
},
// your custom rules on JS/TS/JSX/TSX/.mjs
{
files: ['**/*.{js,jsx,ts,tsx,mjs}'],
rules: {
'arrow-body-style': ['warn', 'as-needed'],
'no-var': 'error',
'prefer-const': 'warn',
'no-console': ['warn', { allow: ['warn', 'error'] }],
},
},
];