Thanks to visit codestin.com
Credit goes to github.com

Skip to content

yarn.config.cjs support#864

Merged
webpro merged 7 commits into
webpro-nl:mainfrom
jwoo0122:yarn-config-cjs-support
Dec 2, 2024
Merged

yarn.config.cjs support#864
webpro merged 7 commits into
webpro-nl:mainfrom
jwoo0122:yarn-config-cjs-support

Conversation

@jwoo0122
Copy link
Copy Markdown
Contributor

Close #597

@jwoo0122 jwoo0122 changed the title Yarn config cjs support yarn.config.cjs support Nov 30, 2024
cwd,
});

assert(issues.files.size === 0);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just saying, baseCounters contains files: 0 which is essentially the same assertion (no need to change though).

Comment thread packages/knip/src/plugins/yarn/index.ts Outdated

// https://yarnpkg.com/features/constraints

const title = 'yarn';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only nitpick I have is that Yarn seems to be the official spelling (title cased).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed on 40bc99b

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Dec 2, 2024

Open in Stackblitz

npm i https://pkg.pr.new/knip@864

commit: 0b8a898

Comment thread packages/knip/src/plugins/yarn/index.ts Outdated

const enablers = 'This plugin is enabled when a `yarn.lock` file is found in the root folder.';

const isEnabled: IsPluginEnabled = async ({ cwd }) => (await _glob({ cwd, patterns: ['yarn.lock'] })).length > 0;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's _firstGlob for this, any chance we could use that? Example: https://github.com/webpro-nl/knip/blob/main/packages/knip/src/plugins/github-actions/index.ts#L13-L14 (probably should move into a nice helper but we could consider this in another PR)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! I've changed it 0b8a898

@webpro webpro merged commit 759503d into webpro-nl:main Dec 2, 2024
@webpro
Copy link
Copy Markdown
Member

webpro commented Dec 2, 2024

Thanks, Jeong!

@webpro
Copy link
Copy Markdown
Member

webpro commented Dec 2, 2024

🚀 This pull request is included in v5.39.0. See Release 5.39.0 for release notes.

Using Knip in a commercial project? Please consider becoming a sponsor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detect yarn.config.cjs

2 participants