Skip to content

Commit

Permalink
Merge branch 'feat-7.15.0/hack-pipes' into proposal-hack-pipes-percent
Browse files Browse the repository at this point in the history
  • Loading branch information
js-choi committed Jun 8, 2021
2 parents fa257f5 + 2ebdfd5 commit 91d28f9
Show file tree
Hide file tree
Showing 177 changed files with 1,525 additions and 988 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ endif
$(MAKE) clean

bootstrap-only: clean-all
yarn install
$(YARN) install

bootstrap: bootstrap-only
$(MAKE) generate-tsconfig build
Expand Down
4 changes: 2 additions & 2 deletions eslint/babel-eslint-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
"eslint": ">=7.5.0"
},
"dependencies": {
"eslint-scope": "^5.1.0",
"eslint-scope": "^5.1.1",
"eslint-visitor-keys": "^2.1.0",
"semver": "condition:BABEL_8_BREAKING ? ^7.3.4 : ^6.3.0"
},
"devDependencies": {
"@babel/core": "workspace:*",
"dedent": "^0.7.0",
"eslint": "^7.5.0"
"eslint": "^7.27.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"eslint": ">=7.5.0"
},
"devDependencies": {
"eslint": "^7.5.0"
"eslint": "^7.27.0"
}
}
2 changes: 1 addition & 1 deletion eslint/babel-eslint-plugin-development/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
},
"homepage": "https://babel.dev/",
"devDependencies": {
"eslint": "^7.5.0"
"eslint": "^7.27.0"
}
}
2 changes: 1 addition & 1 deletion eslint/babel-eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@
},
"devDependencies": {
"clone-deep": "^4.0.1",
"eslint": "^7.5.0"
"eslint": "^7.27.0"
}
}
3 changes: 2 additions & 1 deletion eslint/babel-eslint-shared-fixtures/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"private": true,
"dependencies": {
"@babel/core": "workspace:^7.12.13",
"@babel/eslint-parser": "workspace:*",
"@babel/plugin-proposal-class-properties": "workspace:^7.12.13",
"@babel/plugin-proposal-decorators": "workspace:^7.12.13",
"@babel/plugin-proposal-do-expressions": "workspace:^7.12.13",
Expand All @@ -14,6 +15,6 @@
"@babel/preset-env": "workspace:^7.12.13",
"@babel/preset-flow": "workspace:^7.12.13",
"@babel/preset-react": "workspace:^7.12.13",
"eslint": "^7.5.0"
"eslint": "^7.27.0"
}
}
7 changes: 2 additions & 5 deletions eslint/babel-eslint-shared-fixtures/utils/RuleTester.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
const path = require("path");
const { RuleTester } = require("eslint");

RuleTester.setDefaultConfig({
parser: require.resolve("../../babel-eslint-parser"),
parser: require.resolve("@babel/eslint-parser"),
parserOptions: {
sourceType: "module",
ecmaVersion: 11,
babelOptions: {
configFile: require.resolve(
path.join(__dirname, "../config/babel.config.js")
),
configFile: require.resolve("../config/babel.config.js"),
},
},
});
Expand Down
4 changes: 2 additions & 2 deletions eslint/babel-eslint-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"@babel/eslint-parser": "workspace:^7.14.4",
"@babel/preset-react": "workspace:^7.13.13",
"dedent": "^0.7.0",
"eslint": "^7.5.0",
"eslint-plugin-import": "^2.22.0",
"eslint": "^7.27.0",
"eslint-plugin-import": "^2.23.4",
"npm-babel-parser": "npm:@babel/parser@^7.14.0"
}
}
190 changes: 70 additions & 120 deletions eslint/babel-eslint-tests/test/integration/eslint/rules/strict.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ const baseEslintOpts = {
* @param object opts
* @param function done
*/
function lint(opts, done) {
readFixture(opts.fixture, (err, src) => {
if (err) return done(err);
done(null, eslint.linter.verify(src, opts.eslint));
function lint(opts) {
return new Promise((resolve, reject) => {
readFixture(opts.fixture, (err, src) => {
if (err) return reject(err);
resolve(eslint.linter.verify(src, opts.eslint));
});
});
}

Expand Down Expand Up @@ -66,18 +68,14 @@ function strictSuite() {
eslintOpts.rules[ruleId] = [errorLevel, "never"];

["global-with", "function-with"].forEach(fixture => {
it(`should error on ${fixture.match(/^[^-]+/)[0]} directive`, done => {
lint(
{
fixture: ["strict", fixture],
eslint: eslintOpts,
},
(err, report) => {
if (err) return done(err);
expect(report[0].ruleId).toBe(ruleId);
done();
},
);
it(`should error on ${
fixture.match(/^[^-]+/)[0]
} directive`, async () => {
const report = await lint({
fixture: ["strict", fixture],
eslint: eslintOpts,
});
expect(report[0].ruleId).toBe(ruleId);
});
});
});
Expand All @@ -88,65 +86,41 @@ function strictSuite() {
});
eslintOpts.rules[ruleId] = [errorLevel, "global"];

it("shouldn't error on single global directive", done => {
lint(
{
fixture: ["strict", "global-with"],
eslint: eslintOpts,
},
(err, report) => {
if (err) return done(err);
expect(report.length).toBe(0);
done();
},
);
it("shouldn't error on single global directive", async () => {
const report = await lint({
fixture: ["strict", "global-with"],
eslint: eslintOpts,
});
expect(report.length).toBe(0);
});

it("should error twice on global directive: no and function directive: yes", done => {
lint(
{
fixture: ["strict", "function-with"],
eslint: eslintOpts,
},
(err, report) => {
if (err) return done(err);
expect(report[0].ruleId).toBe(ruleId);
done();
},
);
it("should error twice on global directive: no and function directive: yes", async () => {
const report = await lint({
fixture: ["strict", "function-with"],
eslint: eslintOpts,
});
expect(report[0].ruleId).toBe(ruleId);
});

it("should error on function directive", done => {
lint(
{
fixture: ["strict", "global-with-function-with"],
eslint: eslintOpts,
},
(err, report) => {
if (err) return done(err);
expect(report[0].ruleId).toBe(ruleId);
// This is to make sure the test fails prior to adapting Babel AST
// directive representation to ESLint format. Otherwise it reports an
// error for missing global directive that masquerades as the expected
// result of the previous assertion.
expect(report[0].nodeType).not.toBe("Program");
done();
},
);
it("should error on function directive", async () => {
const report = await lint({
fixture: ["strict", "global-with-function-with"],
eslint: eslintOpts,
});
expect(report[0].ruleId).toBe(ruleId);
// This is to make sure the test fails prior to adapting Babel AST
// directive representation to ESLint format. Otherwise it reports an
// error for missing global directive that masquerades as the expected
// result of the previous assertion.
expect(report[0].nodeType).not.toBe("Program");
});

it("should error on no directive", done => {
lint(
{
fixture: ["strict", "none"],
eslint: eslintOpts,
},
(err, report) => {
if (err) return done(err);
expect(report[0].ruleId).toBe(ruleId);
done();
},
);
it("should error on no directive", async () => {
const report = await lint({
fixture: ["strict", "none"],
eslint: eslintOpts,
});
expect(report[0].ruleId).toBe(ruleId);
});
});

Expand All @@ -156,63 +130,39 @@ function strictSuite() {
});
eslintOpts.rules[ruleId] = [errorLevel, "function"];

it("shouldn't error on single function directive", done => {
lint(
{
fixture: ["strict", "function-with"],
eslint: eslintOpts,
},
(err, report) => {
if (err) return done(err);
expect(report.length).toBe(0);
done();
},
);
it("shouldn't error on single function directive", async () => {
const report = await lint({
fixture: ["strict", "none"],
eslint: eslintOpts,
});
expect(report.length).toBe(0);
});

it("should error twice on function directive: no and global directive: yes", done => {
lint(
{
fixture: ["strict", "global-with-function-without"],
eslint: eslintOpts,
},
(err, report) => {
if (err) return done(err);
[0, 1].forEach(i => {
expect(report[i].ruleId).toBe(ruleId);
});
done();
},
);
it("should error twice on function directive: no and global directive: yes", async () => {
const report = await lint({
fixture: ["strict", "global-with-function-without"],
eslint: eslintOpts,
});
[0, 1].forEach(i => {
expect(report[i].ruleId).toBe(ruleId);
});
});

it("should error on only global directive", done => {
lint(
{
fixture: ["strict", "global-with"],
eslint: eslintOpts,
},
(err, report) => {
if (err) return done(err);
expect(report[0].ruleId).toBe(ruleId);
done();
},
);
it("should error on only global directive", async () => {
const report = await lint({
fixture: ["strict", "global-with"],
eslint: eslintOpts,
});
expect(report[0].ruleId).toBe(ruleId);
});

it("should error on extraneous global directive", done => {
lint(
{
fixture: ["strict", "global-with-function-with"],
eslint: eslintOpts,
},
(err, report) => {
if (err) return done(err);
expect(report[0].ruleId).toBe(ruleId);
expect(report[0].nodeType.indexOf("Function")).toBe(-1);
done();
},
);
it("should error on extraneous global directive", async () => {
const report = await lint({
fixture: ["strict", "global-with-function-with"],
eslint: eslintOpts,
});
expect(report[0].ruleId).toBe(ruleId);
expect(report[0].nodeType.indexOf("Function")).toBe(-1);
});
});
}
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
"babel-plugin-transform-charcodes": "^0.2.0",
"chalk": "^2.4.2",
"charcodes": "^0.2.0",
"eslint": "^7.5.0",
"eslint-import-resolver-node": "^0.3.3",
"eslint-plugin-flowtype": "^4.6.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jest": "^23.8.2",
"eslint-plugin-prettier": "^3.1.2",
"eslint": "^7.27.0",
"eslint-import-resolver-node": "^0.3.4",
"eslint-plugin-flowtype": "^5.7.2",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-jest": "^24.3.6",
"eslint-plugin-prettier": "^3.4.0",
"fancy-log": "^1.3.3",
"flow-bin": "^0.123.0",
"gulp": "^4.0.2",
Expand Down Expand Up @@ -80,8 +80,8 @@
],
"resolutions": {
"browserslist": "npm:4.16.6",
"caniuse-lite": "npm:1.0.30001230",
"electron-to-chromium": "npm:1.3.738",
"caniuse-lite": "npm:1.0.30001235",
"electron-to-chromium": "npm:1.3.749",
"glob-watcher/chokidar": "npm:^3.4.0",
"@types/babel__core": "link:./nope",
"@types/babel__traverse": "link:./nope",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-cli/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ fs.readdirSync(fixtureLoc).forEach(function (binName) {
// copy .babelignore file to tmp directory
opts.inFiles[".babelignore"] = helper.readFile(babelIgnoreLoc);
}

// eslint-disable-next-line jest/valid-title
it(testName, buildTest(binName, testName, opts), 20000);
});
});
Expand Down
8 changes: 5 additions & 3 deletions packages/babel-compat-data/data/plugins.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"proposal-class-static-block": {
"chrome": "91"
"chrome": "91",
"electron": "13.0"
},
"proposal-private-property-in-object": {
"chrome": "91",
"firefox": "90"
"firefox": "90",
"electron": "13.0"
},
"proposal-class-properties": {
"chrome": "74",
Expand All @@ -21,7 +23,7 @@
"opera": "70",
"edge": "84",
"firefox": "90",
"safari": "tp",
"safari": "15",
"node": "14.6",
"electron": "10.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/babel-compat-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
],
"devDependencies": {
"@mdn/browser-compat-data": "^3.3.4",
"core-js-compat": "^3.9.0",
"electron-to-chromium": "^1.3.738"
"core-js-compat": "^3.14.0",
"electron-to-chromium": "^1.3.749"
},
"engines": {
"node": ">=6.9.0"
Expand Down

0 comments on commit 91d28f9

Please sign in to comment.