mirror of
https://github.com/danbulant/oxc
synced 2026-05-25 12:51:57 +00:00
feat(linter): check expressions in javascript
This commit is contained in:
parent
403682960f
commit
021345173f
4 changed files with 3617 additions and 116 deletions
|
|
@ -37,6 +37,11 @@ impl Rule for EarlyErrorJavaScript {
|
|||
AstKind::Class(class) => check_class(class, ctx),
|
||||
AstKind::Super(sup) => check_super(sup, node, ctx),
|
||||
AstKind::Property(prop) => check_property(prop, ctx),
|
||||
AstKind::ObjectExpression(expr) => check_object_expression(expr, ctx),
|
||||
AstKind::BinaryExpression(expr) => check_binary_expression(expr, ctx),
|
||||
AstKind::LogicalExpression(expr) => check_logical_expression(expr, ctx),
|
||||
AstKind::MemberExpression(expr) => check_member_expression(expr, ctx),
|
||||
AstKind::UnaryExpression(expr) => check_unary_expression(expr, node, ctx),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
|
@ -634,3 +639,112 @@ fn check_property(prop: &Property, ctx: &LintContext) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn check_object_expression(obj_expr: &ObjectExpression, ctx: &LintContext) {
|
||||
// ObjectLiteral : { PropertyDefinitionList }
|
||||
// It is a Syntax Error if PropertyNameList of PropertyDefinitionList contains any duplicate entries for "__proto__"
|
||||
// and at least two of those entries were obtained from productions of the form PropertyDefinition : PropertyName : AssignmentExpression
|
||||
let mut prev_proto: Option<Span> = None;
|
||||
let prop_names = obj_expr.properties.iter().filter_map(PropName::prop_name);
|
||||
for prop_name in prop_names {
|
||||
if prop_name.0 == "__proto__" {
|
||||
if let Some(prev_span) = prev_proto {
|
||||
ctx.diagnostic(Redeclaration("__proto__".into(), prev_span, prop_name.1));
|
||||
}
|
||||
prev_proto = Some(prop_name.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn check_binary_expression(binary_expr: &BinaryExpression, ctx: &LintContext) {
|
||||
#[derive(Debug, Error, Diagnostic)]
|
||||
#[error("Unexpected exponentiation expression")]
|
||||
#[diagnostic(help("Wrap {0} expression in parentheses to enforce operator precedence"))]
|
||||
struct UnexpectedExponential(&'static str, #[label] Span);
|
||||
|
||||
if binary_expr.operator == BinaryOperator::Exponential {
|
||||
match binary_expr.left {
|
||||
// async () => await 5 ** 6
|
||||
// async () => await -5 ** 6
|
||||
Expression::AwaitExpression(_) => {
|
||||
ctx.diagnostic(UnexpectedExponential("await", binary_expr.span));
|
||||
}
|
||||
// -5 ** 6
|
||||
Expression::UnaryExpression(_) => {
|
||||
ctx.diagnostic(UnexpectedExponential("unary", binary_expr.span));
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn check_logical_expression(logical_expr: &LogicalExpression, ctx: &LintContext) {
|
||||
#[derive(Debug, Error, Diagnostic)]
|
||||
#[error("Logical expressions and coalesce expressions cannot be mixed")]
|
||||
#[diagnostic(help("Wrap either expression by parentheses"))]
|
||||
struct MixedCoalesce(#[label] Span);
|
||||
|
||||
// check mixed coalesce
|
||||
// a ?? b || c - a ?? (b || c)
|
||||
// a ?? b && c - a ?? (b && c)
|
||||
// a || b ?? c - (a || b) ?? c
|
||||
// a && b ?? c - (a && b) ?? c
|
||||
if logical_expr.operator == LogicalOperator::Coalesce {
|
||||
let mut maybe_mixed_coalesce_expr = None;
|
||||
if let Expression::LogicalExpression(rhs) = &logical_expr.right {
|
||||
maybe_mixed_coalesce_expr = Some(rhs);
|
||||
} else if let Expression::LogicalExpression(lhs) = &logical_expr.left {
|
||||
maybe_mixed_coalesce_expr = Some(lhs);
|
||||
}
|
||||
if let Some(expr) = maybe_mixed_coalesce_expr {
|
||||
if matches!(expr.operator, LogicalOperator::And | LogicalOperator::Or) {
|
||||
ctx.diagnostic(MixedCoalesce(logical_expr.span));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn check_member_expression(member_expr: &MemberExpression, ctx: &LintContext) {
|
||||
#[derive(Debug, Error, Diagnostic)]
|
||||
#[error("Private fields cannot be accessed on super")]
|
||||
#[diagnostic()]
|
||||
struct SuperPrivate(#[label] Span);
|
||||
|
||||
if let MemberExpression::PrivateFieldExpression(private_expr) = member_expr {
|
||||
// super.#m
|
||||
if let Expression::Super(_) = &private_expr.object {
|
||||
ctx.diagnostic(SuperPrivate(private_expr.span));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn check_unary_expression<'a>(
|
||||
unary_expr: &'a UnaryExpression,
|
||||
node: &AstNode<'a>,
|
||||
ctx: &LintContext<'a>,
|
||||
) {
|
||||
#[derive(Debug, Error, Diagnostic)]
|
||||
#[error("Delete of an unqualified identifier in strict mode.")]
|
||||
#[diagnostic()]
|
||||
struct DeleteOfUnqualified(#[label] Span);
|
||||
|
||||
#[derive(Debug, Error, Diagnostic)]
|
||||
#[error("Private fields can not be deleted")]
|
||||
#[diagnostic()]
|
||||
struct DeletePrivateField(#[label] Span);
|
||||
|
||||
// https://tc39.es/ecma262/#sec-delete-operator-static-semantics-early-errors
|
||||
if unary_expr.operator == UnaryOperator::Delete {
|
||||
match unary_expr.argument.get_inner_expression() {
|
||||
Expression::Identifier(ident) if ctx.strict_mode(node) => {
|
||||
ctx.diagnostic(DeleteOfUnqualified(ident.span));
|
||||
}
|
||||
Expression::MemberExpression(expr) => {
|
||||
if let MemberExpression::PrivateFieldExpression(expr) = &**expr {
|
||||
ctx.diagnostic(DeletePrivateField(expr.span));
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
Babel Summary:
|
||||
AST Parsed : 2053/2069 (99.23%)
|
||||
Positive Passed: 2053/2069 (99.23%)
|
||||
Negative Passed: 1014/1502 (67.51%)
|
||||
Negative Passed: 1040/1502 (69.24%)
|
||||
Expect Syntax Error: "annex-b/disabled/1.1-html-comments-close/input.js"
|
||||
Expect Syntax Error: "annex-b/disabled/3.1-sloppy-labeled-functions-if-body/input.js"
|
||||
Expect Syntax Error: "annex-b/disabled/3.1-sloppy-labeled-functions-multiple-labels/input.js"
|
||||
|
|
@ -96,9 +96,6 @@ Expect Syntax Error: "es2015/destructuring/binding-arguments-module/input.js"
|
|||
Expect Syntax Error: "es2015/destructuring/binding-arguments-strict/input.js"
|
||||
Expect Syntax Error: "es2015/destructuring/binding-eval/input.js"
|
||||
Expect Syntax Error: "es2015/destructuring/error-operator-for-default/input.js"
|
||||
Expect Syntax Error: "es2015/duplicate-proto/in-new-expression/input.js"
|
||||
Expect Syntax Error: "es2015/duplicate-proto/with-assignment-expression/input.js"
|
||||
Expect Syntax Error: "es2015/duplicate-proto/without-assignment-expression/input.js"
|
||||
Expect Syntax Error: "es2015/for-in/strict-initializer/input.js"
|
||||
Expect Syntax Error: "es2015/for-of/invalid-let-as-identifier/input.js"
|
||||
Expect Syntax Error: "es2015/let/let-as-identifier-strict-fail/input.js"
|
||||
|
|
@ -140,7 +137,6 @@ Expect Syntax Error: "es2015/uncategorised/291/input.js"
|
|||
Expect Syntax Error: "es2015/uncategorised/296/input.js"
|
||||
Expect Syntax Error: "es2015/uncategorised/297/input.js"
|
||||
Expect Syntax Error: "es2015/uncategorised/332/input.js"
|
||||
Expect Syntax Error: "es2015/uncategorised/349/input.js"
|
||||
Expect Syntax Error: "es2015/yield/function-name-function-declaration-inside-generator/input.js"
|
||||
Expect Syntax Error: "es2015/yield/function-name-generator-expression/input.js"
|
||||
Expect Syntax Error: "es2015/yield/function-name-strict-body/input.js"
|
||||
|
|
@ -164,14 +160,6 @@ Expect Syntax Error: "es2015/yield/parameter-name-generator/input.js"
|
|||
Expect Syntax Error: "es2015/yield/parameter-name-strict-body/input.js"
|
||||
Expect Syntax Error: "es2015/yield/parameter-name-strict/input.js"
|
||||
Expect Syntax Error: "es2015/yield/yield-star-parameter-default-inside-generator/input.js"
|
||||
Expect Syntax Error: "es2016/exponentiation-operator/10/input.js"
|
||||
Expect Syntax Error: "es2016/exponentiation-operator/11/input.js"
|
||||
Expect Syntax Error: "es2016/exponentiation-operator/12/input.js"
|
||||
Expect Syntax Error: "es2016/exponentiation-operator/15/input.js"
|
||||
Expect Syntax Error: "es2016/exponentiation-operator/16/input.js"
|
||||
Expect Syntax Error: "es2016/exponentiation-operator/await-before-exponential/input.js"
|
||||
Expect Syntax Error: "es2016/exponentiation-operator/await-unary-before-exponential/input.js"
|
||||
Expect Syntax Error: "es2016/exponentiation-operator/nested-unary-before-exponential/input.js"
|
||||
Expect Syntax Error: "es2016/simple-parameter-list/array-pattern-default/input.js"
|
||||
Expect Syntax Error: "es2016/simple-parameter-list/array-pattern/input.js"
|
||||
Expect Syntax Error: "es2016/simple-parameter-list/arrow-function/input.js"
|
||||
|
|
@ -184,7 +172,6 @@ Expect Syntax Error: "es2016/simple-parameter-list/method/input.js"
|
|||
Expect Syntax Error: "es2016/simple-parameter-list/object-pattern-default/input.js"
|
||||
Expect Syntax Error: "es2016/simple-parameter-list/object-pattern/input.js"
|
||||
Expect Syntax Error: "es2016/simple-parameter-list/rest/input.js"
|
||||
Expect Syntax Error: "es2017/async-call/parenthesized-argument-object-double-proto/input.js"
|
||||
Expect Syntax Error: "es2017/async-functions/9/input.js"
|
||||
Expect Syntax Error: "es2017/async-functions/allow-await-outside-function-throw/input.js"
|
||||
Expect Syntax Error: "es2017/async-functions/async-await-as-arrow-binding-identifier/input.js"
|
||||
|
|
@ -209,10 +196,6 @@ Expect Syntax Error: "es2020/dynamic-import/direct-calls-only/input.js"
|
|||
Expect Syntax Error: "es2020/dynamic-import/invalid-trailing-comma/input.js"
|
||||
Expect Syntax Error: "es2020/import-meta/error-in-script/input.js"
|
||||
Expect Syntax Error: "es2020/import-meta/no-other-prop-names/input.js"
|
||||
Expect Syntax Error: "es2020/nullish-coalescing-operator/no-paren-and-nullish/input.js"
|
||||
Expect Syntax Error: "es2020/nullish-coalescing-operator/no-paren-nullish-and/input.js"
|
||||
Expect Syntax Error: "es2020/nullish-coalescing-operator/no-paren-nullish-or/input.js"
|
||||
Expect Syntax Error: "es2020/nullish-coalescing-operator/no-paren-or-nullish/input.js"
|
||||
Expect Syntax Error: "esprima/declaration-function/dupe-param/input.js"
|
||||
Expect Syntax Error: "esprima/es2015-array-binding-pattern/invalid-dup-param/input.js"
|
||||
Expect Syntax Error: "esprima/es2015-array-pattern/dupe-param-1/input.js"
|
||||
|
|
@ -236,12 +219,6 @@ Expect Syntax Error: "esprima/es2015-identifier/invalid_expression_await/input.j
|
|||
Expect Syntax Error: "esprima/es2015-identifier/invalid_var_await/input.js"
|
||||
Expect Syntax Error: "esprima/es2015-meta-property/invalid-new-target/input.js"
|
||||
Expect Syntax Error: "esprima/es2015-meta-property/unknown-property/input.js"
|
||||
Expect Syntax Error: "esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/input.js"
|
||||
Expect Syntax Error: "esprima/es2015-object-initialiser/invalid-proto-identifier-literal/input.js"
|
||||
Expect Syntax Error: "esprima/es2015-object-initialiser/invalid-proto-identifiers/input.js"
|
||||
Expect Syntax Error: "esprima/es2015-object-initialiser/invalid-proto-literal-identifier/input.js"
|
||||
Expect Syntax Error: "esprima/es2015-object-initialiser/invalid-proto-literals/input.js"
|
||||
Expect Syntax Error: "esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/input.js"
|
||||
Expect Syntax Error: "esprima/es2015-yield/invalid-yield-binding-property/input.js"
|
||||
Expect Syntax Error: "esprima/es2015-yield/invalid-yield-expression/input.js"
|
||||
Expect Syntax Error: "esprima/es2015-yield/invalid-yield-generator-arrow-default/input.js"
|
||||
|
|
@ -354,7 +331,6 @@ Expect Syntax Error: "esprima/invalid-syntax/migrated_0245/input.js"
|
|||
Expect Syntax Error: "esprima/invalid-syntax/migrated_0246/input.js"
|
||||
Expect Syntax Error: "esprima/invalid-syntax/migrated_0247/input.js"
|
||||
Expect Syntax Error: "esprima/invalid-syntax/migrated_0249/input.js"
|
||||
Expect Syntax Error: "esprima/invalid-syntax/migrated_0250/input.js"
|
||||
Expect Syntax Error: "esprima/invalid-syntax/migrated_0260/input.js"
|
||||
Expect Syntax Error: "esprima/statement-if/.migrated_0003/input.js"
|
||||
Expect Syntax Error: "esprima/statement-iteration/.migrated_0021/input.js"
|
||||
|
|
@ -413,8 +389,6 @@ Expect Syntax Error: "typescript/dts/invalid-class-initializer/input.ts"
|
|||
Expect Syntax Error: "typescript/expect-plugin/export-interface/input.js"
|
||||
Expect Syntax Error: "typescript/expect-plugin/export-type-named/input.js"
|
||||
Expect Syntax Error: "typescript/expect-plugin/export-type/input.js"
|
||||
Expect Syntax Error: "typescript/exponentiation/await-non-null-before-exponential/input.ts"
|
||||
Expect Syntax Error: "typescript/exponentiation/unary-non-null-before-exponential/input.ts"
|
||||
Expect Syntax Error: "typescript/export/double-declare/input.ts"
|
||||
Expect Syntax Error: "typescript/function/empty-type-parameters/input.ts"
|
||||
Expect Syntax Error: "typescript/function/parameter-properties/input.ts"
|
||||
|
|
@ -2328,6 +2302,38 @@ Expect to Parse: "typescript/types/const-type-parameters/input.ts"
|
|||
· ╰── Cannot assign to this expression
|
||||
╰────
|
||||
|
||||
× Identifier `__proto__` has already been declared
|
||||
╭─[es2015/duplicate-proto/in-new-expression/input.js:1:1]
|
||||
1 │ new {__proto__: Number, __proto__: Number}.__proto__;
|
||||
· ────┬──── ────┬────
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `__proto__` has already been declared here
|
||||
╰────
|
||||
|
||||
× Identifier `__proto__` has already been declared
|
||||
╭─[es2015/duplicate-proto/with-assignment-expression/input.js:1:1]
|
||||
1 │ ({
|
||||
2 │ __proto__: a,
|
||||
· ────┬────
|
||||
· ╰── `__proto__` has already been declared here
|
||||
3 │ __proto__: a,
|
||||
· ────┬────
|
||||
· ╰── It can not be redeclared here
|
||||
4 │ a: a = 1
|
||||
╰────
|
||||
|
||||
× Identifier `__proto__` has already been declared
|
||||
╭─[es2015/duplicate-proto/without-assignment-expression/input.js:1:1]
|
||||
1 │ ({
|
||||
2 │ __proto__: a,
|
||||
· ────┬────
|
||||
· ╰── `__proto__` has already been declared here
|
||||
3 │ __proto__: a,
|
||||
· ────┬────
|
||||
· ╰── It can not be redeclared here
|
||||
4 │ })
|
||||
╰────
|
||||
|
||||
× Unexpected token
|
||||
╭─[es2015/for-in/bare-initializer/input.js:1:1]
|
||||
1 │ var a;
|
||||
|
|
@ -3488,6 +3494,14 @@ Expect to Parse: "typescript/types/const-type-parameters/input.ts"
|
|||
· ╰── A 'set' accessor must have exactly one parameter.
|
||||
╰────
|
||||
|
||||
× Identifier `__proto__` has already been declared
|
||||
╭─[es2015/uncategorised/349/input.js:1:1]
|
||||
1 │ ({ '__proto__': 1, __proto__: 2 })
|
||||
· ─────┬───── ────┬────
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `__proto__` has already been declared here
|
||||
╰────
|
||||
|
||||
× Unexpected token
|
||||
╭─[es2015/uncategorised/357/input.js:1:1]
|
||||
1 │ await = foo();
|
||||
|
|
@ -3712,6 +3726,27 @@ Expect to Parse: "typescript/types/const-type-parameters/input.ts"
|
|||
╰────
|
||||
help: Try insert a semicolon here
|
||||
|
||||
× Unexpected exponentiation expression
|
||||
╭─[es2016/exponentiation-operator/10/input.js:1:1]
|
||||
1 │ -5 ** 6;
|
||||
· ───────
|
||||
╰────
|
||||
help: Wrap unary expression in parentheses to enforce operator precedence
|
||||
|
||||
× Unexpected exponentiation expression
|
||||
╭─[es2016/exponentiation-operator/11/input.js:1:1]
|
||||
1 │ -(5) ** 6;
|
||||
· ─────────
|
||||
╰────
|
||||
help: Wrap unary expression in parentheses to enforce operator precedence
|
||||
|
||||
× Unexpected exponentiation expression
|
||||
╭─[es2016/exponentiation-operator/12/input.js:1:1]
|
||||
1 │ (-5 ** 6);
|
||||
· ───────
|
||||
╰────
|
||||
help: Wrap unary expression in parentheses to enforce operator precedence
|
||||
|
||||
× Unexpected token
|
||||
╭─[es2016/exponentiation-operator/13/input.js:1:1]
|
||||
1 │ 1 %* 1;
|
||||
|
|
@ -3724,6 +3759,41 @@ Expect to Parse: "typescript/types/const-type-parameters/input.ts"
|
|||
· ──
|
||||
╰────
|
||||
|
||||
× Unexpected exponentiation expression
|
||||
╭─[es2016/exponentiation-operator/15/input.js:1:1]
|
||||
1 │ -(5) ** 6;
|
||||
· ─────────
|
||||
╰────
|
||||
help: Wrap unary expression in parentheses to enforce operator precedence
|
||||
|
||||
× Unexpected exponentiation expression
|
||||
╭─[es2016/exponentiation-operator/16/input.js:1:1]
|
||||
1 │ (-5 ** 6);
|
||||
· ───────
|
||||
╰────
|
||||
help: Wrap unary expression in parentheses to enforce operator precedence
|
||||
|
||||
× Unexpected exponentiation expression
|
||||
╭─[es2016/exponentiation-operator/await-before-exponential/input.js:1:1]
|
||||
1 │ async () => await 5 ** 6;
|
||||
· ────────────
|
||||
╰────
|
||||
help: Wrap await expression in parentheses to enforce operator precedence
|
||||
|
||||
× Unexpected exponentiation expression
|
||||
╭─[es2016/exponentiation-operator/await-unary-before-exponential/input.js:1:1]
|
||||
1 │ async () => await -5 ** 6;
|
||||
· ─────────────
|
||||
╰────
|
||||
help: Wrap await expression in parentheses to enforce operator precedence
|
||||
|
||||
× Unexpected exponentiation expression
|
||||
╭─[es2016/exponentiation-operator/nested-unary-before-exponential/input.js:1:1]
|
||||
1 │ (-+5 ** 6);
|
||||
· ────────
|
||||
╰────
|
||||
help: Wrap unary expression in parentheses to enforce operator precedence
|
||||
|
||||
× Automatic Semicolon Insertion
|
||||
╭─[es2016/simple-parameter-list/async-arrow-function-after-binary-operator/input.js:1:1]
|
||||
1 │ 3 + async() => 2
|
||||
|
|
@ -3796,6 +3866,14 @@ Expect to Parse: "typescript/types/const-type-parameters/input.ts"
|
|||
╰────
|
||||
help: Try insert a semicolon here
|
||||
|
||||
× Identifier `__proto__` has already been declared
|
||||
╭─[es2017/async-call/parenthesized-argument-object-double-proto/input.js:1:1]
|
||||
1 │ async({ __proto__: x, __proto__: y })
|
||||
· ────┬──── ────┬────
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `__proto__` has already been declared here
|
||||
╰────
|
||||
|
||||
× Invalid assignment in object literal
|
||||
╭─[es2017/async-call/parenthesized-argument-object-with-assignment/input.js:1:1]
|
||||
1 │ async({ foo33 = 1 });
|
||||
|
|
@ -4335,6 +4413,34 @@ Expect to Parse: "typescript/types/const-type-parameters/input.ts"
|
|||
· ╰── Cannot assign to this expression
|
||||
╰────
|
||||
|
||||
× Logical expressions and coalesce expressions cannot be mixed
|
||||
╭─[es2020/nullish-coalescing-operator/no-paren-and-nullish/input.js:1:1]
|
||||
1 │ c && d ?? e;
|
||||
· ───────────
|
||||
╰────
|
||||
help: Wrap either expression by parentheses
|
||||
|
||||
× Logical expressions and coalesce expressions cannot be mixed
|
||||
╭─[es2020/nullish-coalescing-operator/no-paren-nullish-and/input.js:1:1]
|
||||
1 │ a ?? b && c;
|
||||
· ───────────
|
||||
╰────
|
||||
help: Wrap either expression by parentheses
|
||||
|
||||
× Logical expressions and coalesce expressions cannot be mixed
|
||||
╭─[es2020/nullish-coalescing-operator/no-paren-nullish-or/input.js:1:1]
|
||||
1 │ e ?? f ?? g || h;
|
||||
· ────────────────
|
||||
╰────
|
||||
help: Wrap either expression by parentheses
|
||||
|
||||
× Logical expressions and coalesce expressions cannot be mixed
|
||||
╭─[es2020/nullish-coalescing-operator/no-paren-or-nullish/input.js:1:1]
|
||||
1 │ h || i ?? j;
|
||||
· ───────────
|
||||
╰────
|
||||
help: Wrap either expression by parentheses
|
||||
|
||||
× Optional chaining cannot appear in the callee of new expressions
|
||||
╭─[es2020/optional-chaining/class-contructor-call/input.js:1:1]
|
||||
1 │ new C?.b.d()
|
||||
|
|
@ -6236,6 +6342,54 @@ Expect to Parse: "typescript/types/const-type-parameters/input.ts"
|
|||
· ─
|
||||
╰────
|
||||
|
||||
× Identifier `__proto__` has already been declared
|
||||
╭─[esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/input.js:1:1]
|
||||
1 │ ({ get __proto(){}, "__proto__": null, __proto__: null, })
|
||||
· ─────┬───── ────┬────
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `__proto__` has already been declared here
|
||||
╰────
|
||||
|
||||
× Identifier `__proto__` has already been declared
|
||||
╭─[esprima/es2015-object-initialiser/invalid-proto-identifier-literal/input.js:1:1]
|
||||
1 │ ({ __proto__: null, "__proto__": null })
|
||||
· ────┬──── ─────┬─────
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `__proto__` has already been declared here
|
||||
╰────
|
||||
|
||||
× Identifier `__proto__` has already been declared
|
||||
╭─[esprima/es2015-object-initialiser/invalid-proto-identifiers/input.js:1:1]
|
||||
1 │ ({ __proto__: null, __proto__: null })
|
||||
· ────┬──── ────┬────
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `__proto__` has already been declared here
|
||||
╰────
|
||||
|
||||
× Identifier `__proto__` has already been declared
|
||||
╭─[esprima/es2015-object-initialiser/invalid-proto-literal-identifier/input.js:1:1]
|
||||
1 │ ({ "__proto__": null, __proto__: null })
|
||||
· ─────┬───── ────┬────
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `__proto__` has already been declared here
|
||||
╰────
|
||||
|
||||
× Identifier `__proto__` has already been declared
|
||||
╭─[esprima/es2015-object-initialiser/invalid-proto-literals/input.js:1:1]
|
||||
1 │ ({ "__proto__": null, '__proto__': null })
|
||||
· ─────┬───── ─────┬─────
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `__proto__` has already been declared here
|
||||
╰────
|
||||
|
||||
× Identifier `__proto__` has already been declared
|
||||
╭─[esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/input.js:1:1]
|
||||
1 │ ({ set __proto__(x){}, "__proto__": null, __proto__: null, })
|
||||
· ─────┬───── ────┬────
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `__proto__` has already been declared here
|
||||
╰────
|
||||
|
||||
× Unexpected token
|
||||
╭─[esprima/es2015-spread-element/invalid-call-dot-dot/input.js:1:1]
|
||||
1 │ f(..g);
|
||||
|
|
@ -7662,6 +7816,14 @@ Expect to Parse: "typescript/types/const-type-parameters/input.ts"
|
|||
· ╰── `__proto__` has already been declared here
|
||||
╰────
|
||||
|
||||
× Identifier `__proto__` has already been declared
|
||||
╭─[esprima/invalid-syntax/migrated_0250/input.js:1:1]
|
||||
1 │ x = { __proto__: 42, __proto__: 43 }
|
||||
· ────┬──── ────┬────
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `__proto__` has already been declared here
|
||||
╰────
|
||||
|
||||
× Unexpected token
|
||||
╭─[esprima/invalid-syntax/migrated_0252/input.js:1:1]
|
||||
1 │ var
|
||||
|
|
@ -8203,6 +8365,20 @@ Expect to Parse: "typescript/types/const-type-parameters/input.ts"
|
|||
· ╰── Missing initializer in destructuring declaration
|
||||
╰────
|
||||
|
||||
× Unexpected exponentiation expression
|
||||
╭─[typescript/exponentiation/await-non-null-before-exponential/input.ts:1:1]
|
||||
1 │ async (a) => await a! ** 6;
|
||||
· ─────────────
|
||||
╰────
|
||||
help: Wrap await expression in parentheses to enforce operator precedence
|
||||
|
||||
× Unexpected exponentiation expression
|
||||
╭─[typescript/exponentiation/unary-non-null-before-exponential/input.ts:1:1]
|
||||
1 │ (a) => +a! ** 6;
|
||||
· ────────
|
||||
╰────
|
||||
help: Wrap unary expression in parentheses to enforce operator precedence
|
||||
|
||||
× Unexpected token
|
||||
╭─[typescript/export/declare-invalid/input.ts:1:1]
|
||||
1 │ export declare foo;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue