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: strictly define Node API in plugin template #134

Merged
merged 1 commit into from Jul 14, 2022
Merged

Conversation

bmish
Copy link
Sponsor Member

@bmish bmish commented Jul 13, 2022

This follows the lead of ESLint core and other ESLint plugins in strictly defining their Node API so that users cannot reach in and import/depend on arbitrary files inside the plugin.

  • https://eslint.org/docs/latest/user-guide/migrating-to-8.0.0#remove-lib

    Beginning in v8.0.0, ESLint is strictly defining its public API. Previously, you could reach into individual files such as require("eslint/lib/rules/semi") and this is no longer allowed. There are a limited number of existing APIs that are now available through the /use-at-your-own-risk entrypoint for backwards compatibility, but these APIs are not formally supported and may break or disappear at any point in time.

https://nodejs.org/api/packages.html#main-entry-point-export

@nzakas
Copy link
Member

nzakas commented Jul 14, 2022

This is technically a breaking change so holding off on merging until we are sure we want to do a major release.

@bmish
Copy link
Sponsor Member Author

bmish commented Jul 14, 2022

@nzakas if we are considering breaking changes in the plugin template to be breaking changes for generator-eslint, then isn't #136 also a breaking change? I was unsure if plugin template changes should rise to the level of breaking changes.

@nzakas
Copy link
Member

nzakas commented Jul 14, 2022

That's a good point. When I reviewed this last night I think I missed that it was the template package.json rather than the package package.json. So I think you're right, this shouldn't be a breaking change.

@nzakas nzakas removed the breaking label Jul 14, 2022
@nzakas nzakas merged commit b6a3591 into main Jul 14, 2022
@nzakas nzakas deleted the strict-node-api branch July 14, 2022 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants