Skip to content

Commit da51552

Browse files
Fix/incorrect eslint config (#152)
* Fix/incorrect eslint config * Update .idx/dev.nix Co-authored-by: Asuka Minato <[email protected]> --------- Co-authored-by: Asuka Minato <[email protected]>
1 parent 7300e34 commit da51552

File tree

4 files changed

+243
-278
lines changed

4 files changed

+243
-278
lines changed

.eslintrc.json

-26
This file was deleted.

eslint.config.mjs

+25-36
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,31 @@
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-
});
1+
import pluginJs from '@eslint/js'
2+
import eslintConfigPrettier from 'eslint-config-prettier'
3+
import tseslint from 'typescript-eslint'
164

5+
/** @type {import('eslint').Linter.Config[]} */
176
export default [
18-
...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"),
19-
{
20-
plugins: {
21-
"@typescript-eslint": typescriptEslint,
22-
},
7+
pluginJs.configs.recommended,
8+
...tseslint.configs.recommended,
9+
{
10+
plugins: {
11+
'@typescript-eslint': tseslint.plugin,
12+
},
2313

24-
languageOptions: {
25-
globals: {
26-
...globals.browser,
27-
...globals.node,
28-
...globals.amd,
29-
},
14+
languageOptions: {
15+
parser: tseslint.parser,
16+
},
3017

31-
parser: tsParser,
32-
ecmaVersion: "latest",
33-
sourceType: "module",
34-
},
18+
rules: {
19+
'no-console': 'warn',
20+
'require-await': 'error',
3521

36-
rules: {
37-
"@typescript-eslint/ban-ts-comment": "off",
38-
"@typescript-eslint/no-unused-vars": "off",
39-
"@typescript-eslint/no-namespace": "warn",
40-
},
22+
'@typescript-eslint/no-unused-vars': 'warn',
23+
'@typescript-eslint/no-namespace': 'warn',
24+
'@typescript-eslint/no-empty-interface': 'error',
4125
},
42-
];
26+
},
27+
eslintConfigPrettier,
28+
{
29+
ignores: ['dist/*'],
30+
},
31+
]

package.json

+6-7
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,17 @@
2020
"docs": "typedoc"
2121
},
2222
"devDependencies": {
23+
"@eslint/js": "^9.21.0",
2324
"@rollup/plugin-commonjs": "^26.0.1",
2425
"@rollup/plugin-json": "^6.1.0",
2526
"@rollup/plugin-node-resolve": "^15.2.3",
2627
"@types/jest": "^29.5.12",
2728
"@types/node": "^20.14.10",
28-
"@typescript-eslint/eslint-plugin": "^8.0.0",
29-
"@typescript-eslint/parser": "^8.0.0",
3029
"decimal.js": "^10.4.3",
31-
"eslint": "^9.6.0",
32-
"eslint-config-prettier": "^9.1.0",
33-
"globals": "^15.8.0",
30+
"eslint": "^9.21.0",
31+
"eslint-config-prettier": "^10.0.2",
3432
"jest": "^29.7.0",
35-
"prettier": "^3.3.2",
33+
"prettier": "^3.5.3",
3634
"rimraf": "^6.0.0",
3735
"rollup": "^4.22.4",
3836
"rollup-plugin-dts": "^6.1.1",
@@ -43,7 +41,8 @@
4341
"typedoc": "^0.26.4",
4442
"typedoc-plugin-extras": "^3.1.0",
4543
"typedoc-plugin-katex": "^0.1.2",
46-
"typescript": "^5.5.3"
44+
"typescript": "^5.5.3",
45+
"typescript-eslint": "^8.25.0"
4746
},
4847
"author": "ishiko",
4948
"license": "MIT",

0 commit comments

Comments
 (0)