eslint-plugin-package-json
eslint-plugin-package-json copied to clipboard
feat: privacy rules. Closes #1.
Add rules for required-properties
, namespaced-requires-public
, and public-requires-namespaced
.
Proposed to close #1.
Hi! I finally found the time to try it, but it seems I'm doing something wrong.
My test repo: https://github.com/mk-pmb/try-eslint-plugin-package-json-privacy-mgmt-js
Travis CI error log: https://travis-ci.org/mk-pmb/try-eslint-plugin-package-json-privacy-mgmt-js/jobs/571072367
What could be the problem? Edit: Sorry I forgot it have to let CI install from the PR branch. I'll try that.
Ok now with installing from the PR branch it seems to somewhat work, albeit package-json/valid-package-def
doesn't like the branch dep.
https://travis-ci.org/mk-pmb/try-eslint-plugin-package-json-privacy-mgmt-js/jobs/571078638
How do I tell it to not apply regular JS style rules?
@mk-pmb You're running @mk-pmb You can use an overrides
config to do that, but oddly enough, that doesn't happen with any preset I've tried but yours. If you remove your preset in that sample repo, it lints just fine.
@mk-pmb Are you still having trouble with configuration overrides? Are they specific to this config, or do they happen whenever you add .json files to the lint target glob?
I'm not sure I understand the question. In the other thread I wrote which rules conflict. If I remove those rules, both JSON files are accepted.
Feel free to clone my test repo and try to make it work. :-)
Update: I think I know now, you probably meant whether the errors occur even without your plugin. I'll check.
Without your plugin, eslint fails with Parsing error: Unexpected token :
because JSON objects aren't a valid script. At least not in node.js:
$ <<<'{ "foo": 123 }' nodejs; echo node rv=$?
[stdin]:1
{ "foo": 123 }
^
SyntaxError: Unexpected token :
That sounds like the preprocessor isn't working. It's possible that this is not an ideal use of ESLint :)
Thanks for your patience with the turnaround; this project is a minor module spun off from magento/pwa-studio and I don't have a lot of time to maintain it.
Are you still using it? I thought that ESLint preprocessors were global, which would mean that our preprocessor comments converts the JSON to valid JavaScript for all linter plugins. Sounds like that doesn't happen for you. Can you give me all the relevant versions (node, npm, eslint)?
Are you still using it?
Nope. I'm still waiting for a version that works for my test repo. Then, hopefully, I'll be able to use it with my exttended linter configs as well. :-)
Can you give me all the relevant versions (node, npm, eslint)?
eslint v6.6.0, Node.js v12.13.0, npm v6.12.0, Ubuntu 16.04.6 LTS xenial, kernel: 4.15.0-62-lowlatency, machine/CPU/platform: x86_64 x86_64 x86_64
Is there still hope?
😄 There is hope! https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/1#issuecomment-1716807880