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

feat(oxlint): add cwd property to LintRunner #7352

Merged
merged 5 commits into from
Nov 20, 2024

Conversation

Sysix
Copy link
Contributor

@Sysix Sysix commented Nov 19, 2024

allows to use multiple LintRunner in one file targeting multiple directory.
The current problem is for the test in #7348 we can not change env::current_dir,
so as a workaround I introduce a new property :)

See more info here: https://discord.com/channels/1079625926024900739/1117322804291964931/1308179827576016897

Copy link

graphite-app bot commented Nov 19, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@github-actions github-actions bot added A-cli Area - CLI C-enhancement Category - New feature or request labels Nov 19, 2024
@Sysix Sysix force-pushed the feat-oxlint-add-working-dir-arg branch from a99da34 to 631301a Compare November 19, 2024 00:47
@Sysix Sysix marked this pull request as ready for review November 19, 2024 00:53
@Sysix Sysix marked this pull request as draft November 19, 2024 00:58
@Sysix Sysix marked this pull request as ready for review November 19, 2024 01:09
@Boshen
Copy link
Member

Boshen commented Nov 19, 2024

This is not a eslint CLI option, https://eslint.org/docs/latest/use/command-line-interface

allows to use multiple LintRunner in multiple directory with only using one command / file.

Where and how is this going to be used? Should this be made internal without a CLI?

@Sysix
Copy link
Contributor Author

Sysix commented Nov 19, 2024

Should this be made internal without a CLI?

Maybe yes!

Where and how is this going to be used?

npx oxlint --working-dir packages/oxlint
npx oxlint --working-dir packages/vscode

instead of:

cd packages/oxlint && npx oxlint
cd ../..
cd packages/vscode && npx oxlint

and you can use two LintRunner instances with different working-dirs in one file/command.
This last feature is needed for the referenced PR :)

This is not a eslint CLI option,

I know :/ Maybe there is a better solution for my problem?

@Sysix Sysix changed the title feat(oxlint): add --working-dir argument feat(oxlint): add cwd property to LintRunner Nov 19, 2024
@Sysix
Copy link
Contributor Author

Sysix commented Nov 19, 2024

Updated the PR.

The remap of the paths is needed because else the path would be filtered out in line 100 (Walk::...).
Maybe this can get even cleaner :)

@Boshen Boshen merged commit d3a0119 into oxc-project:main Nov 20, 2024
15 checks passed
Boshen added a commit that referenced this pull request Nov 20, 2024
## [0.12.0] - 2024-11-20

- 20d9080 linter: [**BREAKING**] Override plugins array when passed in
config file (#7303) (camchenry)

### Features

- 1d9f528 linter: Implement `unicorn/prefer-string-raw` lint rule
(#7335) (Ryan Walker)
- d445e0f linter: Implement `unicorn/consistent-existence-index-check`
(#7262) (Ryan Walker)
- 01ddf37 linter: Add `allowReject` option to
`no-useless-promise-resolve-reject` (#7274) (no-yan)
- 755a31b linter: Support bind function case for compatibility with
`promise/no-return-wrap` (#7232) (no-yan)
- 428770e linter: Add `import/no-namespace` rule (#7229) (Dmitry
Zakharov)
- 9c91151 linter: Implement typescript/no-empty-object-type (#6977)
(Orenbek)
- 2268a0e linter: Support `overrides` config field (#6974) (DonIsaac)
- 3dcac1a linter: React/exhaustive-deps (#7151) (camc314)
- d3a0119 oxlint: Add `cwd` property to `LintRunner` (#7352) (Alexander
S.)

### Bug Fixes

- ba0b2ff editor: Reload workspace configuration after change (#7302)
(Alexander S.)
- bc0e72c linter: Handle user variables correctly for import/no_commonjs
(#7316) (Dmitry Zakharov)
- bf839c1 linter: False positive in `jest/expect-expect` (#7341)
(dalaoshu)
- ff2a1d4 linter: Move `exhaustive-deps` to `react` (#7251) (camc314)
- df5c535 linter: Revert unmatched rule error (#7257) (Cameron A
McHenry)
- c4ed230 linter: Fix false positive in eslint/no-cond-assign (#7241)
(camc314)
- ef847da linter: False positive in `jsx-a11y/iframe-has-title` (#7253)
(dalaoshu)
- 62b6327 linter: React/exhaustive-deps update span for unknown deps
diagnostic (#7249) (camc314)

### Documentation

- 4c124a8 editor/vscode: Update VS Code readme with installation
instructions and available features (#7306) (Nicholas Rayburn)

### Refactor

- c6a4868 linter: Temporarily remove unknown rules checking (#7260)
(camchenry)

### Testing

- 5190b7f editor: Add test setup (#7361) (Alexander S.)

Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
Boshen pushed a commit that referenced this pull request Nov 23, 2024
waiting fior #7352

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Area - CLI C-enhancement Category - New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants