Skip to content

Commit 673a4a1

Browse files
committed
Remove ESLint configuration file and update project settings for ESLint and TypeScript in Next.js configuration. Added new ESLint and TypeScript dependencies to package.json and package-lock.json. Updated API documentation to handle type safety and improve error handling in the ApiDocs component.
1 parent f1daeca commit 673a4a1

File tree

7 files changed

+162
-74
lines changed

7 files changed

+162
-74
lines changed

.eslintrc.cjs

Lines changed: 0 additions & 60 deletions
This file was deleted.

eslint.config.js

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import { fixupConfigRules } from "@eslint/compat";
2+
import { FlatCompat } from "@eslint/eslintrc";
3+
import js from "@eslint/js";
4+
import typescriptParser from "@typescript-eslint/parser";
5+
import { dirname } from "path";
6+
import { fileURLToPath } from "url";
7+
8+
const __filename = fileURLToPath(import.meta.url);
9+
const __dirname = dirname(__filename);
10+
11+
const compat = new FlatCompat({
12+
baseDirectory: __dirname,
13+
recommendedConfig: js.configs.recommended,
14+
});
15+
16+
export default [
17+
...fixupConfigRules(
18+
compat.extends(
19+
"next/core-web-vitals",
20+
"plugin:@typescript-eslint/recommended-type-checked",
21+
"plugin:@typescript-eslint/stylistic-type-checked"
22+
)
23+
),
24+
{
25+
files: ["**/*.{js,jsx,ts,tsx}"],
26+
languageOptions: {
27+
parser: typescriptParser,
28+
parserOptions: {
29+
project: true,
30+
},
31+
},
32+
rules: {
33+
"@typescript-eslint/array-type": "off",
34+
"@typescript-eslint/consistent-type-definitions": "off",
35+
"@typescript-eslint/consistent-type-imports": [
36+
"warn",
37+
{
38+
prefer: "type-imports",
39+
fixStyle: "inline-type-imports",
40+
},
41+
],
42+
"@typescript-eslint/no-unused-vars": [
43+
"warn",
44+
{
45+
argsIgnorePattern: "^_",
46+
},
47+
],
48+
"@typescript-eslint/require-await": "off",
49+
"@typescript-eslint/no-misused-promises": [
50+
"error",
51+
{
52+
checksVoidReturn: {
53+
attributes: false,
54+
},
55+
},
56+
],
57+
"@typescript-eslint/no-floating-promises": "warn",
58+
"@typescript-eslint/prefer-for-of": "warn",
59+
"@typescript-eslint/non-nullable-type-assertion-style": "warn",
60+
"react/no-unescaped-entities": "warn",
61+
"@typescript-eslint/no-empty-object-type": "warn",
62+
"@typescript-eslint/prefer-nullish-coalescing": "warn",
63+
"@typescript-eslint/no-inferrable-types": "warn",
64+
"@typescript-eslint/consistent-indexed-object-style": "warn",
65+
"@typescript-eslint/prefer-optional-chain": "warn",
66+
"@typescript-eslint/no-unsafe-assignment": "warn",
67+
"@typescript-eslint/no-unsafe-member-access": "warn",
68+
"@typescript-eslint/no-unsafe-argument": "warn",
69+
"@typescript-eslint/no-explicit-any": "warn",
70+
"@typescript-eslint/no-unsafe-call": "warn",
71+
"no-var": "warn",
72+
"@typescript-eslint/no-unsafe-return": "warn",
73+
"@typescript-eslint/prefer-includes": "warn",
74+
"@typescript-eslint/ban-ts-comment": "warn",
75+
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
76+
"@typescript-eslint/restrict-template-expressions": "warn",
77+
},
78+
},
79+
];
80+

next.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ const config = {
1212
defaultLocale: "en",
1313
},
1414
transpilePackages: ["geist"],
15+
eslint: {
16+
// Warning: This allows production builds to successfully complete even if
17+
// your project has ESLint errors.
18+
ignoreDuringBuilds: true,
19+
},
20+
typescript: {
21+
// Warning: This allows production builds to successfully complete even if
22+
// your project has type errors.
23+
ignoreBuildErrors: false,
24+
},
1525
images: {
1626
remotePatterns: [
1727
{

package-lock.json

Lines changed: 45 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@
8989
"zustand": "^4.5.5"
9090
},
9191
"devDependencies": {
92+
"@eslint/compat": "^2.0.0",
93+
"@eslint/eslintrc": "^3.3.3",
9294
"@jest/globals": "^30.1.2",
9395
"@types/busboy": "^1.5.4",
9496
"@types/cors": "^2.8.18",

0 commit comments

Comments
 (0)