Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit bd1c8b6

Browse files
committedApr 18, 2025·
updating eslint
1 parent 230eaf2 commit bd1c8b6

File tree

5 files changed

+366
-186
lines changed

5 files changed

+366
-186
lines changed
 

‎.eslintignore

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

‎.eslintrc.js

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

‎eslint.config.mjs

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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([
19+
globalIgnores(['src/antlr', '**/dist']),
20+
{
21+
extends: compat.extends('eslint:recommended'),
22+
23+
plugins: {
24+
'@typescript-eslint': typescriptEslint,
25+
},
26+
27+
languageOptions: {
28+
globals: {
29+
...globals.mocha,
30+
...globals.node,
31+
},
32+
33+
parser: tsParser,
34+
},
35+
36+
rules: {
37+
'no-var': 'error',
38+
'object-curly-spacing': ['error', 'always'],
39+
'object-shorthand': 'error',
40+
'prefer-const': 'error',
41+
'max-len': 'off',
42+
},
43+
},
44+
{
45+
files: ['**/*.ts'],
46+
47+
extends: compat.extends(
48+
'eslint:recommended',
49+
'plugin:@typescript-eslint/recommended',
50+
'plugin:@typescript-eslint/recommended-requiring-type-checking'
51+
),
52+
53+
plugins: {
54+
'@typescript-eslint': typescriptEslint,
55+
},
56+
57+
languageOptions: {
58+
parser: tsParser,
59+
ecmaVersion: 5,
60+
sourceType: 'script',
61+
62+
parserOptions: {
63+
project: ['./tsconfig.json'],
64+
},
65+
},
66+
67+
rules: {
68+
'@typescript-eslint/no-explicit-any': 'off',
69+
'@typescript-eslint/strict-boolean-expressions': 'off',
70+
'@typescript-eslint/no-unsafe-call': 'off',
71+
'@typescript-eslint/no-unsafe-member-access': 'off',
72+
'@typescript-eslint/no-unsafe-assignment': 'off',
73+
'@typescript-eslint/explicit-module-boundary-types': 'off',
74+
'@typescript-eslint/no-unsafe-return': 'off',
75+
'@typescript-eslint/no-empty-interface': 'off',
76+
'@typescript-eslint/no-non-null-assertion': 'off',
77+
},
78+
},
79+
])

‎package-lock.json

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

‎package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
},
4242
"license": "MIT",
4343
"devDependencies": {
44+
"@eslint/eslintrc": "^3.3.1",
45+
"@eslint/js": "^9.24.0",
4446
"@types/chai": "^4.3.20",
4547
"@types/mocha": "^10.0.10",
4648
"@typescript-eslint/eslint-plugin": "^8.30.1",
@@ -50,7 +52,8 @@
5052
"chai": "^4.5.0",
5153
"esbuild": "^0.25.2",
5254
"esbuild-plugin-browserslist": "^0.16.0",
53-
"eslint": "^8.57.1",
55+
"eslint": "^9.24.0",
56+
"globals": "^16.0.0",
5457
"karma": "^6.4.4",
5558
"karma-chrome-launcher": "^3.2.0",
5659
"karma-mocha": "^2.0.1",

0 commit comments

Comments
 (0)
Please sign in to comment.