Skip to content

Commit 84c0e0e

Browse files
committed
updating eslint
1 parent 230eaf2 commit 84c0e0e

File tree

5 files changed

+367
-186
lines changed

5 files changed

+367
-186
lines changed

.eslintignore

-2
This file was deleted.

.eslintrc.js

-48
This file was deleted.

eslint.config.mjs

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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+
tsconfigRootDir: '/Users/klaus/Projects/parser',
64+
project: ['./tsconfig.json'],
65+
},
66+
},
67+
68+
rules: {
69+
'@typescript-eslint/no-explicit-any': 'off',
70+
'@typescript-eslint/strict-boolean-expressions': 'off',
71+
'@typescript-eslint/no-unsafe-call': 'off',
72+
'@typescript-eslint/no-unsafe-member-access': 'off',
73+
'@typescript-eslint/no-unsafe-assignment': 'off',
74+
'@typescript-eslint/explicit-module-boundary-types': 'off',
75+
'@typescript-eslint/no-unsafe-return': 'off',
76+
'@typescript-eslint/no-empty-interface': 'off',
77+
'@typescript-eslint/no-non-null-assertion': 'off',
78+
},
79+
},
80+
])

0 commit comments

Comments
 (0)