Skip to content

Commit 61fd4fc

Browse files
committed
Upgrade to eslint 9.
1 parent d028da6 commit 61fd4fc

File tree

12 files changed

+2022
-1817
lines changed

12 files changed

+2022
-1817
lines changed

.eslintignore

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

.eslintrc.json

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

.github/workflows/test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ jobs:
2828
java-version: ['23', '21', '17', '20', 'dev']
2929
distribution: ['graalvm', 'graalvm-community']
3030
os: [
31-
ubuntu-latest,
32-
macos-latest, # macOS on Apple silicon
33-
macos-13, # macOS on Intel
34-
windows-latest
35-
]
31+
ubuntu-latest,
32+
macos-latest, # macOS on Apple silicon
33+
macos-13, # macOS on Intel
34+
windows-latest
35+
]
3636
set-gds-token: [false]
3737
components: ['']
3838
include:
@@ -456,4 +456,4 @@ jobs:
456456
mvn --no-transfer-progress -Pnative package
457457
cmd /c verify-sbom.cmd
458458
shell: cmd
459-
if: runner.os == 'Windows'
459+
if: runner.os == 'Windows'

.prettierignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
dist/
2-
lib/
3-
node_modules/
2+
node_modules/
3+
README.md

.prettierrc.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# See: https://prettier.io/docs/en/configuration
2+
3+
printWidth: 80
4+
tabWidth: 2
5+
useTabs: false
6+
semi: false
7+
singleQuote: true
8+
quoteProps: as-needed
9+
jsxSingleQuote: false
10+
trailingComma: none
11+
bracketSpacing: true
12+
bracketSameLine: true
13+
arrowParens: always
14+
proseWrap: always
15+
htmlWhitespaceSensitivity: css
16+
endOfLine: lf

eslint.config.mjs

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

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ module.exports = {
66
'^.+\\.ts$': 'ts-jest'
77
},
88
verbose: true
9-
}
9+
}

0 commit comments

Comments
 (0)