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: support legacy config #7

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

Djiit
Copy link
Contributor

@Djiit Djiit commented Jan 18, 2024

Fixes #5

Copy link
Member

@Dunqing Dunqing left a comment

Choose a reason for hiding this comment

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

Thank you for improving the documentation!!

README.md Outdated
... // other config
rules: {
... // other rules
...oxlintRules // oxlint rules should be the last ones
Copy link
Member

Choose a reason for hiding this comment

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

I think we should support passing ' plugins: [oxlint]` when the eslint version < 9.0. But I haven't looked into what needs to be done.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with you. In the meantime, doing like this works well and is not too hacky to setup, imho.

@Djiit
Copy link
Contributor Author

Djiit commented Jan 22, 2024

Using conditional exports, we should be able to do something. See: sindresorhus/eslint-plugin-unicorn#1886

@Djiit
Copy link
Contributor Author

Djiit commented Jan 22, 2024

@Dunqing alright, if figured it out. The "presets" in eslint legacy config are called "configs" in the docs... See: https://eslint.org/docs/latest/extend/plugins#configs-in-plugins

Now, the plugin can be used with one line of config in legacy configs :)

@Djiit
Copy link
Contributor Author

Djiit commented Jan 22, 2024

I noticed the repo don't have any formatter configured -- looks like my formatter (prettier) did some changes. Can be reverted on demand.

@Djiit Djiit requested a review from Dunqing January 22, 2024 20:15
@Dunqing
Copy link
Member

Dunqing commented Jan 23, 2024

@Dunqing alright, if figured it out. The "presets" in eslint legacy config are called "configs" in the docs... See: https://eslint.org/docs/latest/extend/plugins#configs-in-plugins

Now, the plugin can be used with one line of config in legacy configs :)

Thanks! That's great!

@Dunqing Dunqing changed the title doc: update README with eslint <9 instructions feat: support legacy config Jan 23, 2024
Copy link
Member

@Dunqing Dunqing left a comment

Choose a reason for hiding this comment

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

Thanks for working on this!

@Dunqing Dunqing merged commit 093f9a0 into oxc-project:main Jan 23, 2024
@Djiit Djiit deleted the update-readme-eslint8 branch January 23, 2024 08:35
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.

Not working in non-flat config usage
2 participants