Skip to content

feat(yarn-plugin-eslint): Yarn plugin with integrated ESLint command #3577

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tido64
Copy link
Member

@tido64 tido64 commented Apr 10, 2025

Description

Introduce a Yarn plugin with integrated ESLint and opinionated defaults

Test plan

  1. Bundle the plugin:
    cd incubator/yarn-plugin-eslint
    yarn bundle
  2. Add the bundle to .yarnrc.yml:
    diff --git a/.yarnrc.yml b/.yarnrc.yml
    index 43c99c62..2cb4e6f3 100644
    --- a/.yarnrc.yml
    +++ b/.yarnrc.yml
    @@ -55,6 +55,7 @@ plugins:
       - path: .yarn/plugins/@yarnpkg/plugin-compat.cjs
         spec: "@yarnpkg/plugin-compat"
       - path: incubator/yarn-plugin-dynamic-extensions/index.js
    +  - path: incubator/yarn-plugin-eslint/lib/index.js
       - path: .yarn/plugins/@rnx-kit/yarn-plugin-external-workspaces.cjs
         spec: incubator/yarn-plugin-external-workspaces/dist/external-workspaces.cjs
    
  3. Go to any package and run: yarn rnx-lint

@tido64 tido64 marked this pull request as draft April 10, 2025 15:20
@github-actions github-actions bot added chore Improvements that don't directly affect features feature: eslint This is related to ESLint labels Apr 10, 2025
Comment on lines +8 to +13
if (importedConfigFileModificationTime.get(filePath) !== mtime) {
- delete require.cache[filePath];
+ if (require.cache) {
+ delete require.cache[filePath];
+ }
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This needs to be upstreamed.

Copy link
Contributor

@JasonVMo JasonVMo left a comment

Choose a reason for hiding this comment

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

Played around with this a bit and I'm not sure having everything built into the plugin is the right approach though we can start with this. I'll try to put together a draft package tomorrow to play with a slight alternative idea.


🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧

This is a Yarn plugin that integrates ESLint and opinionated (but overridable)
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder to add information about how it can be overridden and what the opinionated defaults are.

Base automatically changed from tido/ci/bundle to main April 11, 2025 08:50
@tido64 tido64 force-pushed the tido/yarn/plugin-eslint branch from 7948253 to ac08e1d Compare April 11, 2025 09:18
@tido64 tido64 force-pushed the tido/yarn/plugin-eslint branch from ac08e1d to 774951c Compare April 11, 2025 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Improvements that don't directly affect features feature: eslint This is related to ESLint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants