Skip to content

Commit 6dda70c

Browse files
feat: add all file extensions from lintstagedrc as default for format script (#199)
* feat: add all file extensions from lintstagedrc as default for format script * Update format.js.snap
1 parent b4bbe72 commit 6dda70c

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) --config ./my-config.js`;
3+
exports[`format --config arg can be used for a custom config 1`] = `prettier --write **/*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|gql|graphql|mdx|vue) --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) --ignore-path ./.myignore`;
5+
exports[`format --ignore-path arg can be used for a custom ignore file 1`] = `prettier --write **/*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|gql|graphql|mdx|vue) --ignore-path ./.myignore`;
66

7-
exports[`format --no-write prevents --write argument from being added 1`] = `prettier **/*.+(js|json|less|css|ts|tsx|md) --no-write`;
7+
exports[`format --no-write prevents --write argument from being added 1`] = `prettier **/*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|gql|graphql|mdx|vue) --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)']
33+
: ['**/*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|gql|graphql|mdx|vue)']
3434

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

0 commit comments

Comments
 (0)