enhancement: add .prettierignore file#7187
Conversation
|
Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon. |
| "code-lint": "eslint setup lib bin hot buildin \"test/*.js\" \"test/**/webpack.config.js\" \"examples/**/webpack.config.js\" \"schemas/**/*.js\"", | ||
| "type-lint": "tsc --pretty", | ||
| "fix": "yarn code-lint --fix", | ||
| "pretty": "prettier \"setup/**/*.js\" \"lib/**/*.js\" \"bin/*.js\" \"hot/*.js\" \"buildin/*.js\" \"test/*.js\" \"test/**/webpack.config.js\" \"examples/**/webpack.config.js\" \"schemas/**/*.js\" \"declarations.d.ts\" --write", |
There was a problem hiding this comment.
You Want to keep the npm script
There was a problem hiding this comment.
I guess it's redundant to the one above it (yarn fix), isn't it? In addition to that, it's not being used anywhere else at all.
There was a problem hiding this comment.
It is not redundant, one is ESLint other is Prettier
There was a problem hiding this comment.
As per @sokra explanation in #7276 we're using prettier plugin for ESLint, meaning ESLint runs prettier as a rule and reports errors/warnings. Also, ESLint will format code based on prettier rules when --fix flag is used, meaning does exactly the same as pretty script does.
Taking into consideration the above and the fact that pretty script remains unused I thought that we could get rid of it unless someone is using yarn pretty explicitly, but I doubt that.
There was a problem hiding this comment.
I use yarn pretty explicitly. It's faster than running eslint and doesn't do non-prettier changes.
There was a problem hiding this comment.
My bad. Didn't know it's being used by people. I've put it back, just moved the --write flag to be more aligned with official docs.
|
For maintainers only:
|
|
Thanks |
What kind of change does this PR introduce?
enhancement
Did you add tests for your changes?
no
If relevant, link to documentation update:
n/a
Summary
Adds
.prettierignoreto prevent IDEs plugins from autoformatting wrong files (eg. JSON files or some test related files).Does this PR introduce a breaking change?
no
Other information
Tested in Atom (
prettier-atomplugin). Feedback from other IDEs is highly appreciated.