Enable more eslint recommended rules (#11168)
* chore: enable no-constant-condition * chore: enable no-empty rule * chore: enable no-unreachable * chore: enable no-cond-assign * chore: enable no-inner-declarations * chore: remove disabled rules that are not in eslint:recommended * fix: oops
This commit is contained in:
@@ -20,10 +20,9 @@ export function shareCommentsWithSiblings() {
|
||||
const next = this.getSibling(this.key + 1);
|
||||
const hasPrev = Boolean(prev.node);
|
||||
const hasNext = Boolean(next.node);
|
||||
if (hasPrev && hasNext) {
|
||||
} else if (hasPrev) {
|
||||
if (hasPrev && !hasNext) {
|
||||
prev.addComments("trailing", trailing);
|
||||
} else if (hasNext) {
|
||||
} else if (hasNext && !hasPrev) {
|
||||
next.addComments("leading", leading);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,6 +62,7 @@ export default class Renamer {
|
||||
|
||||
// retain the `name` of a class/function declaration
|
||||
|
||||
// eslint-disable-next-line no-unreachable
|
||||
if (!path.isFunctionDeclaration() && !path.isClassDeclaration()) return;
|
||||
if (this.binding.kind !== "hoisted") return;
|
||||
|
||||
@@ -83,6 +84,7 @@ export default class Renamer {
|
||||
|
||||
// retain the `name` of a class/function expression
|
||||
|
||||
// eslint-disable-next-line no-unreachable
|
||||
if (!path.isFunctionExpression() && !path.isClassExpression()) return;
|
||||
if (this.binding.kind !== "local") return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user