|
1 | 1 | import js from "@eslint/js"; |
2 | | -import eslintImport from "eslint-plugin-import-x"; |
| 2 | +import eslintImport, { rules } from "eslint-plugin-import-x"; |
3 | 3 | import * as mdx from "eslint-plugin-mdx"; |
4 | 4 | import react from "eslint-plugin-react"; |
5 | 5 | import reactHooks from "eslint-plugin-react-hooks"; |
6 | 6 | import simpleImportSort from "eslint-plugin-simple-import-sort"; |
7 | 7 | import eslintPluginUnicorn from "eslint-plugin-unicorn"; |
8 | 8 | import unusedImports from "eslint-plugin-unused-imports"; |
9 | 9 | import tseslint from "typescript-eslint"; |
| 10 | +import nextPlugin from "@next/eslint-plugin-next"; |
10 | 11 |
|
11 | 12 | const tsParserOptions = { |
12 | 13 | parser: tseslint.parser, |
@@ -125,7 +126,9 @@ const tsRules = { |
125 | 126 | "@typescript-eslint/adjacent-overload-signatures": ["warn"], |
126 | 127 | "@typescript-eslint/array-type": ["warn"], |
127 | 128 | "@typescript-eslint/await-thenable": ["error"], |
128 | | - "@typescript-eslint/ban-types": ["warn"], |
| 129 | + "@typescript-eslint/no-empty-object-type": ["warn"], |
| 130 | + "@typescript-eslint/no-unsafe-function-type": ["warn"], |
| 131 | + "@typescript-eslint/no-wrapper-object-types": ["warn"], |
129 | 132 | "@typescript-eslint/consistent-generic-constructors": ["warn"], |
130 | 133 | "@typescript-eslint/consistent-indexed-object-style": ["warn"], |
131 | 134 | "@typescript-eslint/consistent-type-assertions": ["warn", { assertionStyle: "as" }], |
@@ -169,7 +172,7 @@ const tsRules = { |
169 | 172 | "@typescript-eslint/no-non-null-assertion": ["warn"], |
170 | 173 | "@typescript-eslint/no-redeclare": ["off"], // handled by ts |
171 | 174 | "@typescript-eslint/no-redundant-type-constituents": ["warn"], |
172 | | - "@typescript-eslint/no-throw-literal": ["warn"], |
| 175 | + "@typescript-eslint/only-throw-error": ["warn"], |
173 | 176 | "@typescript-eslint/no-unnecessary-boolean-literal-compare": ["warn"], |
174 | 177 | "@typescript-eslint/no-unnecessary-condition": ["warn"], |
175 | 178 | "@typescript-eslint/no-unnecessary-type-assertion": "warn", |
@@ -419,4 +422,14 @@ export default [ |
419 | 422 | ...mdx.flatCodeBlocks.rules, |
420 | 423 | }, |
421 | 424 | }, |
| 425 | + { |
| 426 | + name: "next-js", |
| 427 | + plugins: { |
| 428 | + "@next/next": nextPlugin, |
| 429 | + }, |
| 430 | + rules: { |
| 431 | + ...nextPlugin.configs.recommended.rules, |
| 432 | + ...nextPlugin.configs["core-web-vitals"].rules, |
| 433 | + }, |
| 434 | + }, |
422 | 435 | ]; |
0 commit comments