diff --git a/server.json b/server.json index 5e598ce..62e8d69 100644 --- a/server.json +++ b/server.json @@ -2,7 +2,7 @@ "extends": [ "./common", "./node", - "./language/es2018" + "./language/es2022" ], "rules": { "es-x/no-hashbang": "off" diff --git a/test/fixtures/server/invalid.js b/test/fixtures/server/invalid.js index 63ed012..9442ee9 100644 --- a/test/fixtures/server/invalid.js +++ b/test/fixtures/server/invalid.js @@ -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: // TODO: // TODO: - - // 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-process-exit process.exit( 1 ); diff --git a/test/fixtures/server/valid.js b/test/fixtures/server/valid.js index 646311d..2f49dc5 100644 --- a/test/fixtures/server/valid.js +++ b/test/fixtures/server/valid.js @@ -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(); + + // 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; + + // 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