generated from nirnejak/nextjs-typescript-starter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.js
70 lines (59 loc) · 1.72 KB
/
eslint.config.js
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
import { dirname } from "path"
import { fileURLToPath } from "url"
import { FlatCompat } from "@eslint/eslintrc"
import globals from "globals"
import eslint from "@eslint/js"
import tseslint from "typescript-eslint"
import love from "eslint-config-love"
import nodePlugin from "eslint-plugin-n"
import pluginPromise from "eslint-plugin-promise"
import jsxA11y from "eslint-plugin-jsx-a11y"
import tailwind from "eslint-plugin-tailwindcss"
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended"
const compat = new FlatCompat({
baseDirectory: dirname(fileURLToPath(import.meta.url)),
})
export default tseslint.config(
{ files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"] },
{
languageOptions: {
parser: tseslint.parser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
globals: globals.node,
sourceType: "module",
ecmaVersion: "latest",
},
},
eslint.configs.recommended,
tseslint.configs.recommended,
{ ...love, files: ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"] },
{
...nodePlugin.configs["flat/recommended-script"],
rules: {
"n/no-missing-import": [
"error",
{
ignoreTypeImport: true,
tryExtensions: [".ts", ".tsx", ".js", ".jsx", ".json"],
},
],
},
},
{
plugins: { "jsx-a11y": jsxA11y },
rules: jsxA11y.configs.recommended.rules,
},
pluginPromise.configs["flat/recommended"],
...compat.extends("next/core-web-vitals", "next"),
{
rules: {
"@typescript-eslint/no-magic-numbers": "off",
"eslint-comments/require-description": "off",
},
},
...tailwind.configs["flat/recommended"],
eslintPluginPrettierRecommended
)