Skip to content

Commit a84ec28

Browse files
authored
Enable eqeqeq rule (#16404)
* eqeqeq * review * review
1 parent f7a7715 commit a84ec28

File tree

20 files changed

+31
-25
lines changed

20 files changed

+31
-25
lines changed

Gulpfile.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ async function buildBabel(useWorker, ignore = []) {
288288
return Promise.allSettled(promises)
289289
.then(results => {
290290
results.forEach(result => {
291-
if (result.status == "rejected") {
291+
if (result.status === "rejected") {
292292
if (process.env.WATCH_SKIP_BUILD) {
293293
console.error(result.reason);
294294
} else {

Makefile.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile.source.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function exec(executable, args, cwd, inheritStdio = true) {
5454
env: process.env,
5555
});
5656
} catch (error) {
57-
if (inheritStdio && error.status != 0) {
57+
if (inheritStdio && error.status !== 0) {
5858
console.error(
5959
new Error(
6060
`\ncommand: ${executable} ${args.join(" ")}\ncode: ${error.status}`
@@ -180,7 +180,7 @@ target["bootstrap"] = function () {
180180
target["build"] = function () {
181181
target["build-no-bundle"]();
182182

183-
if (process.env.BABEL_COVERAGE != "true") {
183+
if (process.env.BABEL_COVERAGE !== "true") {
184184
target["build-standalone"]();
185185
}
186186
};

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ function pluginGeneratorOptimization({ types: t }) {
10361036
t.isStringLiteral(args[0])
10371037
) {
10381038
const str = args[0].value;
1039-
if (str.length == 1) {
1039+
if (str.length === 1) {
10401040
node.callee.property.name = "tokenChar";
10411041
args[0] = t.numericLiteral(str.charCodeAt(0));
10421042
}

eslint/babel-eslint-config-internal/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ module.exports = [
2828
},
2929
rules: {
3030
curly: ["error", "multi-line"],
31+
eqeqeq: ["error", "smart"],
3132
"linebreak-style": ["error", "unix"],
3233
"no-case-declarations": "error",
3334
"no-confusing-arrow": "error",

packages/babel-cli/src/babel/dir.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default async function ({
5353
let outputMap: "both" | "external" | false = false;
5454
if (babelOptions.sourceMaps && babelOptions.sourceMaps !== "inline") {
5555
outputMap = "external";
56-
} else if (babelOptions.sourceMaps == undefined) {
56+
} else if (babelOptions.sourceMaps == null) {
5757
outputMap = util.hasDataSourcemap(res.code) ? "external" : "both";
5858
}
5959

packages/babel-cli/src/babel/file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export default async function ({
100100
let outputMap: "both" | "external" | false = false;
101101
if (babelOptions.sourceMaps && babelOptions.sourceMaps !== "inline") {
102102
outputMap = "external";
103-
} else if (babelOptions.sourceMaps == undefined && result.hasRawMap) {
103+
} else if (babelOptions.sourceMaps == null && result.hasRawMap) {
104104
outputMap = util.hasDataSourcemap(result.code) ? "external" : "both";
105105
}
106106

packages/babel-cli/src/babel/options.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,10 +362,12 @@ function booleanify(val: "true" | 1): true;
362362
function booleanify(val: any): any {
363363
if (val === undefined) return undefined;
364364

365+
// eslint-disable-next-line eqeqeq
365366
if (val === "true" || val == 1) {
366367
return true;
367368
}
368369

370+
// eslint-disable-next-line eqeqeq
369371
if (val === "false" || val == 0 || !val) {
370372
return false;
371373
}

packages/babel-cli/src/babel/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export function addSourceMappingUrl(code: string, loc: string): string {
6161

6262
export function hasDataSourcemap(code: string): boolean {
6363
const pos = code.lastIndexOf("\n", code.length - 2);
64-
return pos != -1 && code.lastIndexOf("//# sourceMappingURL") < pos;
64+
return pos !== -1 && code.lastIndexOf("//# sourceMappingURL") < pos;
6565
}
6666

6767
const CALLER = {

packages/babel-generator/src/printer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ class Printer {
661661
this._printStack.push(node);
662662

663663
const oldInAux = this._insideAux;
664-
this._insideAux = node.loc == undefined;
664+
this._insideAux = node.loc == null;
665665
this._maybeAddAuxComment(this._insideAux && !oldInAux);
666666

667667
const parenthesized = node.extra?.parenthesized as boolean | undefined;
@@ -1128,7 +1128,7 @@ class Printer {
11281128
if (
11291129
this._buf.hasContent() &&
11301130
(comment.type === "CommentLine" ||
1131-
commentStartLine != commentEndLine)
1131+
commentStartLine !== commentEndLine)
11321132
) {
11331133
offset = leadingCommentNewline = 1;
11341134
}

0 commit comments

Comments
 (0)