Build(deps): Bump espree from 7.3.1 to 8.0.0 (#11162)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
This commit is contained in:
authored and GitHub committed 2021-07-07 18:53:09 +08:00
1 parent 1300b1ea2d
commit 09222ed6e8
38 files changed
+180 -348

No files matched your search

+1 -1
View File
@@ -38,7 +38,7 @@
"editorconfig": "0.15.3",
"editorconfig-to-prettier": "0.2.0",
"escape-string-regexp": "4.0.0",
"espree": "7.3.1",
"espree": "8.0.0",
"esutils": "2.0.3",
"fast-glob": "3.2.5",
"fast-json-stable-stringify": "2.1.0",
+4 -2
View File
@@ -1,11 +1,14 @@
"use strict";
const createError = require("../common/parser-create-error");
const tryCombinations = require("../utils/try-combinations");
const postprocess = require("./parse-postprocess");
const createParser = require("./parser/create-parser");
const replaceHashbang = require("./parser/replace-hashbang");
/** @type {import("espree").Options} */
const parseOptions = {
ecmaVersion: "latest",
range: true,
loc: true,
comment: true,
@@ -30,8 +33,7 @@ function createParseError(error) {
}
function parse(originalText, parsers, options) {
const { parse, latestEcmaVersion } = require("espree");
parseOptions.ecmaVersion = latestEcmaVersion;
const { parse } = require("espree");
const textToParse = replaceHashbang(originalText);
const { result: ast, error: moduleParseError } = tryCombinations(
@@ -302,26 +302,6 @@ promise.then((result) =>
================================================================================
`;
exports[`class-property.js [espree] format 1`] = `
"Unexpected token = (3:22)
1 | const composition = (ViewComponent, ContainerComponent) =>
2 | class extends React.Component {
> 3 | static propTypes = {};
| ^
4 | };
5 |"
`;
exports[`class-property.js - {"arrowParens":"always"} [espree] format 1`] = `
"Unexpected token = (3:22)
1 | const composition = (ViewComponent, ContainerComponent) =>
2 | class extends React.Component {
> 3 | static propTypes = {};
| ^
4 | };
5 |"
`;
exports[`class-property.js - {"arrowParens":"always"} format 1`] = `
====================================options=====================================
arrowParens: "always"
@@ -343,16 +323,6 @@ const composition = (ViewComponent, ContainerComponent) =>
================================================================================
`;
exports[`class-property.js - {"trailingComma":"all"} [espree] format 1`] = `
"Unexpected token = (3:22)
1 | const composition = (ViewComponent, ContainerComponent) =>
2 | class extends React.Component {
> 3 | static propTypes = {};
| ^
4 | };
5 |"
`;
exports[`class-property.js - {"trailingComma":"all"} format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
+1 -3
View File
@@ -1,6 +1,4 @@
const errors = {
espree: ["class-property.js"],
};
const errors = {};
run_spec(__dirname, ["babel", "flow", "typescript"], {
errors,
@@ -322,17 +322,6 @@ const alsoGoodPrecision = 9007199254740993n;
================================================================================
`;
exports[`class-properties.js [espree] format 1`] = `
"Unexpected token = (5:22)
3 | class Bork {
4 | //Property initializer syntax
> 5 | instanceProperty = \\"bork\\";
| ^
6 | boundFunction = () => {
7 | return this.instanceProperty;
8 | };"
`;
exports[`class-properties.js format 1`] = `
====================================options=====================================
parsers: ["babel", "babel-ts", "babel-flow"]
@@ -398,13 +387,14 @@ console.log(Bork.staticFunction()); // > "babelIsCool"
`;
exports[`class-static-block.js [espree] format 1`] = `
"Unexpected character '#' (2:10)
1 | class C {
> 2 | static #x = 42;
| ^
"Unexpected token { (4:10)
2 | static #x = 42;
3 | static y;
4 | static {
5 | try {"
> 4 | static {
| ^
5 | try {
6 | this.y = doSomethingWith(this.#x);
7 | } catch {"
`;
exports[`class-static-block.js [meriyah] format 1`] = `
@@ -1738,14 +1728,14 @@ value
`;
exports[`private-fields-in-in.js [espree] format 1`] = `
"Unexpected character '#' (4:3)
2 |
3 | class C {
> 4 | #brand;
| ^
5 |
6 | static isC(obj) {
7 | try {"
"Unexpected token #brand (44:12)
42 |
43 | static isC(obj) {
> 44 | return #brand in obj && #method in obj && #getter in obj;
| ^
45 | }
46 | }
47 |"
`;
exports[`private-fields-in-in.js format 1`] = `
@@ -1769,7 +1759,7 @@ class C {
}
}
class C {
class C2 {
#data = null; // populated later
get #getter() {
@@ -1789,7 +1779,7 @@ class C {
}
}
class C {
class C3 {
#brand;
#method() {}
@@ -1826,7 +1816,7 @@ class C {
}
}
class C {
class C2 {
#data = null; // populated later
get #getter() {
@@ -1846,7 +1836,7 @@ class C {
}
}
class C {
class C3 {
#brand;
#method() {}
@@ -1870,17 +1860,6 @@ class C {
================================================================================
`;
exports[`private-methods.js [espree] format 1`] = `
"Unexpected character '#' (6:3)
4 |
5 | class Counter extends HTMLElement {
> 6 | #xValue = 0;
| ^
7 |
8 | get #x() { return this.#xValue; }
9 | set #x(value) {"
`;
exports[`private-methods.js format 1`] = `
====================================options=====================================
parsers: ["babel", "babel-ts", "babel-flow"]
@@ -1893,6 +1872,7 @@ printWidth: 80
class Counter extends HTMLElement {
#xValue = 0;
#render() {}
get #x() { return this.#xValue; }
set #x(value) {
@@ -1913,6 +1893,7 @@ class Counter extends HTMLElement {
class Counter extends HTMLElement {
#xValue = 0;
#render() {}
get #x() {
return this.#xValue;
@@ -1931,9 +1912,9 @@ class Counter extends HTMLElement {
`;
exports[`record-tuple-record.js [espree] format 1`] = `
"Unexpected character '#' (1:17)
"Unexpected character '{' (1:18)
> 1 | const record1 = #{
| ^
| ^
2 | a: 1,
3 | b: 2,
4 | c: 3,"
@@ -1975,9 +1956,9 @@ const record2 = #{ ...record1, b: 5 };
`;
exports[`record-tuple-tuple.js [espree] format 1`] = `
"Unexpected character '#' (1:16)
"Unexpected character '[' (1:17)
> 1 | const tuple1 = #[1, 2, 3];
| ^
| ^
2 |"
`;
@@ -4,7 +4,6 @@
run_spec(__dirname, ["babel", "babel-ts", "babel-flow"], {
errors: {
espree: [
"class-properties.js",
"decimal.js",
"decorators.js",
"do-expressions.js",
@@ -19,7 +18,6 @@ run_spec(__dirname, ["babel", "babel-ts", "babel-flow"], {
"pipeline-operator-minimal.js",
"pipeline-operator-smart.js",
"private-fields-in-in.js",
"private-methods.js",
"record-tuple-record.js",
"record-tuple-tuple.js",
"throw-expressions.js",
@@ -13,7 +13,7 @@ class C {
}
}
class C {
class C2 {
#data = null; // populated later
get #getter() {
@@ -33,7 +33,7 @@ class C {
}
}
class C {
class C3 {
#brand;
#method() {}
@@ -4,6 +4,7 @@
class Counter extends HTMLElement {
#xValue = 0;
#render() {}
get #x() { return this.#xValue; }
set #x(value) {
@@ -1,15 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`class-property.js [espree] format 1`] = `
"Unexpected token = (2:12)
1 | class X {
> 2 | TEMPLATE =
| ^
3 | // tab index is needed so we can focus, which is needed for keyboard events
4 | '<div class=\\"ag-large-text\\" tabindex=\\"0\\">' +
5 | '<div class=\\"ag-large-textarea\\"></div>' +"
`;
exports[`class-property.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
+1 -5
View File
@@ -1,5 +1 @@
run_spec(__dirname, ["babel", "flow", "typescript"], {
errors: {
espree: ["class-property.js"],
},
});
run_spec(__dirname, ["babel", "flow", "typescript"]);
@@ -1,13 +1,14 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`class-static-block.js [espree] format 1`] = `
"Unexpected character '#' (2:10)
1 | class C {
> 2 | static #x = 42;
| ^
"Unexpected token { (4:10)
2 | static #x = 42;
3 | static y;
4 | static {
5 | try {"
> 4 | static {
| ^
5 | try {
6 | this.y = doSomethingWith(this.#x);
7 | } catch {"
`;
exports[`class-static-block.js [meriyah] format 1`] = `
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`optional-chaining.js [espree] format 1`] = `
"Unexpected character '#' (3:13)
"Private field '#x' must be declared in an enclosing class (3:13)
1 | // https://github.com/babel/babel/pull/11669
2 |
> 3 | delete obj?.#x.a
@@ -19,7 +19,7 @@ exports[`optional-chaining.js [meriyah] format 1`] = `
`;
exports[`optional-chaining.js - {"semi":false} [espree] format 1`] = `
"Unexpected character '#' (3:13)
"Private field '#x' must be declared in an enclosing class (3:13)
1 | // https://github.com/babel/babel/pull/11669
2 |
> 3 | delete obj?.#x.a
@@ -73,24 +73,6 @@ delete obj?.#x.a;
================================================================================
`;
exports[`private_fields.js [espree] format 1`] = `
"Unexpected character '#' (1:11)
> 1 | class A { #x; #y; }
| ^
2 | class B { #x = 0; #y = 1; }
3 |
4 | class C {"
`;
exports[`private_fields.js - {"semi":false} [espree] format 1`] = `
"Unexpected character '#' (1:11)
> 1 | class A { #x; #y; }
| ^
2 | class B { #x = 0; #y = 1; }
3 |
4 | class C {"
`;
exports[`private_fields.js - {"semi":false} format 1`] = `
====================================options=====================================
parsers: ["babel"]
@@ -348,26 +330,6 @@ class F {
================================================================================
`;
exports[`with_comments.js [espree] format 1`] = `
"Unexpected character '#' (2:3)
1 | class A {
> 2 | #foobar =
| ^
3 | // comment to break
4 | 1 +
5 | // comment to break again"
`;
exports[`with_comments.js - {"semi":false} [espree] format 1`] = `
"Unexpected character '#' (2:3)
1 | class A {
> 2 | #foobar =
| ^
3 | // comment to break
4 | 1 +
5 | // comment to break again"
`;
exports[`with_comments.js - {"semi":false} format 1`] = `
====================================options=====================================
parsers: ["babel"]
@@ -1,7 +1,11 @@
const errors = {
meriyah: ["optional-chaining.js"],
espree: ["optional-chaining.js"],
};
run_spec(__dirname, ["babel"], {
errors: { espree: true, meriyah: ["optional-chaining.js"] },
errors,
});
run_spec(__dirname, ["babel"], {
semi: false,
errors: { espree: true, meriyah: ["optional-chaining.js"] },
errors,
});
@@ -212,16 +212,6 @@ new Ctor(class {});
================================================================================
`;
exports[`property.js [espree] format 1`] = `
"Unexpected token = (2:10)
1 | class A {
> 2 | foobar =
| ^
3 | // comment to break
4 | 1 +
5 | // comment to break again"
`;
exports[`property.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
+1 -3
View File
@@ -1,3 +1 @@
run_spec(__dirname, ["babel", "flow", "typescript"], {
errors: { espree: ["property.js"] },
});
run_spec(__dirname, ["babel", "flow", "typescript"]);
@@ -25,17 +25,6 @@ class x {
================================================================================
`;
exports[`class-property.js [espree] format 1`] = `
"Unexpected token = (4:5)
2 | f(/* ... */) {}
3 | f() /* ... */ {}
> 4 | f = (/* ... */) => {};
| ^
5 | static f(/* ... */) {};
6 | static f = (/* ... */) => {};
7 | static f = function(/* ... */) {};"
`;
exports[`class-property.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
@@ -1,3 +1 @@
run_spec(__dirname, ["babel", "flow", "typescript"], {
errors: { espree: ["class-property.js"] },
});
run_spec(__dirname, ["babel", "flow", "typescript"]);
@@ -1,16 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`async-identifier.js [espree] format 1`] = `
"Unexpected token [ (6:23)
4 |
5 | async function f() {
> 6 | for await (async of []);
| ^
7 | for await ((async) of []);
8 | for await ((foo) of async);
9 | for await ((foo) of []) async;"
`;
exports[`async-identifier.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
+1 -3
View File
@@ -1,3 +1 @@
run_spec(__dirname, ["babel", "flow", "typescript"], {
errors: { espree: ["async-identifier.js"] },
});
run_spec(__dirname, ["babel", "flow", "typescript"]);
@@ -1,27 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`class.js [espree] format 1`] = `
"Unexpected token ; (12:6)
10 |
11 | class C1 {
> 12 | get; // The semicolon *is* necessary
| ^
13 | x(){}
14 | }
15 | class C2 {"
`;
exports[`class.js - {"semi":false} [espree] format 1`] = `
"Unexpected token ; (12:6)
10 |
11 | class C1 {
> 12 | get; // The semicolon *is* necessary
| ^
13 | x(){}
14 | }
15 | class C2 {"
`;
exports[`class.js - {"semi":false} format 1`] = `
====================================options=====================================
parsers: ["babel", "flow"]
@@ -1008,26 +986,6 @@ aReallyLongLine012345678901234567890123456789012345678901234567890123456789 *
================================================================================
`;
exports[`private-field.js [espree] format 1`] = `
"Unexpected character '#' (2:3)
1 | class C {
> 2 | #field = 'value';
| ^
3 | [\\"method\\"]() {}
4 | }
5 |"
`;
exports[`private-field.js - {"semi":false} [espree] format 1`] = `
"Unexpected character '#' (2:3)
1 | class C {
> 2 | #field = 'value';
| ^
3 | [\\"method\\"]() {}
4 | }
5 |"
`;
exports[`private-field.js - {"semi":false} format 1`] = `
====================================options=====================================
parsers: ["babel", "flow"]
+2 -4
View File
@@ -1,4 +1,2 @@
const errors = { espree: ["class.js", "private-field.js"] };
run_spec(__dirname, ["babel", "flow"], { errors });
run_spec(__dirname, ["babel", "flow"], { semi: false, errors });
run_spec(__dirname, ["babel", "flow"], {});
run_spec(__dirname, ["babel", "flow"], { semi: false });
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`private-in.js [espree] format 1`] = `
"Unexpected character '#' (1:5)
"Unexpected token #prop (1:5)
> 1 | if (#prop in obj) {
| ^
2 | }
@@ -1,15 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`classes.js - {"quoteProps":"as-needed"} [espree] format 1`] = `
"Unexpected token = (2:5)
1 | class A {
> 2 | a = \\"a\\"
| ^
3 | };
4 |
5 | class B {"
`;
exports[`classes.js - {"quoteProps":"as-needed"} format 1`] = `
====================================options=====================================
parsers: ["babel"]
@@ -57,16 +47,6 @@ class D {
================================================================================
`;
exports[`classes.js - {"quoteProps":"consistent","singleQuote":true} [espree] format 1`] = `
"Unexpected token = (2:5)
1 | class A {
> 2 | a = \\"a\\"
| ^
3 | };
4 |
5 | class B {"
`;
exports[`classes.js - {"quoteProps":"consistent","singleQuote":true} format 1`] = `
====================================options=====================================
parsers: ["babel"]
@@ -115,16 +95,6 @@ class D {
================================================================================
`;
exports[`classes.js - {"quoteProps":"consistent"} [espree] format 1`] = `
"Unexpected token = (2:5)
1 | class A {
> 2 | a = \\"a\\"
| ^
3 | };
4 |
5 | class B {"
`;
exports[`classes.js - {"quoteProps":"consistent"} format 1`] = `
====================================options=====================================
parsers: ["babel"]
@@ -172,16 +142,6 @@ class D {
================================================================================
`;
exports[`classes.js - {"quoteProps":"preserve"} [espree] format 1`] = `
"Unexpected token = (2:5)
1 | class A {
> 2 | a = \\"a\\"
| ^
3 | };
4 |
5 | class B {"
`;
exports[`classes.js - {"quoteProps":"preserve"} format 1`] = `
====================================options=====================================
parsers: ["babel"]
+1 -3
View File
@@ -1,6 +1,4 @@
const errors = {
espree: ["classes.js"],
};
const errors = {};
run_spec(__dirname, ["babel"], {
quoteProps: "as-needed",
@@ -1,10 +1,10 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`computed.js [espree] format 1`] = `
"Unexpected character '#' (2:8)
"Unexpected character '{' (2:9)
1 | const key = \\"a\\";
> 2 | assert(#{ [key]: 1 } === #{ a: 1 })
| ^
| ^
3 | assert(#{ [key.toUpperCase()]: 1 } === #{ A: 1 })
4 |
5 | assert(#{ [true]: 1 } === #{ true: 1 })"
@@ -51,9 +51,9 @@ assert(#{ [9 + 1]: "ten" } === #{ ["10"]: "ten" });
`;
exports[`destructuring.js [espree] format 1`] = `
"Unexpected character '#' (1:18)
"Unexpected character '{' (1:19)
> 1 | const { a, b } = #{ a: 1, b: 2 };
| ^
| ^
2 | assert(a === 1);
3 | assert(b === 2);
4 |"
@@ -99,9 +99,9 @@ assert(rest.c === 3);
`;
exports[`record.js [espree] format 1`] = `
"Unexpected character '#' (1:17)
"Unexpected character '{' (1:18)
> 1 | const record1 = #{
| ^
| ^
2 | a: 1,
3 | b: 2,
4 | c: 3,"
@@ -161,10 +161,10 @@ assert(record1.d?.a === undefined);
`;
exports[`shorthand.js [espree] format 1`] = `
"Unexpected character '#' (2:16)
"Unexpected character '{' (2:17)
1 | const url = \\"https://github.com/tc39/proposal-record-tuple\\";
> 2 | const record = #{ url }
| ^
| ^
3 | console.log(record.url) // https://github.com/tc39/proposal-record-tuple
4 |"
`;
@@ -197,9 +197,9 @@ console.log(record.url); // https://github.com/tc39/proposal-record-tuple
`;
exports[`spread.js [espree] format 1`] = `
"Unexpected character '#' (1:18)
"Unexpected character '{' (1:19)
> 1 | const formData = #{ title: \\"Implement all the things\\" }
| ^
| ^
2 | const taskNow = #{ id: 42, status: \\"WIP\\", ...formData }
3 | const taskLater = #{ ...taskNow, status: \\"DONE\\" }
4 |"
@@ -239,9 +239,9 @@ assert(taskLater === #{ status: "DONE", title: formData.title, id: 42 });
`;
exports[`syntax.js [espree] format 1`] = `
"Unexpected character '#' (1:1)
"Unexpected character '{' (1:2)
> 1 | #{}
| ^
| ^
2 | #{ a: 1, b: 2 }
3 | #{ a: 1, b: #[2, 3, #{ c: 4 }] }
4 |"
@@ -1,12 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`d-flag.js [espree] format 1`] = `
"Invalid regular expression flag (1:2)
> 1 | /./d;
| ^
2 |"
`;
exports[`d-flag.js [flow] format 1`] = `
"Invalid flags supplied to RegExp constructor 'd' (1:5)
> 1 | /./d;
-1
View File
@@ -1,7 +1,6 @@
run_spec(__dirname, ["babel", "flow", "typescript"], {
errors: {
flow: ["d-flag.js"],
espree: ["d-flag.js"],
meriyah: ["d-flag.js"],
},
});
@@ -1,5 +1,27 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`non-octal-eight-and-nine.js [espree] format 1`] = `
"Invalid escape sequence (3:3)
1 | // https://github.com/babel/babel/pull/11852
2 |
> 3 | \\"\\\\8\\",\\"\\\\9\\";
| ^
4 | () => {
5 | \\"use strict\\";
6 | \\"\\\\8\\", \\"\\\\9\\";"
`;
exports[`non-octal-eight-and-nine.js - {"trailingComma":"all"} [espree] format 1`] = `
"Invalid escape sequence (3:3)
1 | // https://github.com/babel/babel/pull/11852
2 |
> 3 | \\"\\\\8\\",\\"\\\\9\\";
| ^
4 | () => {
5 | \\"use strict\\";
6 | \\"\\\\8\\", \\"\\\\9\\";"
`;
exports[`non-octal-eight-and-nine.js - {"trailingComma":"all"} format 1`] = `
====================================options=====================================
parsers: ["babel", "flow"]
+7 -2
View File
@@ -1,2 +1,7 @@
run_spec(__dirname, ["babel", "flow"]);
run_spec(__dirname, ["babel", "flow"], { trailingComma: "all" });
run_spec(__dirname, ["babel", "flow"], {
errors: { espree: ["non-octal-eight-and-nine.js"] },
});
run_spec(__dirname, ["babel", "flow"], {
trailingComma: "all",
errors: { espree: ["non-octal-eight-and-nine.js"] },
});
@@ -1,12 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`example.js [espree] format 1`] = `
"Cannot use keyword 'await' outside an async function (1:1)
> 1 | await something();
| ^
2 |"
`;
exports[`example.js [meriyah] format 1`] = `
"[1:5]: 'Await' may not be used as an identifier in this context (1:5)
> 1 | await something();
@@ -1,3 +1,3 @@
run_spec(__dirname, ["babel", "typescript"], {
errors: { espree: true, meriyah: true },
errors: { meriyah: true },
});
@@ -1,9 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`destructuring.js [espree] format 1`] = `
"Unexpected character '#' (1:16)
"Unexpected character '[' (1:17)
> 1 | const [a, b] = #[1, 2];
| ^
| ^
2 | assert(a === 1);
3 | assert(b === 2);
4 |"
@@ -63,9 +63,9 @@ exports[`invalid-tuple-holes.js [babel] format 1`] = `
`;
exports[`invalid-tuple-holes.js [espree] format 1`] = `
"Unexpected character '#' (1:1)
"Unexpected character '[' (1:2)
> 1 | #[,]
| ^
| ^
2 |"
`;
@@ -77,9 +77,9 @@ exports[`invalid-tuple-holes.js [meriyah] format 1`] = `
`;
exports[`syntax.js [espree] format 1`] = `
"Unexpected character '#' (1:1)
"Unexpected character '[' (1:2)
> 1 | #[]
| ^
| ^
2 | #[1, 2]
3 | #[1, 2, #{ a: 3 }]
4 |"
@@ -113,9 +113,9 @@ printWidth: 80
`;
exports[`tuple.js [espree] format 1`] = `
"Unexpected character '#' (1:16)
"Unexpected character '[' (1:17)
> 1 | const tuple1 = #[1, 2, 3];
| ^
| ^
2 |
3 | assert(tuple1[0] === 1);
4 |"
@@ -177,9 +177,9 @@ assert(tuple5 === #[2, 2, 3, 4]);
`;
exports[`tuple-trailing-comma.js [espree] format 1`] = `
"Unexpected character '#' (1:1)
"Unexpected character '[' (1:2)
> 1 | #[1,]
| ^
| ^
2 |"
`;
@@ -29,19 +29,11 @@ exports[`snippet: #0 [espree] format 1`] = `
`;
exports[`snippet: #0 [espree] format 2`] = `
"Cannot use keyword 'await' outside an async function (1:12)
"Await expression cannot be a default value (1:12)
> 1 | async (x = await (2)) => {};
| ^"
`;
exports[`snippet: #0 [espree] format 3`] = `
"Unexpected token = (2:5)
1 | export class C {
> 2 | p = await 0;
| ^
3 | }"
`;
exports[`snippet: #0 [flow] format 1`] = `
"Unexpected number, expected the token \`,\` (2:26)
1 | async function foo() {
@@ -91,7 +83,7 @@ exports[`snippet: #1 [babel] format 3`] = `
`;
exports[`snippet: #1 [espree] format 1`] = `
"Cannot use keyword 'await' outside an async function (1:12)
"Await expression cannot be a default value (1:12)
> 1 | async (x = await 2) => {};
| ^"
`;
@@ -102,12 +94,6 @@ exports[`snippet: #1 [espree] format 2`] = `
| ^"
`;
exports[`snippet: #1 [espree] format 3`] = `
"Cannot use keyword 'await' outside an async function (1:1)
> 1 | await 0;
| ^"
`;
exports[`snippet: #1 [flow] format 1`] = `
"Unexpected number, expected the token \`,\` (1:18)
> 1 | async (x = await 2) => {};
@@ -59,5 +59,5 @@ run_spec(
"await 0;",
],
},
["espree", "meriyah"]
["meriyah"]
);
@@ -7,9 +7,9 @@ exports[`snippet: #0 [babel] format 1`] = `
`;
exports[`snippet: #0 [espree] format 1`] = `
"Unexpected character '#' (1:1)
"Unexpected character '{' (1:2)
> 1 | #{a() {}}
| ^"
| ^"
`;
exports[`snippet: #0 [meriyah] format 1`] = `
@@ -25,9 +25,9 @@ exports[`snippet: #1 [babel] format 1`] = `
`;
exports[`snippet: #1 [espree] format 1`] = `
"Unexpected character '#' (1:1)
"Unexpected character '{' (1:2)
> 1 | #{async b() {}}
| ^"
| ^"
`;
exports[`snippet: #1 [meriyah] format 1`] = `
@@ -43,9 +43,9 @@ exports[`snippet: #2 [babel] format 1`] = `
`;
exports[`snippet: #2 [espree] format 1`] = `
"Unexpected character '#' (1:1)
"Unexpected character '{' (1:2)
> 1 | #{get c() {}}
| ^"
| ^"
`;
exports[`snippet: #2 [meriyah] format 1`] = `
@@ -61,9 +61,9 @@ exports[`snippet: #3 [babel] format 1`] = `
`;
exports[`snippet: #3 [espree] format 1`] = `
"Unexpected character '#' (1:1)
"Unexpected character '{' (1:2)
> 1 | #{set d(_) {}}
| ^"
| ^"
`;
exports[`snippet: #3 [meriyah] format 1`] = `
@@ -79,9 +79,9 @@ exports[`snippet: #4 [babel] format 1`] = `
`;
exports[`snippet: #4 [espree] format 1`] = `
"Unexpected character '#' (1:1)
"Unexpected character '{' (1:2)
> 1 | #{*e() {}}
| ^"
| ^"
`;
exports[`snippet: #4 [meriyah] format 1`] = `
+4 -2
View File
@@ -7,7 +7,8 @@
"module": "commonjs",
"resolveJsonModule": true,
// TBD it is desired to enabled strict type checking at some point:
"strict": false
"strict": false,
"typeRoots": ["./types", "./node_modules/@types"]
},
"exclude": [
"coverage/",
@@ -42,6 +43,7 @@
"docs/",
"scripts/",
"tests/",
"website/"
"website/",
"types/"
]
}
+38
View File
@@ -0,0 +1,38 @@
declare module "espree" {
// https://github.com/eslint/espree#options
export interface Options {
range?: boolean;
loc?: boolean;
comment?: boolean;
tokens?: boolean;
ecmaVersion?:
| 3
| 5
| 6
| 7
| 8
| 9
| 10
| 11
| 12
| 2015
| 2016
| 2017
| 2018
| 2019
| 2020
| 2021
| 2022
| "latest";
sourceType?: "script" | "module";
ecmaFeatures?: {
jsx?: boolean;
globalReturn?: boolean;
impliedStrict?: boolean;
};
}
// https://github.com/eslint/espree#options
export function parse(code: string, options?: Options): any;
// https://github.com/eslint/espree#tokenize
export function tokenize(code: string, options?: Options): any;
}
+16 -1
View File
@@ -2965,6 +2965,7 @@ eslint-plugin-jest@24.3.6:
"eslint-plugin-prettier-internal-rules@link:scripts/tools/eslint-plugin-prettier-internal-rules":
version "0.0.0"
uid ""
eslint-plugin-react@7.24.0:
version "7.24.0"
@@ -3058,6 +3059,11 @@ eslint-visitor-keys@^2.0.0, eslint-visitor-keys@^2.1.0:
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303"
integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==
eslint-visitor-keys@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.0.0.tgz#e32e99c6cdc2eb063f204eda5db67bfe58bb4186"
integrity sha512-mJOZa35trBTb3IyRmo8xmKBZlxf+N7OnUl4+ZhJHs/r+0770Wh/LEACE2pqMGMe27G/4y8P2bYGk4J70IC5k1Q==
eslint@7.30.0:
version "7.30.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.30.0.tgz#6d34ab51aaa56112fd97166226c9a97f505474f8"
@@ -3109,7 +3115,16 @@ esm-utils@1.1.0:
resolved "https://registry.yarnpkg.com/esm-utils/-/esm-utils-1.1.0.tgz#026fd8c97eee9a9b956f6f3890c9b6b5b57c4771"
integrity sha512-vm3Q1u5RvJFKbizsyK4POBdFjXJFwA+1zEbSAuC+ekjOVWGt/FCXfY8b548fccFLGPihOu1CuS//EOUsj6jczA==
espree@7.3.1, espree@^7.3.0, espree@^7.3.1:
espree@8.0.0:
version "8.0.0"
resolved "https://registry.yarnpkg.com/espree/-/espree-8.0.0.tgz#08c92c31814c96c96c54d3a35cc80f1cdb420275"
integrity sha512-y/+i23dwTjIDJrYCcjcAMr3c3UGbPIjC6THMQKjWmhP97fW0FPiI89kmpKfmgV/5jrkIi6toQP+CMm3qBE1Hig==
dependencies:
acorn "^8.4.1"
acorn-jsx "^5.3.1"
eslint-visitor-keys "^3.0.0"
espree@^7.3.0, espree@^7.3.1:
version "7.3.1"
resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6"
integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==