Skip to content

Commit 401fef5

Browse files
committed
Upgraded eslint dependencies and config file.
1 parent 6416d66 commit 401fef5

File tree

5 files changed

+366
-448
lines changed

5 files changed

+366
-448
lines changed

.eslintignore

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

.eslintrc.js

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

eslint.config.mjs

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
2+
import globals from "globals";
3+
import tsParser from "@typescript-eslint/parser";
4+
import path from "node:path";
5+
import { fileURLToPath } from "node:url";
6+
import js from "@eslint/js";
7+
import { FlatCompat } from "@eslint/eslintrc";
8+
9+
const __filename = fileURLToPath(import.meta.url);
10+
const __dirname = path.dirname(__filename);
11+
const compat = new FlatCompat({
12+
baseDirectory: __dirname,
13+
recommendedConfig: js.configs.recommended,
14+
allConfig: js.configs.all,
15+
});
16+
17+
export default [
18+
{
19+
ignores: [
20+
"**/dist/**/*",
21+
"**/node_modules",
22+
"packages/turf/turf.js",
23+
"packages/turf/turf.min.js",
24+
"packages/turf/test.example.js",
25+
],
26+
},
27+
...compat.extends(
28+
"eslint:recommended",
29+
"plugin:@typescript-eslint/recommended",
30+
"plugin:prettier/recommended"
31+
),
32+
{
33+
plugins: {
34+
"@typescript-eslint": typescriptEslint,
35+
},
36+
37+
languageOptions: {
38+
globals: {
39+
...globals.node,
40+
},
41+
42+
parser: tsParser,
43+
ecmaVersion: 6,
44+
sourceType: "module",
45+
},
46+
47+
rules: {
48+
"@typescript-eslint/no-unused-vars": [
49+
"error",
50+
{
51+
argsIgnorePattern: "^_",
52+
},
53+
],
54+
55+
"@typescript-eslint/explicit-module-boundary-types": "off",
56+
"@typescript-eslint/no-explicit-any": "off",
57+
"@typescript-eslint/no-non-null-assertion": "off",
58+
"@typescript-eslint/no-var-requires": "off",
59+
"no-constant-condition": "off",
60+
"no-redeclare": "off",
61+
"no-var": "off",
62+
"prefer-const": "off",
63+
},
64+
},
65+
{
66+
files: ["packages/*/types.ts", "packages/*/test.ts"],
67+
68+
rules: {
69+
"@typescript-eslint/no-unused-vars": "off",
70+
"@typescript-eslint/no-unused-expressions": "off",
71+
},
72+
},
73+
{
74+
files: [
75+
"**/.eslintrc.js",
76+
"packages/*/bench.js",
77+
"packages/*/test.js",
78+
"packages/turf/rollup.config.js",
79+
"scripts/check-dependencies.js",
80+
],
81+
82+
languageOptions: {
83+
globals: {
84+
...globals.node,
85+
},
86+
},
87+
},
88+
{
89+
files: [
90+
"packages/turf-isobands/lib/marchingsquares-isobands.js",
91+
"packages/turf-isolines/lib/marchingsquares-isocontours.js",
92+
],
93+
94+
languageOptions: {
95+
globals: {
96+
...globals.browser,
97+
},
98+
},
99+
},
100+
];

package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,29 @@
2929
},
3030
"packageManager": "pnpm@8.15.8+sha512.d1a029e1a447ad90bc96cd58b0fad486d2993d531856396f7babf2d83eb1823bb83c5a3d0fc18f675b2d10321d49eb161fece36fe8134aa5823ecd215feed392",
3131
"devDependencies": {
32+
"@eslint/eslintrc": "^3.2.0",
33+
"@eslint/js": "^9.16.0",
3234
"@monorepolint/cli": "0.5.0",
3335
"@monorepolint/config": "0.5.0",
3436
"@monorepolint/core": "0.5.0",
3537
"@monorepolint/rules": "0.5.0",
3638
"@types/node": "18.11.9",
37-
"@typescript-eslint/eslint-plugin": "^6.10.0",
38-
"@typescript-eslint/parser": "^6.10.0",
39+
"@typescript-eslint/eslint-plugin": "^8.17.0",
40+
"@typescript-eslint/parser": "^8.17.0",
3941
"acorn": "^7.4.1",
4042
"camelcase": "^8.0.0",
4143
"d3-queue": "*",
4244
"decamelize": "^6.0.0",
4345
"dependency-tree": "^11.0.0",
4446
"documentation": "^14.0.3",
4547
"es-check": "^7.1.1",
46-
"eslint": "^8.53.0",
47-
"eslint-config-prettier": "^9.0.0",
48-
"eslint-plugin-prettier": "^5.0.1",
48+
"eslint": "^9.16.0",
49+
"eslint-config-prettier": "^9.1.0",
50+
"eslint-plugin-prettier": "^5.2.1",
4951
"esm": "^3.2.25",
5052
"fs-extra": "^11.1.1",
5153
"glob": "^10.3.10",
54+
"globals": "^15.13.0",
5255
"husky": "^9.0.0",
5356
"lerna": "^8.1.9",
5457
"lint-staged": "^15.2.8",

0 commit comments

Comments
 (0)