Skip to content

Commit

Permalink
chore: fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann authored and pngwn committed Aug 14, 2024
1 parent 7861028 commit c12dd3b
Show file tree
Hide file tree
Showing 4 changed files with 4,020 additions and 3,216 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/mdsvex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm i -g pnpm@8
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- run: npm i -g pnpm@9
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- run: pnpm i --frozen-lockfile
- run: pnpm format
- run: pnpm lint
# type-check here as well when it is working
env:
CI: true
Expand All @@ -32,12 +32,12 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [16, 18]
node-version: [18, 20, 22]
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- run: npm i -g pnpm@8
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- run: npm i -g pnpm@9
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Markdown preprocessor for Svelte",
"repository": "https://github.com/pngwn/MDsveX",
"scripts": {
"format": "prettier --check .",
"lint": "prettier --check .",
"format": "prettier --write .",
"test": "uvu -r ts-node/register packages test.ts$",
"test:filter": "uvu -r ts-node/register",
"release": "pnpm -r build && changeset publish",
Expand Down
6 changes: 4 additions & 2 deletions packages/mdsvex/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,10 @@ export const mdsvex = (options: MdsvexOptions = defaults): Preprocessor => {
return {
name: 'mdsvex',
markup: async ({ content, filename }) => {
const extensionsParts = (extensions || [extension]).map(ext => ext.startsWith('.') ? ext : '.' + ext);
if (!extensionsParts.some(ext => filename.endsWith(ext))) return;
const extensionsParts = (extensions || [extension]).map((ext) =>
ext.startsWith('.') ? ext : '.' + ext
);
if (!extensionsParts.some((ext) => filename.endsWith(ext))) return;

const parsed = await parser.process({ contents: content, filename });
return {
Expand Down
Loading

0 comments on commit c12dd3b

Please sign in to comment.