Skip to content

Commit 5cdfa99

Browse files
Chore: enable no-unneeded-ternary on ESLint codebase (#7987)
1 parent fbd7c13 commit 5cdfa99

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/rules/func-name-matching.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ module.exports = {
155155
return;
156156
}
157157

158-
const isProp = node.left.type === "MemberExpression" ? true : false;
158+
const isProp = node.left.type === "MemberExpression";
159159
const name = isProp ? astUtils.getStaticPropertyName(node.left) : node.left.name;
160160

161161
if (node.right.id && isIdentifier(name) && shouldWarn(name, node.right.id.name)) {

packages/eslint-config-eslint/default.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ rules:
8484
no-undefined: "error"
8585
no-underscore-dangle: ["error", {allowAfterThis: true}]
8686
no-unmodified-loop-condition: "error"
87+
no-unneeded-ternary: "error"
8788
no-unused-expressions: "error"
8889
no-unused-vars: ["error", {vars: "all", args: "after-used"}]
8990
no-use-before-define: "error"

0 commit comments

Comments
 (0)