|
1 | 1 | { |
2 | 2 | "--": [ |
3 | 3 | "Notes:", |
4 | | - "Our scripts use a special POSIX shim that allows you to run i.e. yarn markdownlint-check and specify files to check, or omit the files and it has a default.", |
5 | | - "The magic is in the ${@:-\"**/*.md\"} part:", |
6 | | - "$@: This represents all the arguments passed to the script (e.g., the files you want to lint).", |
7 | | - "${...:-...}: This is the shell's 'use default value' operator.", |
8 | | - "In plain English, it means: If $@ (the list of arguments) is empty or not set, use the default value **/*.md. Otherwise, use the arguments that were provided." |
| 4 | + "", |
| 5 | + "Script argument handling:", |
| 6 | + "- Our scripts use a special POSIX shim that allows you to run i.e. yarn lint:markdown and specify files to check, or omit the files and it has a default.", |
| 7 | + "- The magic is in the ${@:-\"**/*.md\"} part:", |
| 8 | + " - $@: This represents all the arguments passed to the script (e.g., the files you want to lint).", |
| 9 | + " - ${...:-...}: This is the shell's 'use default value' operator.", |
| 10 | + " - In plain English: If $@ (the list of arguments) is empty or not set, use the default value **/*.md. Otherwise, use the arguments that were provided.", |
| 11 | + "", |
| 12 | + "Markdown file filtering:", |
| 13 | + "- lint:markdown and format:markdown only process .md files when specific files are passed.", |
| 14 | + "- If you run 'yarn format source/index.html README.md', only README.md gets passed to markdownlint.", |
| 15 | + "- This is necessary because markdownlint-cli2 does not filter by extension - it will attempt to lint any file you explicitly pass to it.", |
| 16 | + "- The shell loop 'for file in \"$@\"; do case \"$file\" in *.md) ...' implements this filtering.", |
| 17 | + "", |
| 18 | + "Prettier ignore behavior:", |
| 19 | + "- Prettier respects .prettierignore even when you pass specific file paths.", |
| 20 | + "- .prettierignore contains '*.md' so Prettier silently skips Markdown files.", |
| 21 | + "- This means 'yarn format README.md' will skip Prettier but run markdownlint on README.md.", |
| 22 | + "- This is intentional: we want markdownlint (not Prettier) to format Markdown files.", |
| 23 | + "", |
| 24 | + "Known issues:", |
| 25 | + "- yarn test:html-validate returns exit code 129 when run through yarn, despite tests passing.", |
| 26 | + "- This appears to be related to how Yarn Berry handles worker_threads termination.", |
| 27 | + "- Workaround: run tests individually or use CI/CD which may handle this differently.", |
| 28 | + "- The tests themselves pass correctly (see output), only the exit code is affected." |
9 | 29 | ], |
10 | 30 | "license": "UNLICENSED", |
11 | 31 | "devDependencies": { |
12 | | - "@fulldecent/nice-checkers-plugin": "^1.2.0", |
| 32 | + "@fulldecent/nice-checkers-plugin": "^1.2.1", |
13 | 33 | "@shopify/prettier-plugin-liquid": "^1.10.0", |
14 | 34 | "cheerio": "^1.1.2", |
15 | 35 | "css": "^3.0.0", |
16 | 36 | "glob": "^13.0.0", |
17 | 37 | "html-validate": "^10.4.0", |
18 | | - "markdownlint-cli2": "^0.19.1", |
| 38 | + "markdownlint-cli2": "^0.20.0", |
19 | 39 | "prettier": "^3.7.4" |
20 | 40 | }, |
21 | 41 | "scripts": { |
22 | 42 | "lint": "sh -c 'yarn lint:prettier \"$@\" && yarn lint:markdown \"$@\"' --", |
23 | 43 | "lint:prettier": "sh -c 'yarn prettier --cache --cache-location=cache/.prettiercache --check ${@:-\".\"}' --", |
24 | | - "lint:markdown": "sh -c 'yarn markdownlint-cli2 ${@:-\"**/*.md\"}' --", |
25 | | - "format": "sh -c 'yarn prettier --cache --cache-location=cache/.prettiercache --write ${@:-\".\"} && yarn markdownlint-cli2 --fix ${@:-\"**/*.md\"}' --", |
26 | | - "build": "bundle exec jekyll build", |
27 | | - "generate-sitemap": "node scripts/generate-sitemap.mjs", |
28 | | - "test": "sh -c 'yarn test:html-validate \"$@\" && yarn test:dirty-file-paths-checker \"$@\" && yarn test:unused-assets' --", |
| 44 | + "lint:markdown": "sh -c 'if [ $# -eq 0 ]; then yarn markdownlint-cli2 \"**/*.md\"; else for file in \"$@\"; do case \"$file\" in *.md) yarn markdownlint-cli2 \"$file\";; esac; done; fi' --", |
| 45 | + "format": "sh -c 'yarn format:prettier \"$@\" && yarn format:markdown \"$@\"' --", |
| 46 | + "format:prettier": "sh -c 'yarn prettier --cache --cache-location=cache/.prettiercache --write ${@:-\".\"}' --", |
| 47 | + "format:markdown": "sh -c 'if [ $# -eq 0 ]; then yarn markdownlint-cli2 --fix \"**/*.md\"; else for file in \"$@\"; do case \"$file\" in *.md) yarn markdownlint-cli2 --fix \"$file\";; esac; done; fi' --", |
| 48 | + "dev": "bundle exec jekyll serve --livereload", |
| 49 | + "build": "yarn build:jekyll && yarn build:sitemap", |
| 50 | + "build:jekyll": "bundle exec jekyll build", |
| 51 | + "build:sitemap": "node scripts/generate-sitemap.mjs", |
| 52 | + "test": "sh -c 'yarn test:html-validate \"$@\" && yarn test:dirty-file-paths-checker && yarn test:unused-assets' --", |
29 | 53 | "test:html-validate": "node test/html-validate.mjs", |
30 | 54 | "test:dirty-file-paths-checker": "node test/dirty-file-paths-checker.mjs", |
31 | 55 | "test:unused-assets": "node test/unused-assets.mjs", |
|
0 commit comments