Skip to content

Commit 58c9c6c

Browse files
author
jannik brack
committed
add new config, add dependencie global, @eslint/js, @eslint/eslintrc
1 parent 1f36165 commit 58c9c6c

File tree

3 files changed

+77
-1
lines changed

3 files changed

+77
-1
lines changed

eslint.config.mjs

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import react from "eslint-plugin-react";
2+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
3+
import globals from "globals";
4+
import tsParser from "@typescript-eslint/parser";
5+
import path from "node:path";
6+
import { fileURLToPath } from "node:url";
7+
import js from "@eslint/js";
8+
import { FlatCompat } from "@eslint/eslintrc";
9+
10+
const __filename = fileURLToPath(import.meta.url);
11+
const __dirname = path.dirname(__filename);
12+
const compat = new FlatCompat({
13+
baseDirectory: __dirname,
14+
recommendedConfig: js.configs.recommended,
15+
allConfig: js.configs.all
16+
});
17+
18+
export default [{
19+
ignores: [
20+
"**/.cache",
21+
"**/.github",
22+
"**/.storybook",
23+
"**/.vscode",
24+
"**/coverage",
25+
"**/dist",
26+
"**/docs",
27+
"**/docs-build",
28+
"**/js-docs",
29+
"**/node_modules",
30+
"**/storybook-static",
31+
"**/scripts",
32+
],
33+
}, ...compat.extends(
34+
"eslint:recommended",
35+
"plugin:react/recommended",
36+
"plugin:@typescript-eslint/recommended",
37+
"prettier",
38+
"plugin:storybook/recommended",
39+
), {
40+
plugins: {
41+
react,
42+
"@typescript-eslint": typescriptEslint,
43+
},
44+
45+
languageOptions: {
46+
globals: {
47+
...globals.browser,
48+
...globals.node,
49+
...globals.jest,
50+
},
51+
52+
parser: tsParser,
53+
ecmaVersion: "latest",
54+
sourceType: "module",
55+
},
56+
57+
settings: {
58+
react: {
59+
version: "detect",
60+
},
61+
},
62+
63+
rules: {
64+
"react/prop-types": "off",
65+
"@typescript-eslint/no-empty-function": "off",
66+
"@typescript-eslint/no-explicit-any": "off",
67+
},
68+
}];

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
"@emotion/css": "^11.13.5",
2727
"@emotion/react": "^11.14.0",
2828
"@emotion/styled": "^11.14.0",
29+
"@eslint/eslintrc": "^3.3.0",
30+
"@eslint/js": "^9.22.0",
2931
"@mapbox/mapbox-gl-draw": "^1.4.3",
3032
"@mapbox/mapbox-gl-sync-move": "^0.3.1",
3133
"@mui/icons-material": "^6.4.7",
@@ -42,6 +44,7 @@
4244
"@xmldom/xmldom": "^0.9.8",
4345
"csv2geojson": "^5.1.2",
4446
"d3": "^7.9.0",
47+
"globals": "^16.0.0",
4548
"jspdf": "^3.0.0",
4649
"maplibre-gl": "4.2.0",
4750
"osm2geojson-lite": "^1.0.2",

yarn.lock

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1770,7 +1770,7 @@
17701770
minimatch "^3.1.2"
17711771
strip-json-comments "^3.1.1"
17721772

1773-
1773+
"@eslint/[email protected]", "@eslint/js@^9.22.0":
17741774
version "9.22.0"
17751775
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.22.0.tgz#4ff53649ded7cbce90b444b494c234137fa1aa3d"
17761776
integrity sha512-vLFajx9o8d1/oL2ZkpMYbkLv8nDB6yaIwFNt7nI4+I80U/z03SxmfOMsLbvWr3p7C+Wnoh//aOu2pQW8cS0HCQ==
@@ -10675,6 +10675,11 @@ globals@^14.0.0:
1067510675
resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e"
1067610676
integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==
1067710677

10678+
globals@^16.0.0:
10679+
version "16.0.0"
10680+
resolved "https://registry.yarnpkg.com/globals/-/globals-16.0.0.tgz#3d7684652c5c4fbd086ec82f9448214da49382d8"
10681+
integrity sha512-iInW14XItCXET01CQFqudPOWP2jYMl7T+QRQT+UNcR/iQncN/F0UNpgd76iFkBPgNQb4+X3LV9tLJYzwh+Gl3A==
10682+
1067810683
globalthis@^1.0.3:
1067910684
version "1.0.3"
1068010685
resolved "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz"

0 commit comments

Comments
 (0)