Skip to content

Commit 886b741

Browse files
committed
Changing linting rules
1 parent f8a149a commit 886b741

File tree

2 files changed

+63
-11
lines changed

2 files changed

+63
-11
lines changed

eslint.config.mjs

Lines changed: 63 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,67 @@
1-
import { dirname } from "path";
2-
import { fileURLToPath } from "url";
3-
import { FlatCompat } from "@eslint/eslintrc";
1+
import js from "@eslint/js";
2+
import nextPlugin from "@next/eslint-plugin-next";
3+
import reactPlugin from "eslint-plugin-react";
4+
import reactHooksPlugin from "eslint-plugin-react-hooks";
5+
import tailwindcssPlugin from "eslint-plugin-tailwindcss";
6+
import globals from "globals";
47

5-
const __filename = fileURLToPath(import.meta.url);
6-
const __dirname = dirname(__filename);
8+
export default [
9+
// Base JS rules
10+
js.configs.recommended,
711

8-
const compat = new FlatCompat({
9-
baseDirectory: __dirname,
10-
});
12+
// Next.js recommended rules (core-web-vitals)
13+
{
14+
plugins: {
15+
"@next/next": nextPlugin,
16+
},
17+
rules: {
18+
...nextPlugin.configs["core-web-vitals"].rules,
19+
},
20+
},
1121

12-
const eslintConfig = [...compat.extends("next/core-web-vitals")];
22+
// React & React Hooks
23+
{
24+
plugins: {
25+
react: reactPlugin,
26+
"react-hooks": reactHooksPlugin,
27+
},
28+
languageOptions: {
29+
globals: {
30+
...globals.browser,
31+
...globals.node,
32+
},
33+
parserOptions: {
34+
ecmaFeatures: {
35+
jsx: true,
36+
},
37+
ecmaVersion: "latest",
38+
sourceType: "module",
39+
},
40+
},
41+
rules: {
42+
...reactPlugin.configs.recommended.rules,
43+
...reactHooksPlugin.configs.recommended.rules,
44+
"react/react-in-jsx-scope": "off", // Next.js handles React import
45+
},
46+
settings: {
47+
react: {
48+
version: "detect",
49+
},
50+
},
51+
},
1352

14-
export default eslintConfig;
53+
// TailwindCSS support
54+
{
55+
plugins: {
56+
tailwindcss: tailwindcssPlugin,
57+
},
58+
rules: {
59+
...tailwindcssPlugin.configs.recommended.rules,
60+
},
61+
},
62+
63+
// General settings
64+
{
65+
ignores: ["node_modules/**", ".next/**", "out/**", "dist/**"],
66+
},
67+
];

src/app/globals.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* Tailwind CSS Directives */
22
@import "tailwindcss";
3-
43
@import url('https://fonts.googleapis.com/css2?family=Chicle&display=swap');
54

65
@theme {

0 commit comments

Comments
 (0)