Skip to content

Commit 44a81c6

Browse files
authored
chore: upgrade knip (#18272)
* chore: upgrade knip * chore: refactor default vs named exports/imports
1 parent 94178ad commit 44a81c6

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

lib/source-code/token-store/backward-token-cursor.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//------------------------------------------------------------------------------
1010

1111
const Cursor = require("./cursor");
12-
const utils = require("./utils");
12+
const { getLastIndex, getFirstIndex } = require("./utils");
1313

1414
//------------------------------------------------------------------------------
1515
// Exports
@@ -31,8 +31,8 @@ module.exports = class BackwardTokenCursor extends Cursor {
3131
constructor(tokens, comments, indexMap, startLoc, endLoc) {
3232
super();
3333
this.tokens = tokens;
34-
this.index = utils.getLastIndex(tokens, indexMap, endLoc);
35-
this.indexEnd = utils.getFirstIndex(tokens, indexMap, startLoc);
34+
this.index = getLastIndex(tokens, indexMap, endLoc);
35+
this.indexEnd = getFirstIndex(tokens, indexMap, startLoc);
3636
}
3737

3838
/** @inheritdoc */

lib/source-code/token-store/cursors.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,7 @@ class CursorFactory {
8686
// Exports
8787
//------------------------------------------------------------------------------
8888

89-
exports.forward = new CursorFactory(ForwardTokenCursor, ForwardTokenCommentCursor);
90-
exports.backward = new CursorFactory(BackwardTokenCursor, BackwardTokenCommentCursor);
89+
module.exports = {
90+
forward: new CursorFactory(ForwardTokenCursor, ForwardTokenCommentCursor),
91+
backward: new CursorFactory(BackwardTokenCursor, BackwardTokenCommentCursor)
92+
};

lib/source-code/token-store/forward-token-comment-cursor.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//------------------------------------------------------------------------------
1010

1111
const Cursor = require("./cursor");
12-
const utils = require("./utils");
12+
const { getFirstIndex, search } = require("./utils");
1313

1414
//------------------------------------------------------------------------------
1515
// Exports
@@ -32,8 +32,8 @@ module.exports = class ForwardTokenCommentCursor extends Cursor {
3232
super();
3333
this.tokens = tokens;
3434
this.comments = comments;
35-
this.tokenIndex = utils.getFirstIndex(tokens, indexMap, startLoc);
36-
this.commentIndex = utils.search(comments, startLoc);
35+
this.tokenIndex = getFirstIndex(tokens, indexMap, startLoc);
36+
this.commentIndex = search(comments, startLoc);
3737
this.border = endLoc;
3838
}
3939

lib/source-code/token-store/forward-token-cursor.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//------------------------------------------------------------------------------
1010

1111
const Cursor = require("./cursor");
12-
const utils = require("./utils");
12+
const { getFirstIndex, getLastIndex } = require("./utils");
1313

1414
//------------------------------------------------------------------------------
1515
// Exports
@@ -31,8 +31,8 @@ module.exports = class ForwardTokenCursor extends Cursor {
3131
constructor(tokens, comments, indexMap, startLoc, endLoc) {
3232
super();
3333
this.tokens = tokens;
34-
this.index = utils.getFirstIndex(tokens, indexMap, startLoc);
35-
this.indexEnd = utils.getLastIndex(tokens, indexMap, endLoc);
34+
this.index = getFirstIndex(tokens, indexMap, startLoc);
35+
this.indexEnd = getLastIndex(tokens, indexMap, endLoc);
3636
}
3737

3838
/** @inheritdoc */

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
"got": "^11.8.3",
136136
"gray-matter": "^4.0.3",
137137
"js-yaml": "^4.1.0",
138-
"knip": "^5.0.1",
138+
"knip": "^5.8.0",
139139
"lint-staged": "^11.0.0",
140140
"load-perf": "^0.2.0",
141141
"markdown-it": "^12.2.0",

0 commit comments

Comments
 (0)