Skip to content

Commit d0f2ab1

Browse files
authored
Update devDependencies and drop Node.js < 18 support (#203)
1 parent 0669376 commit d0f2ab1

File tree

8 files changed

+4911
-4542
lines changed

8 files changed

+4911
-4542
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on: [push, pull_request, workflow_dispatch]
44

55
env:
66
FORCE_COLOR: 2
7-
NODE: 20 # The Node.js version to run lint on
7+
NODE: 22 # The Node.js version to run lint on
88

99
jobs:
1010
run:

.github/workflows/test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on: [push, pull_request, workflow_dispatch]
44

55
env:
66
FORCE_COLOR: 2
7-
NODE_COV: 20 # The Node.js version to run coveralls on
7+
NODE_COV: 22 # The Node.js version to run coveralls on
88

99
jobs:
1010
test:
@@ -15,20 +15,20 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
os: [ubuntu-latest]
18-
node: [14.18, 16, 18, 20, 22]
18+
node: [18, 20, 22]
1919
java: [17]
2020
architecture: [x64]
2121
include:
2222
- os: macos-latest
23-
node: 20
23+
node: 22
2424
java: 17
2525
architecture: x64
2626
- os: windows-latest
27-
node: 20
27+
node: 22
2828
java: 17
2929
architecture: x64
3030
- os: windows-latest
31-
node: 20
31+
node: 22
3232
java: 17
3333
architecture: x86
3434

lib/parseErrorMessages.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* { messages: [{ message, type, ...}, ...], url }\n{ ... }
1010
*/
1111
function parseErrorMessages(errors, config) {
12-
const normalizedErrors = config.server ? `[${errors.trim().replace(/\n/g, ',')}]` : errors;
12+
const normalizedErrors = config.server ? `[${errors.trim().replaceAll('\n', ',')}]` : errors;
1313
const parsedErrors = JSON.parse(normalizedErrors);
1414

1515
// If server is not used, return the messages as is

lib/reporters/checkstyle.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ function checkstyle(results) {
1818
for (const result of results) {
1919
// Register the file
2020
result.file = path.normalize(result.file);
21-
if (!files[result.file]) {
22-
files[result.file] = [];
23-
}
21+
files[result.file] ||= [];
2422

2523
// Add the error
2624
files[result.file].push({

lib/reporters/junit.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ function junit(results) {
1515
for (const result of results) {
1616
// Register the file
1717
result.file = path.normalize(result.file);
18-
if (!files[result.file]) {
19-
files[result.file] = [];
20-
}
18+
files[result.file] ||= [];
2119

2220
// Add the error
2321
files[result.file].push({

lib/util.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const pairs = {
1111
function encode(string) {
1212
for (const symbol in pairs) {
1313
if (string !== undefined) {
14-
string = string.replace(new RegExp(symbol, 'g'), pairs[symbol]);
14+
string = string.replaceAll(new RegExp(symbol, 'g'), pairs[symbol]);
1515
}
1616
}
1717

@@ -20,9 +20,7 @@ function encode(string) {
2020

2121
// Replace left/right quotation marks with normal quotation marks
2222
function normalizeQuotationMarks(string) {
23-
if (string) {
24-
string = string.replace(/[\u201C\u201D]/g, '"');
25-
}
23+
string &&= string.replaceAll(/[\u201C\u201D]/g, '"');
2624

2725
return string;
2826
}

0 commit comments

Comments
 (0)