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

Support flat config #19

Merged
merged 1 commit into from
Apr 16, 2024
Merged

Conversation

haines
Copy link
Contributor

@haines haines commented Apr 9, 2024

Closes #18

This PR adds a meta field to the plugin, and provides type definitions, to make the plugin easy to consume in ESLint's new flat configuration format.

@haines haines marked this pull request as draft April 9, 2024 10:30
Signed-off-by: Andrew Haines <andrew@haines.org.nz>
@haines haines marked this pull request as ready for review April 9, 2024 10:41
"files": [
"./dist/**"
],
"scripts": {
"build": "tsup src/index.ts --no-splitting --minify",
"build": "tsup src/index.ts --cjsInterop --dts --splitting --minify",
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 needed to enable --cjsInterop and change the export from module.exports = to export default to get the dts file not to be empty. Unfortunately there is a bug which means that this also requires --splitting.

@younesaassila
Copy link
Owner

Thank you so much for your contribution! As I understand this would require a major version bump for the plugin, correct? (Since there's no backwards compatibility for export default in eslint <9 it seems like)

@younesaassila
Copy link
Owner

Oh well actually thanks to the cjsInterop there's no need for a major version bump. Older versions of ESLint are compatible with this change.

Merging!

@younesaassila younesaassila merged commit fa77b1c into younesaassila:main Apr 16, 2024
1 check passed
@haines haines deleted the flat-config branch April 16, 2024 15:14
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.

Support ESLint's new flat configuration format
2 participants