Initial commit
This commit is contained in:
69
eslint.config.mjs
Normal file
69
eslint.config.mjs
Normal file
@@ -0,0 +1,69 @@
|
||||
import tseslint from "typescript-eslint";
|
||||
import reactPlugin from "eslint-plugin-react";
|
||||
import reactHooksPlugin from "eslint-plugin-react-hooks";
|
||||
import nextPlugin from "@next/eslint-plugin-next";
|
||||
|
||||
export default tseslint.config(
|
||||
...tseslint.configs.recommended,
|
||||
|
||||
{
|
||||
files: ["**/*.{js,jsx,ts,tsx}"],
|
||||
rules: {
|
||||
"@typescript-eslint/no-unused-vars": "warn",
|
||||
"@typescript-eslint/no-unused-expressions": "warn",
|
||||
"@typescript-eslint/no-explicit-any": "warn",
|
||||
},
|
||||
},
|
||||
|
||||
// React and Next.js specific rules
|
||||
{
|
||||
files: ["**/*.{js,jsx,ts,tsx}"],
|
||||
plugins: {
|
||||
react: reactPlugin,
|
||||
"react-hooks": reactHooksPlugin,
|
||||
"@next/next": nextPlugin,
|
||||
},
|
||||
languageOptions: {
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module",
|
||||
parserOptions: {
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
settings: {
|
||||
react: {
|
||||
version: "detect",
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
// React rules
|
||||
"react/react-in-jsx-scope": "off", // Not needed in Next.js
|
||||
"react/prop-types": "off", // TypeScript handles this
|
||||
"react/no-unescaped-entities": "off",
|
||||
|
||||
// React Hooks rules
|
||||
"react-hooks/rules-of-hooks": "error",
|
||||
"react-hooks/exhaustive-deps": "warn",
|
||||
|
||||
// Next.js rules
|
||||
"@next/next/no-html-link-for-pages": "error",
|
||||
"@next/next/no-img-element": "warn",
|
||||
},
|
||||
},
|
||||
|
||||
// Ignore patterns
|
||||
{
|
||||
ignores: [
|
||||
"node_modules/**",
|
||||
".next/**",
|
||||
"out/**",
|
||||
"build/**",
|
||||
"dist/**",
|
||||
"next-env.d.ts",
|
||||
"*.config.js",
|
||||
"*.config.mjs",
|
||||
],
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user