Files
Nicolò RibaudoandGitHub 2818e21eda Enable import attributes parsing by default (#16850)
* Enable import attributes parsing by default

* Remove plugin from tests

* Update fixtures

* Fix failures

* `make build`

* Fix TS errors

* Fix

* Update .d.ts

* Move in core

* [babel 8] Remove syntax plugins from preset-env

* Update fixtures

* Fix ESM build of Babel 7 and standalone

* Update flow allowlist

* Update parser fixtures for Babel 8

* Update generator tests

* Update parser test

* Update standalone

* Do not run import attribtues plugin test in Babel 8

* Make tests pass in babel 8

* Fix Babel 8 build

* [babel 8] Stop printing legacy "with" attributes

* fix prettier integration test

* Fix Babel 8 compat in syntax-import-attributes

* Try fix

* Do not error for the removed `importAttributes` plugin

* Skip a test in babel7/8 compat e2e

* Throw an error when using removed option from the parser

* Fixes after rebase

* Raise `ImportCallArity` also when `createImportExpressions`

* Fix linting
2024-10-24 20:33:39 +02:00

145 lines
5.7 KiB
JSON

{
"type": "File",
"start":0,"end":112,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":6,"column":36,"index":112}},
"program": {
"type": "Program",
"start":0,"end":112,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":6,"column":36,"index":112}},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ExpressionStatement",
"start":0,"end":21,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":21,"index":21}},
"expression": {
"type": "ImportExpression",
"start":0,"end":20,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":20,"index":20}},
"source": {
"type": "StringLiteral",
"start":7,"end":19,"loc":{"start":{"line":1,"column":7,"index":7},"end":{"line":1,"column":19,"index":19}},
"extra": {
"rawValue": "testing.js",
"raw": "'testing.js'"
},
"value": "testing.js"
},
"options": null
}
},
{
"type": "VariableDeclaration",
"start":23,"end":44,"loc":{"start":{"line":3,"column":0,"index":23},"end":{"line":3,"column":21,"index":44}},
"declarations": [
{
"type": "VariableDeclarator",
"start":29,"end":43,"loc":{"start":{"line":3,"column":6,"index":29},"end":{"line":3,"column":20,"index":43}},
"id": {
"type": "Identifier",
"start":29,"end":33,"loc":{"start":{"line":3,"column":6,"index":29},"end":{"line":3,"column":10,"index":33},"identifierName":"test"},
"name": "test"
},
"init": {
"type": "StringLiteral",
"start":36,"end":43,"loc":{"start":{"line":3,"column":13,"index":36},"end":{"line":3,"column":20,"index":43}},
"extra": {
"rawValue": "hello",
"raw": "'hello'"
},
"value": "hello"
}
}
],
"kind": "const"
},
{
"type": "ExpressionStatement",
"start":45,"end":74,"loc":{"start":{"line":4,"column":0,"index":45},"end":{"line":4,"column":29,"index":74}},
"expression": {
"type": "ImportExpression",
"start":45,"end":73,"loc":{"start":{"line":4,"column":0,"index":45},"end":{"line":4,"column":28,"index":73}},
"source": {
"type": "TemplateLiteral",
"start":52,"end":72,"loc":{"start":{"line":4,"column":7,"index":52},"end":{"line":4,"column":27,"index":72}},
"expressions": [
{
"type": "Identifier",
"start":63,"end":67,"loc":{"start":{"line":4,"column":18,"index":63},"end":{"line":4,"column":22,"index":67},"identifierName":"test"},
"name": "test"
}
],
"quasis": [
{
"type": "TemplateElement",
"start":53,"end":61,"loc":{"start":{"line":4,"column":8,"index":53},"end":{"line":4,"column":16,"index":61}},
"value": {
"raw": "testing/",
"cooked": "testing/"
},
"tail": false
},
{
"type": "TemplateElement",
"start":68,"end":71,"loc":{"start":{"line":4,"column":23,"index":68},"end":{"line":4,"column":26,"index":71}},
"value": {
"raw": ".js",
"cooked": ".js"
},
"tail": true
}
]
},
"options": null
}
},
{
"type": "ExpressionStatement",
"start":76,"end":112,"loc":{"start":{"line":6,"column":0,"index":76},"end":{"line":6,"column":36,"index":112}},
"expression": {
"type": "CallExpression",
"start":76,"end":111,"loc":{"start":{"line":6,"column":0,"index":76},"end":{"line":6,"column":35,"index":111}},
"callee": {
"type": "MemberExpression",
"start":76,"end":101,"loc":{"start":{"line":6,"column":0,"index":76},"end":{"line":6,"column":25,"index":101}},
"object": {
"type": "ImportExpression",
"start":76,"end":96,"loc":{"start":{"line":6,"column":0,"index":76},"end":{"line":6,"column":20,"index":96}},
"source": {
"type": "StringLiteral",
"start":83,"end":95,"loc":{"start":{"line":6,"column":7,"index":83},"end":{"line":6,"column":19,"index":95}},
"extra": {
"rawValue": "testing.js",
"raw": "'testing.js'"
},
"value": "testing.js"
},
"options": null
},
"computed": false,
"property": {
"type": "Identifier",
"start":97,"end":101,"loc":{"start":{"line":6,"column":21,"index":97},"end":{"line":6,"column":25,"index":101},"identifierName":"then"},
"name": "then"
}
},
"arguments": [
{
"type": "ArrowFunctionExpression",
"start":102,"end":110,"loc":{"start":{"line":6,"column":26,"index":102},"end":{"line":6,"column":34,"index":110}},
"id": null,
"generator": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start":108,"end":110,"loc":{"start":{"line":6,"column":32,"index":108},"end":{"line":6,"column":34,"index":110}},
"body": [],
"directives": []
}
}
]
}
}
],
"directives": []
}
}