-
-
Notifications
You must be signed in to change notification settings - Fork 96
Check package-lock.json / yarn.lock / node_modules to enable prettier #191
Comments
Wouldn't your solution mean that any package installed in the entire dependency tree which happens to depend on prettier will cause this flag to trip? It just seems like it would cause more unexpected behavior than otherwise. I'd have to know more about your app structure, but it seems your internal linting module should declare 'prettier' as a peer-dependency given your consuming projects are expected to use prettier formatting directly. If you wanted to keep your setup as-is, I would expect your internal linting module to need its own atom plugin. |
The apps I’m referring to use I’m not sure that the side-effect scenarios will occur very often and I also guess that they will likely an issue in the module being included. That is because prettier needs to be a dev-dependency unless there are plans to use it like in my case. |
but your team's linter dependency still expects consumers to be formatted by prettier, thus i still think it should declare prettier as a peer dependency. and I'd personally be less concerned about how often the errors occur and more concerned with how unexpected the behavior would be when it does happen. I'm just one opinion though. |
I'm not very strong in my opinion. However, given there are a few 👍 , others seem to be in the same situation too. |
Hi guys! Great idea to add this option!
Just curious if the package could also check the contents of
package-lock.json
/yarn.lock
/node_modules
in addition topackage.json
This can be useful for ‘monolithic’ deps similar to react-scripts (create-react-app).In our team we have an internal linting npm module, which includes eslint-config, eslint itself and prettier-eslint-cli. The two latter packages are not explicitly mentioned in
package.json
, butnode_modules/.bin/eslint
andnode_modules/.bin/prettier-eslint-cli
do exist. This means that we can lint via npm scripts, but can't use the new tick inprettier-atom
yet.linter-eslint
does seem to detecteslint
fromnode_modules
, because linting as-you-type activates correctly in projects wheneslint
is a dependency of a dependency.How easy would it be to make the check a bit smarter?
Cheers! Awesome plugin!
The text was updated successfully, but these errors were encountered: