chore: Enable eqeqeq rule in eslint (#9541)

This commit is contained in:
Daniel Tschinder 2019-02-18 21:16:42 -08:00 committed by GitHub
parent a1ea765b95
commit b78fdc0cb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View File

@ -32,7 +32,8 @@
"files": ["packages/babel-plugin-*/src/index.js"], "files": ["packages/babel-plugin-*/src/index.js"],
"excludedFiles": ["packages/babel-plugin-transform-regenerator/**/*.js"], "excludedFiles": ["packages/babel-plugin-transform-regenerator/**/*.js"],
"rules": { "rules": {
"@babel/development/plugin-name": "error" "@babel/development/plugin-name": "error",
"eqeqeq": ["error", "always", { "null": "ignore" }]
} }
} }
] ]

View File

@ -31,8 +31,8 @@ export default declare((api, opts) => {
Expression(path) { Expression(path) {
const parentType = path.parent.type; const parentType = path.parent.type;
if ( if (
(parentType == "AssignmentPattern" && path.key === "right") || (parentType === "AssignmentPattern" && path.key === "right") ||
(parentType == "ObjectProperty" && (parentType === "ObjectProperty" &&
path.parent.computed && path.parent.computed &&
path.key === "key") path.key === "key")
) { ) {

View File

@ -199,7 +199,7 @@ export default declare((api, options) => {
ReferencedIdentifier(path, state) { ReferencedIdentifier(path, state) {
if ( if (
path.node.name == "__moduleName" && path.node.name === "__moduleName" &&
!path.scope.hasBinding("__moduleName") !path.scope.hasBinding("__moduleName")
) { ) {
path.replaceWith( path.replaceWith(