Skip to content

Commit

Permalink
Lint with Prettier 3
Browse files Browse the repository at this point in the history
  • Loading branch information
cutiful committed Dec 26, 2023
1 parent f42a9ec commit ddcc5e4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions scripts/generateProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import prettier from "prettier";
const ignoreTypes = ["SourceLocation", "RegExp"];
const specPath = new URL(
"../node_modules/estree-formal/formal-data/es2022.json",
import.meta.url
import.meta.url,
);
const outputPath = new URL("../src/props.js", import.meta.url);

Expand Down Expand Up @@ -71,7 +71,7 @@ function getPropsToUse(name) {
const spec = JSON.parse(
await fs.readFile(specPath, {
encoding: "utf-8",
})
}),
);

const names = Object.keys(spec)
Expand Down
10 changes: 5 additions & 5 deletions src/traverse.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class TraversalState {
if (typeof lastSegment === "string") {
const newSegment = findNextPathSegment(
this.getElementAt(tryPath),
lastSegment
lastSegment,
);
if (newSegment) return tryPath.concat(newSegment);
} else {
Expand All @@ -114,7 +114,7 @@ class TraversalState {
const newIndex = findNextArrayIndex(
this.getElementAt(newPath),
arrayName,
lastSegment
lastSegment,
);
if (newIndex) return newPath.concat([arrayName, newIndex]);
}
Expand Down Expand Up @@ -227,7 +227,7 @@ class TraversalState {
const insertCount = this.#insertAt(
this.#path.slice(0, -1),
this.key - 1,
node
node,
);
this.#path[this.#path.length - 1] += insertCount;

Expand All @@ -243,14 +243,14 @@ class TraversalState {
const insertCount = this.#insertAt(
this.#path.slice(0, -1),
this.key + 1,
node
node,
);

if (!skipBoth) this.#nextPath = this.#findNextPath(this.#path);
else
this.#nextPath = this.#findNextPath(
this.#path.slice(0, -1).concat(this.key + insertCount),
true
true,
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/traverse.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ describe("modification", () => {
console.log(b);
}
const d = 4;
`
`,
);

expect(visitedIdentifierC).toBe(true);
Expand Down Expand Up @@ -372,7 +372,7 @@ const d = 4;
},
],
},
true
true,
);

if (node.type === "Identifier" && node.name === "c")
Expand Down Expand Up @@ -481,7 +481,7 @@ const d = 4;
],
},
],
true
true,
);

if (node.type === "Identifier" && node.name === "c")
Expand Down

0 comments on commit ddcc5e4

Please sign in to comment.