Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix formatting #616

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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