eslint-config-hardcore
eslint-config-hardcore copied to clipboard
Add eslint-plugin-json-format
https://github.com/bkucera/eslint-plugin-json-format
- [ ] Wait for https://github.com/Bkucera/eslint-plugin-json-format/issues/14
- [ ] Wait for a new release
It's too buggy. It doesn't work with the json-files
plugin, it gives Unexpected end of JSON input
for every JSON file, and it gives warnings about skipping files.
I really like the sort-package-json feature, hope the plugin will get better soon. Waiting for https://github.com/Bkucera/eslint-plugin-json-format/issues/14.
If you use Prettier, I guess one option for sorting package.json
keys would be https://github.com/matzkoh/prettier-plugin-packagejson
@karlhorky Yeah I use that plugin with Prettier in my projects! Do you think it will automagically work if I add it to eslint-config-hardcore's dependencies? I guess I'll have to try it to know for sure :)
I'm not sure, I think the plugins are loaded based on entries in package.json
. However, you could recommend installing this config using install-peerdeps
or similar and then specify it as a peer dependency... We take this approach with our config: https://github.com/upleveled/eslint-config-upleveled
@karlhorky I tried different options, can't make eslint-plugin-prettier work on *.json
files :(
Oh, I don't use eslint-plugin-prettier
- I'm just using Prettier via the Prettier VS Code extension. But if you want to use that plugin, maybe something with ESLint file extensions or something...
@karlhorky I see. Yeah I wish we could use eslint-plugin-prettier with all Prettier plugins, so we could use ESLint to format any file supported by Prettier.
What's interesting is that I discovered that @html-eslint/parser and eslint-plugin-prettier play nicely together, and I managed to set up formatting of *.html
files with eslint-plugin-prettier :)
https://github.com/EvgenyOrekhov/eslint-config-hardcore/blob/5166075ede3738a70c0581cb9cdc1c6dd6486106/base.json#L834
https://github.com/EvgenyOrekhov/eslint-config-hardcore/blob/5166075ede3738a70c0581cb9cdc1c6dd6486106/prettier.json#L38-L43
But I couldn't do the same with JSON, unfortunately.
Please don’t add eslint-plugin-prettier, the error messages don’t render correctly on Windows machines.
@RedGuy12 eslint-plugin-prettier was added to eslint-config-hardcore a long time ago.
This is no longer relevant.
I recommend using Prettier separately from ESLint, with this config: https://github.com/EvgenyOrekhov/prettier-config