Skip to content

Commit

Permalink
reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
gurgunday committed Dec 11, 2023
1 parent 007eabf commit de117b0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/rules/prefer-property-access-at.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@ module.exports = {
(node.callee.object.type === "Identifier" ||
node.callee.object.type === "MemberExpression")
) {
const objectText = context
.getSourceCode()
.getText(node.callee.object);
const [argument] = node.arguments;

let val;

if (
argument.type === "UnaryExpression" &&
argument.argument.type === "Literal" &&
typeof argument.argument.value === "number"
) {
val = argument.argument.value;
Expand All @@ -27,9 +32,6 @@ module.exports = {
val = argument.value;
}

const objectText = context
.getSourceCode()
.getText(node.callee.object);
let replacement;

if (val !== undefined) {
Expand Down

0 comments on commit de117b0

Please sign in to comment.