Skip to content

Commit 94f87df

Browse files
authored
Merge pull request #88 from sevensc/chore(migrate-eslint)
Chore(migrate eslint)
2 parents 2e711d1 + 345bbbc commit 94f87df

File tree

6 files changed

+1776
-1625
lines changed

6 files changed

+1776
-1625
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2.1
33
executors:
44
nodejs:
55
docker:
6-
- image: cimg/node:21.7.3
6+
- image: cimg/node:22.17.0
77

88
commands:
99
checkout-and-restore-cache:

.eslintignore

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

.eslintrc.json

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

eslint.config.mjs

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import { defineConfig, globalIgnores } from "eslint/config";
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 defineConfig([globalIgnores(["**/*.js", "**/*.d.ts"]), {
19+
extends: compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended"),
20+
21+
plugins: {
22+
"@typescript-eslint": typescriptEslint,
23+
},
24+
25+
languageOptions: {
26+
globals: {
27+
...globals.browser,
28+
...globals.commonjs,
29+
...globals.node,
30+
},
31+
32+
parser: tsParser,
33+
ecmaVersion: "latest",
34+
sourceType: "commonjs",
35+
},
36+
ignores: [
37+
"*.*js",
38+
"*.d.ts"
39+
],
40+
rules: {
41+
"@typescript-eslint/no-explicit-any": ["off"],
42+
"@typescript-eslint/no-var-requires": ["off"],
43+
"@typescript-eslint/no-inferrable-types": ["off"],
44+
indent: ["off", "tab"],
45+
"linebreak-style": ["warn", "unix"],
46+
"no-mixed-spaces-and-tabs": ["warn", "smart-tabs"],
47+
48+
quotes: ["warn", "single", {
49+
allowTemplateLiterals: true,
50+
}],
51+
52+
semi: ["warn", "always"],
53+
"comma-dangle": ["warn", "always-multiline"],
54+
},
55+
}]);

package.json

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,19 @@
2929
},
3030
"homepage": "https://github.com/sevensc/typescript-string-operations#readme",
3131
"devDependencies": {
32-
"@types/jest": "^29.5.12",
33-
"@types/node": "^22.0.0",
34-
"@typescript-eslint/eslint-plugin": "^7.1.1",
35-
"@typescript-eslint/parser": "^7.1.1",
36-
"eslint": "^8.57.0",
37-
"jest": "^29.7.0",
38-
"ts-jest": "^29.1.2",
32+
"@eslint/eslintrc": "^3.3.1",
33+
"@eslint/js": "^9.30.0",
34+
"@types/jest": "^30.0.0",
35+
"@types/node": "^24.0.7",
36+
"@typescript-eslint/eslint-plugin": "^8.35.0",
37+
"@typescript-eslint/parser": "^8.35.0",
38+
"eslint": "^9.30.0",
39+
"globals": "^16.2.0",
40+
"jest": "^30.0.3",
41+
"ts-jest": "^29.4.0",
3942
"ts-node": "^10.9.2",
40-
"typescript": "^5.4.2",
41-
"uglify-js": "^3.17.4"
43+
"typescript": "^5.8.3",
44+
"uglify-js": "^3.19.3"
4245
},
4346
"directories": {},
4447
"resolutions": {

0 commit comments

Comments
 (0)