File tree Expand file tree Collapse file tree 2 files changed +12
-29
lines changed
lib/rules/no-unsupported-features
tests/lib/rules/no-unsupported-features Expand file tree Collapse file tree 2 files changed +12
-29
lines changed Original file line number Diff line number Diff line change @@ -383,24 +383,6 @@ const features = {
383383 } ,
384384 ] ,
385385 } ,
386- optionalChaining : {
387- ruleId : "no-optional-chaining" ,
388- cases : [
389- {
390- supported : "14.0.0" ,
391- messageId : "no-optional-chaining" ,
392- } ,
393- ] ,
394- } ,
395- nullishCoalescingOperators : {
396- ruleId : "no-nullish-coalescing-operators" ,
397- cases : [
398- {
399- supported : "14.0.0" ,
400- messageId : "no-nullish-coalescing-operators" ,
401- } ,
402- ] ,
403- } ,
404386}
405387const keywords = Object . keys ( features )
406388
@@ -646,7 +628,7 @@ module.exports = {
646628 "no-bigint-property-names" :
647629 "Bigint literal property names are not supported yet." ,
648630 "no-dynamic-import" :
649- "'import()' expressions are not supported yet ." ,
631+ "'import()' expressions are not supported until Node.js {{supported}}. The configured version range is '{{version}}' ." ,
650632 "no-optional-chaining" :
651633 "Optional chainings are not supported until Node.js {{supported}}. The configured version range is '{{version}}'." ,
652634 "no-nullish-coalescing-operators" :
Original file line number Diff line number Diff line change 77const path = require ( "path" )
88const { Linter, RuleTester } = require ( "eslint" )
99const { builtin } = require ( "globals" )
10+ const { Range } = require ( "semver" )
1011const rule = require ( "../../../../lib/rules/no-unsupported-features/es-syntax" )
1112
1213const ES2020Supported = ( ( ) => {
@@ -2489,27 +2490,27 @@ ruleTester.run(
24892490 code : "obj.import(source)" ,
24902491 options : [ { version : "12.0.0" } ] ,
24912492 } ,
2492- {
2493+ ... [ "12.17.0" , "13.2.0" ] . map ( v => ( {
24932494 code : "import(source)" ,
2494- options : [
2495- { version : "13.1.0" , ignores : [ "dynamicImport" ] } ,
2496- ] ,
2497- } ,
2495+ options : [ { version : v } ] ,
2496+ } ) ) ,
24982497 ] ,
24992498 invalid : [
2500- {
2499+ ... [ "12.16.0" , "13.0.0" , "13.1.0" ] . map ( v => ( {
25012500 code : "import(source)" ,
2502- options : [ { version : "13.3.0" } ] ,
2501+ options : [ { version : v } ] ,
25032502 errors : [
25042503 {
25052504 messageId : "no-dynamic-import" ,
25062505 data : {
2507- supported : null ,
2508- version : "13.3.0" ,
2506+ supported : new Range (
2507+ ">=12.17 <13 || >=13.2"
2508+ ) . toString ( ) ,
2509+ version : v ,
25092510 } ,
25102511 } ,
25112512 ] ,
2512- } ,
2513+ } ) ) ,
25132514 ] ,
25142515 } ,
25152516 {
You can’t perform that action at this time.
0 commit comments