Skip to content

Commit 10feb0b

Browse files
committed
migrate prettier into pre-commit
1 parent a44ac6e commit 10feb0b

File tree

3 files changed

+12
-17
lines changed

3 files changed

+12
-17
lines changed

.github/workflows/formatting.yaml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,8 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v4
17-
- uses: actionsx/prettier@v2
18-
with:
19-
args: --config "${{ github.workspace }}/.prettierrc.toml" --write "**/*.{js,mjs,cjs,jsx,ts,tsx}"
20-
# Prettier has no diff view so we must make one ourselves
21-
# https://github.com/prettier/prettier/issues/6885
22-
- run: |
23-
git diff
24-
if [[ -n "$(git status --porcelain)" ]]; then
25-
exit 1
26-
fi
2717
- name: Set up Python
28-
uses: actions/setup-python@v2
18+
uses: actions/setup-python@v5
2919
with:
3020
python-version: 3.11
3121
- name: Install dependencies

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,8 @@ repos:
4444
exclude_types:
4545
- json
4646
- javascript
47+
- repo: https://github.com/pre-commit/mirrors-prettier
48+
rev: v3.1.0
49+
hooks:
50+
- id: prettier
51+
files: ".*\\.(js|mjs|cjs|jsx|ts|tsx)$"

extensions/wasm_bindgen/rules_js/test/hello_world_wasm_test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ const main = async function (typ, dir) {
2121
};
2222

2323
["bundler", "web", "deno", "nomodules", "nodejs"].forEach((typ) => {
24-
main(typ, process.argv.length > 2 ? process.argv[2] : "").catch(function (
25-
err,
26-
) {
27-
console.error(err);
28-
process.exit(1);
29-
});
24+
main(typ, process.argv.length > 2 ? process.argv[2] : "").catch(
25+
function (err) {
26+
console.error(err);
27+
process.exit(1);
28+
},
29+
);
3030
});

0 commit comments

Comments
 (0)