File tree Expand file tree Collapse file tree 1 file changed +4
-26
lines changed Expand file tree Collapse file tree 1 file changed +4
-26
lines changed Original file line number Diff line number Diff line change @@ -445,36 +445,14 @@ For example, here is `jest` running on all `.js` files with the `NODE_ENV` varia
445
445
446
446
</details>
447
447
448
- ### Automatically fix code style with ` prettier` for any format prettier supports
448
+ ### Automatically fix code style with ` prettier` for any format Prettier supports
449
449
450
450
<details>
451
451
<summary>Click to expand</summary>
452
452
453
- You need to add ` micromatch` as a dev dependency.
454
-
455
- ` ` ` sh
456
- $ npm i --save-dev micromatch
457
- ` ` `
458
-
459
- ` ` ` js
460
- // lint-staged.config.js
461
- const micromatch = require(' micromatch' )
462
- const prettier = require(' prettier' )
463
-
464
- const prettierSupportedExtensions = prettier
465
- .getSupportInfo ()
466
- .languages.map(( { extensions }) => extensions)
467
- .flat()
468
- const addQuotes = (a) => `"${a} "`
469
-
470
- module.exports = (allStagedFiles) => {
471
- const prettierFiles = micromatch(
472
- allStagedFiles,
473
- prettierSupportedExtensions.map((extension) => `**/*${extension} `)
474
- )
475
- return prettierFiles.length > 0
476
- ? [`prettier --write ${prettierFiles.map(addQuotes).join(' ' )} `]
477
- : []
453
+ ` ` ` json
454
+ {
455
+ " *" : " prettier --ignore-unknown --write"
478
456
}
479
457
` ` `
480
458
You can’t perform that action at this time.
0 commit comments