pretty-quick
pretty-quick copied to clipboard
Prettier-eslint support
Would it be possible to integrate support prettier-eslint? Or at least have some pointers to know what it would take to make a PR to support it 😊
prettier-eslint has a lot of extra configurability that I don't think the minimal API that this module uses can support. https://github.com/prettier/prettier-eslint#options
I'd be interested to hear a proposal for a way we could make it work with no extra config!
Ideally it would just invoke the format method of prettier-eslint with the default options, leaving the configuration up to the user's .eslintrc file. From what I can see in the doc of prettier-eslint, by default it will find the proper eslint/prettier configuration files for the given files so I feel like you would not have to pass a lot of options?
https://github.com/prettier/prettier-eslint#eslintpath-string https://github.com/prettier/prettier-eslint#prettierpath-string
I guess no progress was made on this as of yet?
Lack of prettier-eslint support is currently my blocker for using pretty-quick. Just invoking with defaults and handling configuration externally, would be absolutely fine and shouldn't be too disruptive. Would you consider a PR if there were no other externally visible changes to pretty-quick aside from an option to use prettier-eslint instead of plain prettier?
You can achieve similar functionality using just prettier-eslint module. You need lint-staged module and use this configuration:
"lint-staged": {
"app/**/*.{js,jsx}": [
"eslint --fix",
"prettier-eslint --config .prettierrc.json --write",
"git add"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
I use the following yaml config with lint-staged in order to work with prettier-eslint:
"app/**/*.{js,jsx}":
- yarn --cwd ./app prettier-eslint '$@' --write --prettier-last
In order for the above to work, I use the following command to run lint-staged:
npx lint-staged --shell /bin/sh
It will be done in https://github.com/prettier-eslint/prettier-plugin