Add YAML file extensions to pre-commit hooks config (#5182)

- Prettier support YAML but pre-commit hook was not checking those
  files so added file extensions to hooks config.
- Used double-quoted flow scalar style to make the list of file
  extensions easier to read. Backslash for regex needed escaping and
  backslash each line to prevent YAML including spaces.
- Added alternative markdown file extensions.
This commit is contained in:
Calum Lind authored and Ika committed 2018-11-02 00:21:51 +08:00
1 parent cce4a2683a
commit b8ebcd910c
1 file changed
+15 -6
+15 -6
View File
@@ -1,6 +1,15 @@
- id: prettier
name: prettier
entry: prettier --write
language: node
# From https://github.com/prettier/prettier/blob/7a7eb170/docs/index.md
files: \.(css|less|scss|ts|tsx|graphql|gql|json|js|jsx|md)$
- id: prettier
name: prettier
entry: prettier --write
language: node
files: "\\.(\
css|less|scss\
|graphql|gql\
|js|jsx\
|json\
|md|markdown|mdown|mkdn\
|mdx\
|ts|tsx\
|vue\
|yaml|yml\
)$"