Skip to content

Commit 2d65c99

Browse files
committed
addressing linter
1 parent 4f94bde commit 2d65c99

File tree

2 files changed

+42
-15
lines changed

2 files changed

+42
-15
lines changed

client/eslint.config.mjs

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,43 @@
1-
import { fixupConfigRules } from "@eslint/compat";
2-
import path from "node:path";
3-
import { fileURLToPath } from "node:url";
41
import js from "@eslint/js";
5-
import { FlatCompat } from "@eslint/eslintrc";
2+
import tsPlugin from "@typescript-eslint/eslint-plugin";
3+
import tsParser from "@typescript-eslint/parser";
4+
import reactPlugin from "eslint-plugin-react";
5+
import globals from "globals";
66

7-
const __filename = fileURLToPath(import.meta.url);
8-
const __dirname = path.dirname(__filename);
9-
const compat = new FlatCompat({
10-
baseDirectory: __dirname,
11-
recommendedConfig: js.configs.recommended,
12-
allConfig: js.configs.all
13-
});
14-
15-
export default [{
16-
ignores: [],
17-
}, ...fixupConfigRules(compat.extends("react-app"))];
7+
export default [
8+
{
9+
ignores: ["node_modules/**", "dist/**", "build/**", "coverage/**"]
10+
},
11+
{
12+
files: ["**/*.{js,jsx,ts,tsx}"],
13+
languageOptions: {
14+
ecmaVersion: 2020,
15+
sourceType: "module",
16+
globals: {
17+
...globals.browser,
18+
...globals.node
19+
},
20+
parser: tsParser,
21+
parserOptions: {
22+
ecmaFeatures: {
23+
jsx: true
24+
}
25+
}
26+
},
27+
plugins: {
28+
"@typescript-eslint": tsPlugin,
29+
"react": reactPlugin
30+
},
31+
rules: {
32+
...js.configs.recommended.rules,
33+
...tsPlugin.configs.recommended.rules,
34+
"react/react-in-jsx-scope": "off",
35+
"react/prop-types": "off"
36+
},
37+
settings: {
38+
react: {
39+
version: "detect"
40+
}
41+
}
42+
}
43+
];

client/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
"@vitest/coverage-v8": "3.1.2",
6868
"eslint": "^9.37.0",
6969
"eslint-plugin-react": "^7.37.5",
70+
"globals": "^15.0.0",
7071
"jsdom": "^25.0.1",
7172
"react-error-overlay": "6.0.9",
7273
"react-router-dom": "^7.13.0",

0 commit comments

Comments
 (0)