Skip to content

Commit 203f173

Browse files
committed
feat: add nextjs config
1 parent a21c0f3 commit 203f173

File tree

4 files changed

+599
-505
lines changed

4 files changed

+599
-505
lines changed

.github/renovate.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@
88
"group:recommended",
99
"workarounds:all",
1010
":pinAllExceptPeerDependencies",
11-
":semanticCommitTypeAll(fix)",
11+
":semanticCommitTypeAll(chore)",
1212
":disableRateLimiting"
1313
],
1414
"labels": [
1515
"dependencies"
1616
],
1717
"constraints": {
1818
"pnpm": "9"
19-
},
20-
"packageRules": []
19+
}
2120
}

eslint.config.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import js from "@eslint/js";
2-
import eslintImport from "eslint-plugin-import-x";
2+
import eslintImport, { rules } from "eslint-plugin-import-x";
33
import * as mdx from "eslint-plugin-mdx";
44
import react from "eslint-plugin-react";
55
import reactHooks from "eslint-plugin-react-hooks";
66
import simpleImportSort from "eslint-plugin-simple-import-sort";
77
import eslintPluginUnicorn from "eslint-plugin-unicorn";
88
import unusedImports from "eslint-plugin-unused-imports";
99
import tseslint from "typescript-eslint";
10+
import nextPlugin from "@next/eslint-plugin-next";
1011

1112
const tsParserOptions = {
1213
parser: tseslint.parser,
@@ -125,7 +126,9 @@ const tsRules = {
125126
"@typescript-eslint/adjacent-overload-signatures": ["warn"],
126127
"@typescript-eslint/array-type": ["warn"],
127128
"@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"],
129132
"@typescript-eslint/consistent-generic-constructors": ["warn"],
130133
"@typescript-eslint/consistent-indexed-object-style": ["warn"],
131134
"@typescript-eslint/consistent-type-assertions": ["warn", { assertionStyle: "as" }],
@@ -169,7 +172,7 @@ const tsRules = {
169172
"@typescript-eslint/no-non-null-assertion": ["warn"],
170173
"@typescript-eslint/no-redeclare": ["off"], // handled by ts
171174
"@typescript-eslint/no-redundant-type-constituents": ["warn"],
172-
"@typescript-eslint/no-throw-literal": ["warn"],
175+
"@typescript-eslint/only-throw-error": ["warn"],
173176
"@typescript-eslint/no-unnecessary-boolean-literal-compare": ["warn"],
174177
"@typescript-eslint/no-unnecessary-condition": ["warn"],
175178
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
@@ -419,4 +422,14 @@ export default [
419422
...mdx.flatCodeBlocks.rules,
420423
},
421424
},
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+
},
422435
];

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
},
2626
"dependencies": {
2727
"@eslint/js": "8.57.1",
28-
"@next/eslint-plugin-next": "15.1.2",
28+
"@next/eslint-plugin-next": "15.1.3",
2929
"@types/node": "22.10.2",
3030
"eslint": "8.57.1",
3131
"eslint-import-resolver-typescript": "3.7.0",

0 commit comments

Comments
 (0)