Conversation
|
A temporary update to test new linting github actions
|
Hi @s-sajid-ali , added remark linting packages, and it's configs making use of "remarkConfig": {
"plugins": [
"remark-preset-lint-recommended",
"remark-mdx",
["remark-lint-list-item-indent", false]
]
},Running the linting check with Made changes to the This will enable a consistent use of our remark packages & configs for linting checks across development both locally and on github actions or anywhere else. Please let me know if you have any questions.
|
|
|
||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@v4 | ||
| - name: Install pixi |
There was a problem hiding this comment.
Can we just use https://github.com/marketplace/actions/setup-pixi ?
There was a problem hiding this comment.
Either of them works, we can use any. Please let me know.
There was a problem hiding this comment.
Let's use the action provided by the pixi devs. Fewer things for us to maintain later.
| "plugins": [ | ||
| "remark-preset-lint-recommended", | ||
| "remark-mdx", | ||
| ["remark-lint-list-item-indent", false] |
There was a problem hiding this comment.
Let's keep remark-lint-list-item-indent. We've been following it for newer files lately and it's better to have one consistent standard on list item indentation than mix multiple styles.
There was a problem hiding this comment.
Sure, We could configure remark to check for newly changed files only with our lint.yaml actions file.
There was a problem hiding this comment.
remark supports auto-formatting options as described here https://github.com/remarkjs/remark-lint?tab=readme-ov-file#example-check-and-format-markdown-on-the-cli
We can use --output option to automatically format markdown files based on indents and escape characters for uniformity like :
"format": "remark . --output --frail"
Running pnpm format will format all the markdown files for us.
| "@docusaurus/module-type-aliases": "^3.7.0", | ||
| "@docusaurus/tsconfig": "^3.7.0", | ||
| "@docusaurus/types": "^3.7.0", | ||
| "remark-cli": "^12.0.1", |
There was a problem hiding this comment.
Is there a way to keep this consistent with the version our action uses?
There was a problem hiding this comment.
Yes. We can use --save-exact option with pnpm add as specified here https://pnpm.io/cli/add#--save-exact--e . For example remove :
pnpm remove remark-cli remark-mdx remark-preset-lint-recommended
and then re-add with --save-exact:
pnpm add --save-dev --save-exact remark-cli remark-mdx remark-preset-lint-recommended
This will add fixed packages to packages.json like :
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.7.0",
"@docusaurus/tsconfig": "^3.7.0",
"@docusaurus/types": "^3.7.0",
"remark-cli": "12.0.1",
"remark-mdx": "3.1.0",
"remark-preset-lint-recommended": "7.0.1",
"typescript": "~5.7.3"
},
Hi, added the following with this branch: