Skip to content

Commit 1991c19

Browse files
committed
Upgrade to ESLint 9+
1 parent 8556501 commit 1991c19

10 files changed

+1318
-808
lines changed

.eslintrc.yml

-54
This file was deleted.

.mega-linter.yml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ DISABLE:
2121
DISABLE_LINTERS:
2222
- MARKDOWN_MARKDOWN_TABLE_FORMATTER
2323
- REPOSITORY_KICS
24+
- REPOSITORY_TRIVY
2425
- TYPESCRIPT_STANDARD
2526

2627
# List of enabled but not blocking linters keys

dist/index.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eslint.config.mjs

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import { fixupPluginRules } from '@eslint/compat'
2+
import { FlatCompat } from '@eslint/eslintrc'
3+
import js from '@eslint/js'
4+
import typescriptEslint from '@typescript-eslint/eslint-plugin'
5+
import tsParser from '@typescript-eslint/parser'
6+
import _import from 'eslint-plugin-import'
7+
import jest from 'eslint-plugin-jest'
8+
import prettier from 'eslint-plugin-prettier'
9+
import globals from 'globals'
10+
import path from 'node:path'
11+
import { fileURLToPath } from 'node:url'
12+
13+
const __filename = fileURLToPath(import.meta.url)
14+
const __dirname = path.dirname(__filename)
15+
const compat = new FlatCompat({
16+
baseDirectory: __dirname,
17+
recommendedConfig: js.configs.recommended,
18+
allConfig: js.configs.all
19+
})
20+
21+
export default [
22+
{
23+
ignores: ['**/coverage', '**/dist', '**/linter', '**/node_modules']
24+
},
25+
...compat.extends(
26+
'eslint:recommended',
27+
'plugin:@typescript-eslint/eslint-recommended',
28+
'plugin:@typescript-eslint/recommended',
29+
'plugin:jest/recommended',
30+
'plugin:prettier/recommended'
31+
),
32+
{
33+
plugins: {
34+
import: fixupPluginRules(_import),
35+
jest,
36+
prettier,
37+
'@typescript-eslint': typescriptEslint
38+
},
39+
40+
languageOptions: {
41+
globals: {
42+
...globals.node,
43+
...globals.jest,
44+
Atomics: 'readonly',
45+
SharedArrayBuffer: 'readonly'
46+
},
47+
48+
parser: tsParser,
49+
ecmaVersion: 2023,
50+
sourceType: 'module',
51+
52+
parserOptions: {
53+
project: ['tsconfig.eslint.json'],
54+
tsconfigRootDir: '.'
55+
}
56+
},
57+
58+
settings: {
59+
'import/resolver': {
60+
typescript: {
61+
alwaysTryTypes: true,
62+
project: 'tsconfig.eslint.json'
63+
}
64+
}
65+
},
66+
67+
rules: {
68+
camelcase: 'off',
69+
'eslint-comments/no-use': 'off',
70+
'eslint-comments/no-unused-disable': 'off',
71+
'i18n-text/no-en': 'off',
72+
'import/no-namespace': 'off',
73+
'no-console': 'off',
74+
'no-shadow': 'off',
75+
'no-unused-vars': 'off',
76+
'prettier/prettier': 'error'
77+
}
78+
}
79+
]

0 commit comments

Comments
 (0)