Skip to content

Commit

Permalink
chore: upgrade knip (#18272)
Browse files Browse the repository at this point in the history
* chore: upgrade knip

* chore: refactor default vs named exports/imports
  • Loading branch information
webpro authored Apr 5, 2024
1 parent 94178ad commit 44a81c6
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
6 changes: 3 additions & 3 deletions lib/source-code/token-store/backward-token-cursor.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//------------------------------------------------------------------------------

const Cursor = require("./cursor");
const utils = require("./utils");
const { getLastIndex, getFirstIndex } = require("./utils");

//------------------------------------------------------------------------------
// Exports
Expand All @@ -31,8 +31,8 @@ module.exports = class BackwardTokenCursor extends Cursor {
constructor(tokens, comments, indexMap, startLoc, endLoc) {
super();
this.tokens = tokens;
this.index = utils.getLastIndex(tokens, indexMap, endLoc);
this.indexEnd = utils.getFirstIndex(tokens, indexMap, startLoc);
this.index = getLastIndex(tokens, indexMap, endLoc);
this.indexEnd = getFirstIndex(tokens, indexMap, startLoc);
}

/** @inheritdoc */
Expand Down
6 changes: 4 additions & 2 deletions lib/source-code/token-store/cursors.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,7 @@ class CursorFactory {
// Exports
//------------------------------------------------------------------------------

exports.forward = new CursorFactory(ForwardTokenCursor, ForwardTokenCommentCursor);
exports.backward = new CursorFactory(BackwardTokenCursor, BackwardTokenCommentCursor);
module.exports = {
forward: new CursorFactory(ForwardTokenCursor, ForwardTokenCommentCursor),
backward: new CursorFactory(BackwardTokenCursor, BackwardTokenCommentCursor)
};
6 changes: 3 additions & 3 deletions lib/source-code/token-store/forward-token-comment-cursor.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//------------------------------------------------------------------------------

const Cursor = require("./cursor");
const utils = require("./utils");
const { getFirstIndex, search } = require("./utils");

//------------------------------------------------------------------------------
// Exports
Expand All @@ -32,8 +32,8 @@ module.exports = class ForwardTokenCommentCursor extends Cursor {
super();
this.tokens = tokens;
this.comments = comments;
this.tokenIndex = utils.getFirstIndex(tokens, indexMap, startLoc);
this.commentIndex = utils.search(comments, startLoc);
this.tokenIndex = getFirstIndex(tokens, indexMap, startLoc);
this.commentIndex = search(comments, startLoc);
this.border = endLoc;
}

Expand Down
6 changes: 3 additions & 3 deletions lib/source-code/token-store/forward-token-cursor.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//------------------------------------------------------------------------------

const Cursor = require("./cursor");
const utils = require("./utils");
const { getFirstIndex, getLastIndex } = require("./utils");

//------------------------------------------------------------------------------
// Exports
Expand All @@ -31,8 +31,8 @@ module.exports = class ForwardTokenCursor extends Cursor {
constructor(tokens, comments, indexMap, startLoc, endLoc) {
super();
this.tokens = tokens;
this.index = utils.getFirstIndex(tokens, indexMap, startLoc);
this.indexEnd = utils.getLastIndex(tokens, indexMap, endLoc);
this.index = getFirstIndex(tokens, indexMap, startLoc);
this.indexEnd = getLastIndex(tokens, indexMap, endLoc);
}

/** @inheritdoc */
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"got": "^11.8.3",
"gray-matter": "^4.0.3",
"js-yaml": "^4.1.0",
"knip": "^5.0.1",
"knip": "^5.8.0",
"lint-staged": "^11.0.0",
"load-perf": "^0.2.0",
"markdown-it": "^12.2.0",
Expand Down

0 comments on commit 44a81c6

Please # to comment.