Skip to content

Commit

Permalink
Add svelte prettier plugin and ci
Browse files Browse the repository at this point in the history
  • Loading branch information
MathyouMB committed Jun 29, 2024
1 parent cf46346 commit b06e3f9
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 12 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI
'on':
- push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: |
npm install
- name: Run Prettier
run: |
npm run check
- name: Run tests
run: |
npm run test
8 changes: 7 additions & 1 deletion .prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
export default {
plugins: ['prettier-plugin-astro'],
plugins: ['prettier-plugin-astro', 'prettier-plugin-svelte'],
overrides: [
{
files: '*.astro',
options: {
parser: 'astro',
},
},
{
files: "*.svelte",
options: {
parser: 'svelte'
}
}
],
};
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"jest": "^29.7.0",
"prettier": "^3.3.2",
"prettier-plugin-astro": "^0.14.0",
"prettier-plugin-svelte": "^3.2.5",
"sass": "^1.77.6",
"ts-jest": "^29.1.5",
"ts-node": "^10.9.2"
Expand Down
22 changes: 11 additions & 11 deletions src/components/MathJax.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script>
import { onMount, afterUpdate } from "svelte";
import { mathjaxLoad, mathjaxTypeset } from "../utilities";
onMount(async () => {
mathjaxLoad();
});
afterUpdate(() => {
mathjaxTypeset();
});
</script>
import { onMount, afterUpdate } from "svelte";
import { mathjaxLoad, mathjaxTypeset } from "../utilities";
onMount(async () => {
mathjaxLoad();
});
afterUpdate(() => {
mathjaxTypeset();
});
</script>

0 comments on commit b06e3f9

Please sign in to comment.