Skip to content

Commit 98cfd2f

Browse files
committed
Build: Update deps, modernize CI, migrate the ESLint config
Changes: 1. Update dependencies 2. Migrate to the ESLint flat config 3. Test on Node.js 24, not 16 4. Update actions 5. Enable dependabot updates 6. Fix lint issues
1 parent 9b846b7 commit 98cfd2f

File tree

9 files changed

+727
-484
lines changed

9 files changed

+727
-484
lines changed

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ end_of_line = lf
99
charset = utf-8
1010
trim_trailing_whitespace = true
1111
insert_final_newline = true
12+
13+
[*.{json,yml}]
14+
indent_style = space
15+
indent_size = 2

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.json

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

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: "/"
5+
schedule:
6+
interval: monthly
7+
8+
# Group all dependabot version update PRs into one
9+
groups:
10+
github-actions:
11+
applies-to: version-updates
12+
patterns:
13+
- "*"

.github/workflows/node.js.yml

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,30 @@
11
name: CI
22

3-
on: [push, pull_request]
3+
on:
4+
pull_request:
5+
push:
6+
branches-ignore: "dependabot/**"
47

58
jobs:
69
build:
710
runs-on: ubuntu-latest
811
strategy:
912
fail-fast: false
1013
matrix:
11-
NODE_VERSION: [16.x]
14+
NODE_VERSION: [24.x]
1215
steps:
13-
- name: Checkout
14-
uses: actions/checkout@v2
16+
- name: Checkout
17+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1518

16-
- name: Cache
17-
uses: actions/cache@v2
18-
with:
19-
path: ~/.npm
20-
key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
21-
restore-keys: |
22-
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-
19+
- name: Use Node.js ${{ matrix.NODE_VERSION }}
20+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
21+
with:
22+
node-version: ${{ matrix.NODE_VERSION }}
23+
cache: npm
24+
cache-dependency-path: '**/package-lock.json'
2325

24-
- name: Use Node.js ${{ matrix.NODE_VERSION }}
25-
uses: actions/[email protected]
26-
with:
27-
node-version: ${{ matrix.NODE_VERSION }}
26+
- name: Install dependencies
27+
run: npm ci
2828

29-
- name: Install dependencies
30-
run: |
31-
npm install
32-
33-
- name: Run tests
34-
run: |
35-
npm test
29+
- name: Run tests
30+
run: npm test

eslint.config.mjs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import jqueryConfig from "eslint-config-jquery";
2+
import globals from "globals";
3+
4+
export default [
5+
{
6+
7+
// Only global ignores will bypass the parser
8+
// and avoid JS parsing errors
9+
// See https://github.com/eslint/eslint/discussions/17412
10+
ignores: [
11+
"__release/**"
12+
]
13+
},
14+
15+
jqueryConfig,
16+
17+
{
18+
languageOptions: {
19+
ecmaVersion: 2025,
20+
sourceType: "script",
21+
22+
globals: {
23+
...globals.node
24+
}
25+
},
26+
27+
rules: {
28+
strict: [ "error", "global" ]
29+
}
30+
},
31+
32+
{
33+
files: [ "*.mjs" ],
34+
35+
languageOptions: {
36+
sourceType: "module"
37+
}
38+
}
39+
];

lib/bootstrap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Release.define( {
1818
[ "git", "npm", "curl" ].forEach( function( command ) {
1919
try {
2020
which.sync( command );
21-
} catch ( e ) {
21+
} catch {
2222
Release.abort( "Missing required executable: " + command );
2323
}
2424
} );

0 commit comments

Comments
 (0)