Skip to content

Commit e6054b7

Browse files
committed
chore(eslint): migrate configuration to new flat config
1 parent bece75c commit e6054b7

File tree

5 files changed

+65
-38
lines changed

5 files changed

+65
-38
lines changed

.eslintrc.js

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

.github/workflows/checks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ jobs:
99
- uses: actions/checkout@v4
1010
- uses: actions/setup-node@v4.4.0
1111
with:
12-
node-version: 20
12+
node-version: 20
1313
- name: 'Install dependencies'
1414
run: npm install
1515
- name: 'Run linter'
16-
run: ESLINT_USE_FLAT_CONFIG=false npm run lint
16+
run: npm run lint
1717
auto-merge:
1818
name: 'dependabot-auto-merge'
1919
needs: linter

eslint.config.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { defineConfig } from 'eslint/config';
2+
import globals from 'globals';
3+
import js from '@eslint/js';
4+
import prettier from 'eslint-plugin-prettier/recommended';
5+
6+
export default defineConfig([
7+
js.configs.recommended,
8+
prettier,
9+
{
10+
languageOptions: {
11+
globals: {
12+
...globals.browser,
13+
...globals.greasemonkey,
14+
...globals.jquery,
15+
LOGGER: true,
16+
MBImportStyle: true,
17+
MBImport: true,
18+
MBLinks: true,
19+
MBSearchItStyle: true,
20+
},
21+
},
22+
23+
rules: {
24+
'prettier/prettier': 'error',
25+
'prefer-template': 'error',
26+
'no-console': 'off',
27+
'no-inner-declarations': 'warn',
28+
'no-global-assign': 'warn',
29+
'no-redeclare': 'warn',
30+
'no-self-assign': 'warn',
31+
'no-undef': 'warn',
32+
'no-useless-concat': 'warn',
33+
'no-useless-escape': 'warn',
34+
'no-unused-vars': 'warn',
35+
'no-var': 'warn',
36+
},
37+
},
38+
]);

package-lock.json

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

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "musicbrainz-userscripts",
33
"version": "1.0.0",
44
"description": "Collection of userscripts for MusicBrainz",
5-
"main": "index.js",
5+
"type": "module",
66
"directories": {
77
"lib": "lib"
88
},
@@ -31,10 +31,11 @@
3131
"homepage": "https://github.com/murdos/musicbrainz-userscripts#readme",
3232
"devDependencies": {
3333
"@eslint-community/eslint-utils": "^4.6.1",
34+
"@eslint/js": "^9.25.1",
3435
"eslint": "^9.25.1",
35-
"eslint-config-prettier": "^10.1.2",
3636
"eslint-plugin-import": "^2.31.0",
3737
"eslint-plugin-prettier": "^5.2.6",
38+
"globals": "^16.0.0",
3839
"prettier": "^3.5.3"
3940
}
4041
}

0 commit comments

Comments
 (0)