This repository has been archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 64
/
.pre-commit-config.yaml
98 lines (90 loc) · 3.34 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# This file is being synced from WordPress/openverse. Any changes made to it
# here will be overwritten. Please make any necessary edits to these files:
# - https://github.com/WordPress/openverse/blob/main/.pre-commit-config.yaml.jinja
# - https://github.com/WordPress/openverse/blob/main/templates/.pre-commit-config.frontend.yaml.jinja
exclude: Pipfile\.lock|migrations|\.idea|node_modules|archive|retired
repos:
- repo: local # More local hooks are defined at the bottom.
hooks:
- id: i18n
name: i18n
# Check if the i18n files have been downloaded by checking if the Arabic translation exists
# Download the i18n files if they do not exist
entry: bash -c 'if [ ! -f "$(dirname "$dir")"/src/locales/ar.json ]; then pnpm i18n; fi'
language: system
pass_filenames: false
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: check-executables-have-shebangs
- id: check-json
exclude: tsconfig.json # contains comments
- id: check-case-conflict
- id: check-toml
- id: check-merge-conflict
- id: check-xml
- id: check-yaml
- id: end-of-file-fixer
exclude: test/tapes/.+\.json5
- id: check-symlinks
- id: mixed-line-ending
- id: fix-encoding-pragma
args:
- --remove
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.15.0
hooks:
- id: eslint
files: \.(js|ts|vue)$
exclude: ^nuxt-template-overrides/.*|.remake/.*$ # ESLint raises warnings for ignored files.
"types": [file] # ESLint only accepts [javascript] by default.
args:
- --ignore-path=.gitignore
- --ignore-path=.eslintignore
- --max-warnings=0
additional_dependencies:
- "@babel/[email protected]"
- "@intlify/[email protected]"
- "@nuxtjs/[email protected]"
- "@typescript-eslint/[email protected]"
- "@typescript-eslint/[email protected]"
# Use the `.prettierignore` and `.prettier.config.js` files to configure project-specific requirements.
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.6.0
hooks:
- id: prettier
additional_dependencies:
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.8.0
hooks:
- id: shellcheck
- repo: local # More local hooks are defined at the top.
hooks:
- id: types
name: types
entry: bash -c 'pnpm types'
language: system
pass_filenames: false
- id: test:unit
name: test:unit
entry: bash -c 'pnpm test:unit'
language: system
pass_filenames: false
stages:
- push