Skip to content

Commit

Permalink
refactor: addresses small linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sverweij committed Nov 21, 2024
1 parent 09e9e41 commit b78a9f8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/cli/utl/io.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ function writeToFile(pOutputTo, pDependencyString) {
*/
function writeToStdOut(pString, pBufferSize = PIPE_BUFFER_SIZE) {
const lNumberOfChunks = Math.ceil(pString.length / pBufferSize);
let lIndex = 0;

/* eslint no-plusplus: 0 */
for (lIndex = 0; lIndex < lNumberOfChunks; lIndex++) {
for (let lIndex = 0; lIndex < lNumberOfChunks; lIndex++) {
const lChunkStart = lIndex * pBufferSize;
process.stdout.write(
pString.substring(lChunkStart, lChunkStart + pBufferSize),
Expand Down
4 changes: 2 additions & 2 deletions src/extract/resolve/module-classifiers.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function isWorkspaceAliased(pModuleName, pResolvedModuleName, pManifest) {
// an object. To prevent the code from borking we check whether it's an array
// see https://github.com/sverweij/dependency-cruiser/issues/919
const lWorkspaces = getWorkspacesArray(pManifest?.workspaces);
if (lWorkspaces.length >= 0) {
if (lWorkspaces.length > 0) {
// workspaces are an array of globs that match the (sub) workspace
// folder itself only.
//
Expand Down Expand Up @@ -193,7 +193,7 @@ function isWorkspaceAliased(pModuleName, pResolvedModuleName, pManifest) {
// of the workspace, not the path of the workspace itself. So if it's
// in node_modules we need to check against the unresolved modulename.
//
// Other then the detection for when symlinks are resolved to their realpath
// Other than the detection for when symlinks are resolved to their realpath
// (the if above), this is a 'best effort' detection only for now; there's
// guaranteed to be scenarios where this will fail. How often is the
// --preserve-symlinks flag used in practice, though?
Expand Down
2 changes: 1 addition & 1 deletion src/utl/get-extension.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-check
import { extname } from "node:path";

const EXTENSION_RE = /(?<extension>(?:(?:\.d\.(?:c|m)?ts)|\.coffee\.md)$)/;
const EXTENSION_RE = /(?<extension>(?:(?:\.d\.(?:[cm])?ts)|\.coffee\.md)$)/;

/**
* Returns the extension of the given file name path.
Expand Down

0 comments on commit b78a9f8

Please sign in to comment.