Skip to content

Commit b8adcbc

Browse files
committed
migrate eslint config
1 parent 5a6925d commit b8adcbc

File tree

4 files changed

+48
-20
lines changed

4 files changed

+48
-20
lines changed

.eslintrc

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

eslint.config.mjs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { defineConfig } from "eslint/config";
2+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
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 defineConfig([{
18+
extends: compat.extends(
19+
"eslint:recommended",
20+
"plugin:@typescript-eslint/eslint-recommended",
21+
"plugin:@typescript-eslint/recommended",
22+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
23+
"prettier",
24+
),
25+
26+
plugins: {
27+
"@typescript-eslint": typescriptEslint,
28+
},
29+
30+
languageOptions: {
31+
parser: tsParser,
32+
ecmaVersion: 5,
33+
sourceType: "script",
34+
35+
parserOptions: {
36+
project: "./tsconfig.json",
37+
},
38+
},
39+
40+
rules: {
41+
"@typescript-eslint/explicit-function-return-type": "off",
42+
},
43+
}]);

package-lock.json

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
},
3737
"homepage": "https://github.com/mnkhouri/react-circular-slider#readme",
3838
"devDependencies": {
39+
"@eslint/eslintrc": "^3.3.1",
40+
"@eslint/js": "^9.26.0",
3941
"@types/react": "^19.1.3",
4042
"@types/react-dom": "^19.1.3",
4143
"@types/react-syntax-highlighter": "^15.5.13",
@@ -63,4 +65,4 @@
6365
"pre-commit": "STATUS=$(git diff); npm run build && ([ \"$(git diff)\" == \"$STATUS\" ] || (echo 'git status changed!' && exit 1))"
6466
}
6567
}
66-
}
68+
}

0 commit comments

Comments
 (0)