|
1 | 1 | import reactInternal from "./react-internal.js"; |
2 | | -import vercelNext from "@vercel/style-guide/eslint/next"; |
3 | | -import { FlatCompat } from "@eslint/eslintrc"; |
4 | 2 | import tsPlugin from "@typescript-eslint/eslint-plugin"; |
5 | 3 | import tsParser from "@typescript-eslint/parser"; |
6 | 4 | import globals from "globals"; |
7 | 5 | import { join } from "path"; |
8 | 6 |
|
9 | | -const compat = new FlatCompat(); |
10 | | - |
11 | 7 | /** |
12 | 8 | * @param {{ tsconfigRootDir: string, tsconfigName?: string }} options |
13 | 9 | * @returns {import("eslint").Config[]} |
14 | 10 | */ |
15 | 11 | export default function nextConfig({ tsconfigRootDir, tsconfigName = "tsconfig.lint.json" } = {}) { |
16 | 12 | return [ |
17 | 13 | ...reactInternal, |
18 | | - ...compat.config(vercelNext), |
| 14 | + { |
| 15 | + files: ["**/*.{ts,tsx}"], |
| 16 | + plugins: { "@typescript-eslint": tsPlugin }, |
| 17 | + languageOptions: { |
| 18 | + parser: tsParser, |
| 19 | + parserOptions: { |
| 20 | + project: join(tsconfigRootDir, tsconfigName), |
| 21 | + tsconfigRootDir, |
| 22 | + }, |
| 23 | + globals: { |
| 24 | + ...globals.browser, |
| 25 | + ...globals.node, |
| 26 | + }, |
| 27 | + }, |
| 28 | + rules: { |
| 29 | + ...tsPlugin.configs.recommended.rules, |
| 30 | + ...tsPlugin.configs["recommended-requiring-type-checking"].rules, |
| 31 | + "@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }], |
| 32 | + "no-unused-vars": "off", |
| 33 | + "@typescript-eslint/triple-slash-reference": "off", |
| 34 | + }, |
| 35 | + }, |
19 | 36 | { |
20 | 37 | files: ["**/*.{ts,tsx}"], |
21 | 38 | plugins: { "@typescript-eslint": tsPlugin }, |
|
0 commit comments