Skip to content

Commit cae6cf5

Browse files
committed
fix(format): include json5 in default allowlist glob for format
1 parent 6d92928 commit cae6cf5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`format --config arg can be used for a custom config 1`] = `prettier --write **/*.+(js|json|less|css|ts|tsx|md|mdx) --config ./my-config.js`;
3+
exports[`format --config arg can be used for a custom config 1`] = `prettier --write **/*.+(js|json|json5|less|css|ts|tsx|md|mdx) --config ./my-config.js`;
44

5-
exports[`format --ignore-path arg can be used for a custom ignore file 1`] = `prettier --write **/*.+(js|json|less|css|ts|tsx|md|mdx) --ignore-path ./.myignore`;
5+
exports[`format --ignore-path arg can be used for a custom ignore file 1`] = `prettier --write **/*.+(js|json|json5|less|css|ts|tsx|md|mdx) --ignore-path ./.myignore`;
66

7-
exports[`format --no-write prevents --write argument from being added 1`] = `prettier **/*.+(js|json|less|css|ts|tsx|md|mdx) --no-write`;
7+
exports[`format --no-write prevents --write argument from being added 1`] = `prettier **/*.+(js|json|json5|less|css|ts|tsx|md|mdx) --no-write`;
88

99
exports[`format calls prettier CLI with args 1`] = `prettier --write my-src/**/*.js`;

src/scripts/format.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const relativeArgs = args.map(a => a.replace(`${process.cwd()}/`, ''))
3030

3131
const filesToApply = parsedArgs._.length
3232
? []
33-
: ['**/*.+(js|json|less|css|ts|tsx|md|mdx)']
33+
: ['**/*.+(js|json|json5|less|css|ts|tsx|md|mdx)']
3434

3535
const result = spawn.sync(
3636
resolveBin('prettier'),

0 commit comments

Comments
 (0)