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"],
"excludedFiles": ["packages/babel-plugin-transform-regenerator/**/*.js"],
"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) {
const parentType = path.parent.type;
if (
(parentType == "AssignmentPattern" && path.key === "right") ||
(parentType == "ObjectProperty" &&
(parentType === "AssignmentPattern" && path.key === "right") ||
(parentType === "ObjectProperty" &&
path.parent.computed &&
path.key === "key")
) {

View File

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