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 for eslint-plugin? #47

Closed
moshest opened this issue Aug 15, 2017 · 11 comments
Closed

Support for eslint-plugin? #47

moshest opened this issue Aug 15, 2017 · 11 comments
Labels
enhancement 👑 New feature or request

Comments

@moshest
Copy link

moshest commented Aug 15, 2017

I think this module could be use as a eslint-plugin.

Please see eslint-plugin-json for reference (this plugin linting json files).

@tclindner
Copy link
Owner

Hey @moshest - thank you for logging this request! Are you thinking that npm-package-json-lint would run as part of a user's ESLint check? What do you see as the biggest advantage of this feature?

@moshest
Copy link
Author

moshest commented Aug 16, 2017

Please check the tool Lerna. It's a library that helps users write multi-module projects like Babel, React.js and more..

Adding ESLinting support for those project could be very convenient.

@tclindner
Copy link
Owner

Hi @moshest sorry if I'm slow, but I would like to make sure I understand what you would like. 🤓

You would like:

  1. support for projects that use Lerna to generate multiple packages?
  2. support for running npm-package-json-lint via ESLint

Thank you for the interest in the project!

@moshest
Copy link
Author

moshest commented Aug 17, 2017

I'm just saying that create this library as eslint plugin could be very helpful for projects with multiple packages.

There is no need for custom support for Lerna projects. The plugin can do it automatically by es-linting every package.json file just like the plugin eslint-plugin-json linting every *.json file.

@tclindner tclindner added the enhancement 👑 New feature or request label Aug 18, 2017
@tclindner
Copy link
Owner

Hey @moshest - a pre-release of v3.0.0 has been published to npm. The documentation is still a little sparse (that will change by the stable release). You can try it out by installing npm-package-json-lint@beta. Here is a link to the start of the migration guide. Do you think this will meet your needs for lerna projects?

Let me know what you think!

@moshest
Copy link
Author

moshest commented Apr 30, 2018

For my Lerna project i just wrote a script that lint every module. You can find it here: https://github.com/remotelib/remote-lib/blob/master/scripts/lint-package.sh

I think that the main feature here is the eslint framework support.

@ntwb
Copy link
Contributor

ntwb commented May 13, 2018

I went and took a look at the feasibility of converting the rules here into ESLInt rules and I don't believe this is possible primarily because ESLint does not include a JSON parser and has no plan of doing so.

Also eslint-plugin-json is not extensible with any rules or configs, it only checks that JSON files are valid, that is it.

@moshest
Copy link
Author

moshest commented May 13, 2018

Just to clarify, we looking for a JSON parser that can return a line and a column map for every property on the JSON file. Right?

@tclindner
Copy link
Owner

Thank you so much for digging in to this, @ntwb! @moshest yeah, that would be great. I haven't found an active project to parse JSON files to AST. Are you aware of anything?

@tclindner
Copy link
Owner

Hey @moshest and @ntwb - have you two found a good option for parsing JSON files to AST? I haven't had much luck finding anything.

@tclindner
Copy link
Owner

Closing based on discussion with @ntwb. Relates to #81.
#81 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 👑 New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants