prettier-eslint-cli
prettier-eslint-cli copied to clipboard
fix: should match dots
I hope it can format and repair all matching files in my project, but I found that it did not format my configuration file (eg: .eslintrc.js, .postcssrc.js, etc.)
"format": "prettier-eslint \"**/*.{js,json,vue,md}\" --write"
https://github.com/isaacs/node-glob#dots
Codecov Report
Merging #132 into master will not change coverage. The diff coverage is
100%
.
@@ Coverage Diff @@
## master #132 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 3 3
Lines 123 123
Branches 16 16
=====================================
Hits 123 123
Impacted Files | Coverage Δ | |
---|---|---|
src/format-files.js | 100% <100%> (ø) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update c8c077b...dfb776d. Read the comment docs.
@kentcdodds @zimme
Any chance we could get this merged? Or at least give us the option to control the dot
option of glob? It would be nice to also get files starting with a dot prettified :)
@u3u feel free to resolve merge conflicts
@Oligrand feel free to open a new PR with the same fixes here if above doesn't happen fast enough for you!
Stale pull request
Dot files are excluded by ESLint and prettier by default AFAIK, maybe this new feature should be behind a flag?
Or maybe we should respect .eslintignore
and .prettierignore
instead.
I think this should be implemented under a flag, can false
by default same as ESLint and prettier.
🦋 Changeset detected
Latest commit: 64155551c7ef0edc156413a1fae87e79c256ffd3
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
Name | Type |
---|---|
prettier-eslint-cli | Minor |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
I think a includeDotFiles
flag is good; however, you touched on a good point with the ignore files. If we WERE to respect those, how would we do it?
I can see at least 2 ways:
- Use each ignore file for their respective runner. So, if ONLY a prettier ignore file exists, the eslint portion of our task will complete as expected and only the prettier portion would adhere to the ignore file.
- We merge the ignore files and avoid those files for our entire runner.
Use each ignore file for their respective runner.
I review the source codes we're using this approach now: https://github.com/prettier/prettier-eslint-cli/blob/master/src/format-files.js#L206-L236
So we'll only need to support a includeDotFiles
flag.
TODO: document
Codecov Report
Merging #132 (6d16127) into master (625a7fe) will not change coverage. The diff coverage is
100.00%
.
:exclamation: Current head 6d16127 differs from pull request most recent head 6415555. Consider uploading reports for the commit 6415555 to get more accurate results
@@ Coverage Diff @@
## master #132 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 4
Lines 166 167 +1
Branches 29 29
=========================================
+ Hits 166 167 +1
Impacted Files | Coverage Δ | |
---|---|---|
src/format-files.js | 100.00% <100.00%> (ø) |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.