Visitar URL original
chore: bump eslint and its plugins (#13412) · babel/babel@4eda1c8 · GitHub
Skip to content

Commit 4eda1c8

Browse files
authored
chore: bump eslint and its plugins (#13412)
1 parent 8720919 commit 4eda1c8

27 files changed

Lines changed: 905 additions & 723 deletions

File tree

‎eslint/babel-eslint-parser/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@
3030
"eslint": ">=7.5.0"
3131
},
3232
"dependencies": {
33-
"eslint-scope": "^5.1.0",
33+
"eslint-scope": "^5.1.1",
3434
"eslint-visitor-keys": "^2.1.0",
3535
"semver": "condition:BABEL_8_BREAKING ? ^7.3.4 : ^6.3.0"
3636
},
3737
"devDependencies": {
3838
"@babel/core": "workspace:*",
3939
"dedent": "^0.7.0",
40-
"eslint": "^7.5.0"
40+
"eslint": "^7.27.0"
4141
}
4242
}

‎eslint/babel-eslint-plugin-development-internal/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
"eslint": ">=7.5.0"
2121
},
2222
"devDependencies": {
23-
"eslint": "^7.5.0"
23+
"eslint": "^7.27.0"
2424
}
2525
}

‎eslint/babel-eslint-plugin-development/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@
3131
},
3232
"homepage": "https://babel.dev/",
3333
"devDependencies": {
34-
"eslint": "^7.5.0"
34+
"eslint": "^7.27.0"
3535
}
3636
}

‎eslint/babel-eslint-plugin/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@
4141
},
4242
"devDependencies": {
4343
"clone-deep": "^4.0.1",
44-
"eslint": "^7.5.0"
44+
"eslint": "^7.27.0"
4545
}
4646
}

‎eslint/babel-eslint-shared-fixtures/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
"@babel/preset-env": "workspace:^7.12.13",
1616
"@babel/preset-flow": "workspace:^7.12.13",
1717
"@babel/preset-react": "workspace:^7.12.13",
18-
"eslint": "^7.5.0"
18+
"eslint": "^7.27.0"
1919
}
2020
}

‎eslint/babel-eslint-tests/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"@babel/eslint-parser": "workspace:^7.14.4",
99
"@babel/preset-react": "workspace:^7.13.13",
1010
"dedent": "^0.7.0",
11-
"eslint": "^7.5.0",
12-
"eslint-plugin-import": "^2.22.0",
11+
"eslint": "^7.27.0",
12+
"eslint-plugin-import": "^2.23.4",
1313
"npm-babel-parser": "npm:@babel/parser@^7.14.0"
1414
}
1515
}

‎eslint/babel-eslint-tests/test/integration/eslint/rules/strict.js‎

Lines changed: 70 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ const baseEslintOpts = {
3333
* @param object opts
3434
* @param function done
3535
*/
36-
function lint(opts, done) {
37-
readFixture(opts.fixture, (err, src) => {
38-
if (err) return done(err);
39-
done(null, eslint.linter.verify(src, opts.eslint));
36+
function lint(opts) {
37+
return new Promise((resolve, reject) => {
38+
readFixture(opts.fixture, (err, src) => {
39+
if (err) return reject(err);
40+
resolve(eslint.linter.verify(src, opts.eslint));
41+
});
4042
});
4143
}
4244

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

6870
["global-with", "function-with"].forEach(fixture => {
69-
it(`should error on ${fixture.match(/^[^-]+/)[0]} directive`, done => {
70-
lint(
71-
{
72-
fixture: ["strict", fixture],
73-
eslint: eslintOpts,
74-
},
75-
(err, report) => {
76-
if (err) return done(err);
77-
expect(report[0].ruleId).toBe(ruleId);
78-
done();
79-
},
80-
);
71+
it(`should error on ${
72+
fixture.match(/^[^-]+/)[0]
73+
} directive`, async () => {
74+
const report = await lint({
75+
fixture: ["strict", fixture],
76+
eslint: eslintOpts,
77+
});
78+
expect(report[0].ruleId).toBe(ruleId);
8179
});
8280
});
8381
});
@@ -88,65 +86,41 @@ function strictSuite() {
8886
});
8987
eslintOpts.rules[ruleId] = [errorLevel, "global"];
9088

91-
it("shouldn't error on single global directive", done => {
92-
lint(
93-
{
94-
fixture: ["strict", "global-with"],
95-
eslint: eslintOpts,
96-
},
97-
(err, report) => {
98-
if (err) return done(err);
99-
expect(report.length).toBe(0);
100-
done();
101-
},
102-
);
89+
it("shouldn't error on single global directive", async () => {
90+
const report = await lint({
91+
fixture: ["strict", "global-with"],
92+
eslint: eslintOpts,
93+
});
94+
expect(report.length).toBe(0);
10395
});
10496

105-
it("should error twice on global directive: no and function directive: yes", done => {
106-
lint(
107-
{
108-
fixture: ["strict", "function-with"],
109-
eslint: eslintOpts,
110-
},
111-
(err, report) => {
112-
if (err) return done(err);
113-
expect(report[0].ruleId).toBe(ruleId);
114-
done();
115-
},
116-
);
97+
it("should error twice on global directive: no and function directive: yes", async () => {
98+
const report = await lint({
99+
fixture: ["strict", "function-with"],
100+
eslint: eslintOpts,
101+
});
102+
expect(report[0].ruleId).toBe(ruleId);
117103
});
118104

119-
it("should error on function directive", done => {
120-
lint(
121-
{
122-
fixture: ["strict", "global-with-function-with"],
123-
eslint: eslintOpts,
124-
},
125-
(err, report) => {
126-
if (err) return done(err);
127-
expect(report[0].ruleId).toBe(ruleId);
128-
// This is to make sure the test fails prior to adapting Babel AST
129-
// directive representation to ESLint format. Otherwise it reports an
130-
// error for missing global directive that masquerades as the expected
131-
// result of the previous assertion.
132-
expect(report[0].nodeType).not.toBe("Program");
133-
done();
134-
},
135-
);
105+
it("should error on function directive", async () => {
106+
const report = await lint({
107+
fixture: ["strict", "global-with-function-with"],
108+
eslint: eslintOpts,
109+
});
110+
expect(report[0].ruleId).toBe(ruleId);
111+
// This is to make sure the test fails prior to adapting Babel AST
112+
// directive representation to ESLint format. Otherwise it reports an
113+
// error for missing global directive that masquerades as the expected
114+
// result of the previous assertion.
115+
expect(report[0].nodeType).not.toBe("Program");
136116
});
137117

138-
it("should error on no directive", done => {
139-
lint(
140-
{
141-
fixture: ["strict", "none"],
142-
eslint: eslintOpts,
143-
},
144-
(err, report) => {
145-
if (err) return done(err);
146-
expect(report[0].ruleId).toBe(ruleId);
147-
done();
148-
},
149-
);
118+
it("should error on no directive", async () => {
119+
const report = await lint({
120+
fixture: ["strict", "none"],
121+
eslint: eslintOpts,
122+
});
123+
expect(report[0].ruleId).toBe(ruleId);
150124
});
151125
});
152126

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

159-
it("shouldn't error on single function directive", done => {
160-
lint(
161-
{
162-
fixture: ["strict", "function-with"],
163-
eslint: eslintOpts,
164-
},
165-
(err, report) => {
166-
if (err) return done(err);
167-
expect(report.length).toBe(0);
168-
done();
169-
},
170-
);
133+
it("shouldn't error on single function directive", async () => {
134+
const report = await lint({
135+
fixture: ["strict", "none"],
136+
eslint: eslintOpts,
137+
});
138+
expect(report.length).toBe(0);
171139
});
172140

173-
it("should error twice on function directive: no and global directive: yes", done => {
174-
lint(
175-
{
176-
fixture: ["strict", "global-with-function-without"],
177-
eslint: eslintOpts,
178-
},
179-
(err, report) => {
180-
if (err) return done(err);
181-
[0, 1].forEach(i => {
182-
expect(report[i].ruleId).toBe(ruleId);
183-
});
184-
done();
185-
},
186-
);
141+
it("should error twice on function directive: no and global directive: yes", async () => {
142+
const report = await lint({
143+
fixture: ["strict", "global-with-function-without"],
144+
eslint: eslintOpts,
145+
});
146+
[0, 1].forEach(i => {
147+
expect(report[i].ruleId).toBe(ruleId);
148+
});
187149
});
188150

189-
it("should error on only global directive", done => {
190-
lint(
191-
{
192-
fixture: ["strict", "global-with"],
193-
eslint: eslintOpts,
194-
},
195-
(err, report) => {
196-
if (err) return done(err);
197-
expect(report[0].ruleId).toBe(ruleId);
198-
done();
199-
},
200-
);
151+
it("should error on only global directive", async () => {
152+
const report = await lint({
153+
fixture: ["strict", "global-with"],
154+
eslint: eslintOpts,
155+
});
156+
expect(report[0].ruleId).toBe(ruleId);
201157
});
202158

203-
it("should error on extraneous global directive", done => {
204-
lint(
205-
{
206-
fixture: ["strict", "global-with-function-with"],
207-
eslint: eslintOpts,
208-
},
209-
(err, report) => {
210-
if (err) return done(err);
211-
expect(report[0].ruleId).toBe(ruleId);
212-
expect(report[0].nodeType.indexOf("Function")).toBe(-1);
213-
done();
214-
},
215-
);
159+
it("should error on extraneous global directive", async () => {
160+
const report = await lint({
161+
fixture: ["strict", "global-with-function-with"],
162+
eslint: eslintOpts,
163+
});
164+
expect(report[0].ruleId).toBe(ruleId);
165+
expect(report[0].nodeType.indexOf("Function")).toBe(-1);
216166
});
217167
});
218168
}

‎package.json‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@
4343
"babel-plugin-transform-charcodes": "^0.2.0",
4444
"chalk": "^2.4.2",
4545
"charcodes": "^0.2.0",
46-
"eslint": "^7.5.0",
47-
"eslint-import-resolver-node": "^0.3.3",
48-
"eslint-plugin-flowtype": "^4.6.0",
49-
"eslint-plugin-import": "^2.22.0",
50-
"eslint-plugin-jest": "^23.8.2",
51-
"eslint-plugin-prettier": "^3.1.2",
46+
"eslint": "^7.27.0",
47+
"eslint-import-resolver-node": "^0.3.4",
48+
"eslint-plugin-flowtype": "^5.7.2",
49+
"eslint-plugin-import": "^2.23.4",
50+
"eslint-plugin-jest": "^24.3.6",
51+
"eslint-plugin-prettier": "^3.4.0",
5252
"fancy-log": "^1.3.3",
5353
"flow-bin": "^0.123.0",
5454
"gulp": "^4.0.2",

‎packages/babel-cli/test/index.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ fs.readdirSync(fixtureLoc).forEach(function (binName) {
273273
// copy .babelignore file to tmp directory
274274
opts.inFiles[".babelignore"] = helper.readFile(babelIgnoreLoc);
275275
}
276-
276+
// eslint-disable-next-line jest/valid-title
277277
it(testName, buildTest(binName, testName, opts), 20000);
278278
});
279279
});

0 commit comments

Comments
 (0)