Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yarn.config.cjs support #864

Merged
merged 7 commits into from
Dec 2, 2024
Merged

Conversation

jwoo0122
Copy link
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
Collaborator

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).


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

const title = 'yarn';
Copy link
Collaborator

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
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

Copy link

pkg-pr-new bot commented Dec 2, 2024

Open in Stackblitz

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

commit: 0b8a898


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
Collaborator

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
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
23 checks passed
@webpro
Copy link
Collaborator

webpro commented Dec 2, 2024

Thanks, Jeong!

@webpro
Copy link
Collaborator

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