Skip to content

Commit

Permalink
server: Change target from ES2018 (Node 10) to ES2022 (Node 18)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdforrester committed Nov 5, 2024
1 parent 91e9a0b commit 770ecd6
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 35 deletions.
2 changes: 1 addition & 1 deletion server.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": [
"./common",
"./node",
"./language/es2018"
"./language/es2022"
],
"rules": {
"es-x/no-hashbang": "off"
Expand Down
35 changes: 1 addition & 34 deletions test/fixtures/server/invalid.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,43 +59,10 @@
// eslint-disable-next-line n/no-missing-require
require( 'missing' );

const crypto = require( 'crypto' );
// This depends on the Node version defined in package.engine
// eslint-disable-next-line n/no-unsupported-features/node-builtins
crypto.verify();

// TODO: <!-- eslint-disable-next-line n/no-extraneous-require -->
// TODO: <!-- eslint-disable-next-line n/no-unpublished-bin -->
// TODO: <!-- eslint-disable-next-line n/process-exit-as-throw -->

// not-es2018
// eslint-disable-next-line es-x/no-string-prototype-trimstart-trimend
''.trimEnd();

// not-es2019
// eslint-disable-next-line es-x/no-string-prototype-matchall
''.matchAll( /foo/ );

// not-es2019
// eslint-disable-next-line es-x/no-bigint
const c = BigInt( 100 );

// not-es2019
// eslint-disable-next-line es-x/no-promise-all-settled
Promise.allSettled( [] );

// not-es2019
// eslint-disable-next-line es-x/no-global-this, no-unused-expressions
globalThis === c;

// not-es2020
// eslint-disable-next-line es-x/no-string-prototype-replaceall
'abc'.replaceAll( 'a', 'x' );
// eslint-disable-next-line es-x/no-promise-any
Promise.any( [] );

// not-es2021
// Nothing yet
// TODO: <!-- eslint-disable-next-line n/no-unsupported-features/node-builtins -->

// eslint-disable-next-line n/no-process-exit
process.exit( 1 );
Expand Down
36 changes: 36 additions & 0 deletions test/fixtures/server/valid.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,42 @@
// Off: es-x/no-symbol-prototype-description
global.desc = a.description;

const crypto = require( 'crypto' );
// This depends on the Node version defined in package.engine

crypto.verify();

Check failure on line 62 in test/fixtures/server/valid.js

View workflow job for this annotation

GitHub Actions / build (18.x)

The 'crypto.verify' is still an experimental feature and is not supported until Node.js 12.0.0. The configured version range is '>=11.0.0'

Check failure on line 62 in test/fixtures/server/valid.js

View workflow job for this annotation

GitHub Actions / build (20.x)

The 'crypto.verify' is still an experimental feature and is not supported until Node.js 12.0.0. The configured version range is '>=11.0.0'

Check failure on line 62 in test/fixtures/server/valid.js

View workflow job for this annotation

GitHub Actions / build (22.x)

The 'crypto.verify' is still an experimental feature and is not supported until Node.js 12.0.0. The configured version range is '>=11.0.0'

Check failure on line 62 in test/fixtures/server/valid.js

View workflow job for this annotation

GitHub Actions / build (18.x)

The 'crypto.verify' is still an experimental feature and is not supported until Node.js 12.0.0. The configured version range is '>=11.0.0'

Check failure on line 62 in test/fixtures/server/valid.js

View workflow job for this annotation

GitHub Actions / build (20.x)

The 'crypto.verify' is still an experimental feature and is not supported until Node.js 12.0.0. The configured version range is '>=11.0.0'

Check failure on line 62 in test/fixtures/server/valid.js

View workflow job for this annotation

GitHub Actions / build (22.x)

The 'crypto.verify' is still an experimental feature and is not supported until Node.js 12.0.0. The configured version range is '>=11.0.0'

// TODO: n/process-exit-as-throw

// ES2018
// Off: es-x/no-string-prototype-trimstart-trimend
''.trimEnd();

// ES2019
// Off: es-x/no-string-prototype-matchall
''.matchAll( /foo/ );

// ES2019
// Off: es-x/no-bigint
const c = BigInt( 100 );

// ES2019
// Off: es-x/no-promise-all-settled
Promise.allSettled( [] );

// ES2019
// Off: es-x/no-global-this, no-unused-expressions
globalThis === c;

Check failure on line 84 in test/fixtures/server/valid.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Expected an assignment or function call and instead saw an expression

Check failure on line 84 in test/fixtures/server/valid.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Expected an assignment or function call and instead saw an expression

Check failure on line 84 in test/fixtures/server/valid.js

View workflow job for this annotation

GitHub Actions / build (22.x)

Expected an assignment or function call and instead saw an expression

Check failure on line 84 in test/fixtures/server/valid.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Expected an assignment or function call and instead saw an expression

Check failure on line 84 in test/fixtures/server/valid.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Expected an assignment or function call and instead saw an expression

Check failure on line 84 in test/fixtures/server/valid.js

View workflow job for this annotation

GitHub Actions / build (22.x)

Expected an assignment or function call and instead saw an expression

// ES2020
// Off: es-x/no-string-prototype-replaceall
'abc'.replaceAll( 'a', 'x' );
// Off: es-x/no-promise-any
Promise.any( [] );

// ES2021
// Nothing yet

/* Globals */
console.log(
// Global: AggregateError
Expand Down

0 comments on commit 770ecd6

Please sign in to comment.