-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Docs: Give example for adding meta.name and meta.version to plugin config #18462
Comments
That sounds like a good idea. Can you submit a PR for that? |
I'm glad you agree that this would be a good idea! When I came to writing something I realized that for ESLint v9 there are no recommendations about how to generate a plugin automatically or where to place a JavaScript config file. (PR eslint/generator-eslint#179 is still open.) For ESLint v8, Yeoman is recommended and this generates a Would you want to make some sort of best practice recommendation / default location for a config file? If there is none, then I would have to say that the |
Unfortunately I now realize that I only have a solution for CommonJS, not for ESM, so I would need to leave proposing a code example to somebody with more JavaScript Node.js skills than I currently posses. Importing from JSON modules is experimental and has other restrictions. |
You can actually use the same solution in both CommonJS and ESM: just read in |
@MikeMcC399 are you going to send a PR for this? |
If I had the skills to convert what you suggested into code then I would, but I don't. So regrettably, no I can't contribute a PR to implement this suggestion. The box has to remain unticked:
|
Docs page(s)
Create Plugins > Meta Data in Plugins
What documentation issue do you want to solve?
The text says:
If plugins are released using semantic-release, where the version is not updated in the repository, and is only changed in the npm registry, it may not be obvious how to achieve the synchronization of version data between the plugin's
meta.version
property and the publishedpackage.json
'sversion
property.Also, providing an example of how to automate this step would help towards the name and version data being consistently published across all plugins, whether or not the committed package.json contains an up-to-date
version
property.What do you think is the correct solution?
In https://github.com/eslint-community/eslint-plugin-eslint-comments/blob/main/configs.js there is an example which uses:
Possibly this could be added to the example in Create Plugins > Meta Data in Plugins and published (or the equivalent code using
import
instead ofrequire
).Participation
Additional comments
I looked through the plugins which have been marked as v9 compatible on #18391 and most of them actually store their
version
in the committedpackage.json
. Examples of ones which do not are:The text was updated successfully, but these errors were encountered: