Skip to content

Commit

Permalink
[parser] Make decoratorsBeforeExport default to false (#14695)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Sep 5, 2022
1 parent 0e0f123 commit d855f9d
Show file tree
Hide file tree
Showing 21 changed files with 25 additions and 61 deletions.
12 changes: 4 additions & 8 deletions packages/babel-parser/src/plugin-utils.ts
Expand Up @@ -87,14 +87,10 @@ export function validatePlugins(plugins: PluginList) {
"decorators",
"decoratorsBeforeExport",
);
if (decoratorsBeforeExport == null) {
throw new Error(
"The 'decorators' plugin requires a 'decoratorsBeforeExport' option," +
" whose value must be a boolean. If you are migrating from" +
" Babylon/Babel 6 or want to use the old decorators proposal, you" +
" should use the 'decorators-legacy' plugin instead of 'decorators'.",
);
} else if (typeof decoratorsBeforeExport !== "boolean") {
if (
decoratorsBeforeExport != null &&
typeof decoratorsBeforeExport !== "boolean"
) {
throw new Error("'decoratorsBeforeExport' must be a boolean.");
}
}
Expand Down
@@ -1,3 +1,3 @@
{
"plugins": [["decorators", { "decoratorsBeforeExport": false }]]
"plugins": ["decorators"]
}
@@ -1,3 +1,3 @@
{
"plugins": [["decorators", { "decoratorsBeforeExport": false }]]
"plugins": ["decorators"]
}
@@ -1,3 +1,3 @@
{
"plugins": [["decorators", { "decoratorsBeforeExport": false }]]
"plugins": ["decorators"]
}
Empty file.

This file was deleted.

@@ -1,10 +1,3 @@
{
"plugins": [
[
"decorators",
{
"decoratorsBeforeExport": false
}
]
]
"plugins": ["decorators"]
}
@@ -1,11 +1,4 @@
{
"plugins": [
[
"decorators",
{
"decoratorsBeforeExport": false
}
]
],
"plugins": ["decorators"],
"throws": "Decorators must not be followed by a semicolon. (2:5)"
}
}
@@ -1,3 +1,3 @@
{
"plugins": [["decorators", { "decoratorsBeforeExport": false }]]
"plugins": ["decorators"]
}
@@ -1,4 +1,4 @@
{
"plugins": [["decorators", { "decoratorsBeforeExport": false }]],
"plugins": ["decorators"],
"createParenthesizedExpressions": true
}
@@ -1,3 +1,3 @@
{
"plugins": [["decorators", { "decoratorsBeforeExport": false }]]
"plugins": ["decorators"]
}
@@ -1,11 +1,4 @@
{
"plugins": [
[
"decorators",
{
"decoratorsBeforeExport": false
}
]
],
"plugins": ["decorators"],
"throws": "Leading decorators must be attached to a class declaration. (1:6)"
}
}
@@ -1,11 +1,4 @@
{
"plugins": [
[
"decorators",
{
"decoratorsBeforeExport": false
}
]
],
"plugins": ["decorators"],
"throws": "Leading decorators must be attached to a class declaration. (1:6)"
}
}
@@ -1,6 +1,6 @@
{
"plugins": [
["pipelineOperator", { "proposal": "hack", "topicToken": "@@" }],
["decorators", { "decoratorsBeforeExport": false }]
"decorators"
]
}
@@ -1,6 +1,6 @@
{
"plugins": [
["pipelineOperator", { "proposal": "hack", "topicToken": "@@" }],
["decorators", { "decoratorsBeforeExport": false }]
"decorators"
]
}
@@ -1,6 +1,6 @@
{
"plugins": [
["pipelineOperator", { "proposal": "hack", "topicToken": "@@" }],
["decorators", { "decoratorsBeforeExport": false }]
"decorators"
]
}
@@ -1,6 +1,6 @@
{
"plugins": [
["pipelineOperator", { "proposal": "hack", "topicToken": "^^" }],
["decorators", { "decoratorsBeforeExport": false }]
"decorators"
]
}
@@ -1,6 +1,6 @@
{
"plugins": [
["pipelineOperator", { "proposal": "hack", "topicToken": "^^" }],
["decorators", { "decoratorsBeforeExport": false }]
"decorators"
]
}
@@ -1,6 +1,6 @@
{
"plugins": [
["pipelineOperator", { "proposal": "hack", "topicToken": "^^" }],
["decorators", { "decoratorsBeforeExport": false }]
"decorators"
]
}
@@ -1,4 +1,4 @@
{
"sourceType": "module",
"plugins": ["flow", ["decorators", { "decoratorsBeforeExport": false }]]
"plugins": ["flow", "decorators"]
}
@@ -1,5 +1,5 @@
{
"sourceType": "module",
"plugins": ["flow", ["decorators", { "decoratorsBeforeExport": false }]],
"plugins": ["flow", "decorators"],
"throws": "Unexpected token (2:10)"
}

0 comments on commit d855f9d

Please sign in to comment.