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

OSOE-855: Allow textlint disable comments #101

Merged
merged 4 commits into from
Jun 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
19 changes: 18 additions & 1 deletion Lombiq.NodeJs.Extensions/Docs/Markdown.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Pipeline for Markdown files
# Pipeline for Markdown files

This project provides a way to lint all Markdown files in your project, a given folder, or the whole solution.

Expand All @@ -22,6 +22,23 @@ This is useful to catch files not covered by an individual project, such as the

> ℹ When using Lombiq Node.js Extensions from a submodule, solution-wide Markdown analysis can more easily be achieved by adding the [Lombiq.NodeJs.Extensions.SolutionMarkdownAnalysis](../../Lombiq.NodeJs.Extensions.SolutionMarkdownAnalysis/Readme.md) project to your solution as well.

### Disabling linting rules

If you find false positives, you can disable linting rules for a specific section of a file with [`textlint-filter-rule-comments`](https://github.com/textlint/textlint-filter-rule-comments). We recommend you only disable the specific rule for only the narrowest block of text affected, e.g.:

```markdown
<!-- textlint-disable doubled-spaces -->

> [!NOTE]
> The code samples in the documentation reference the latest versions of the workflows and actions from the...

<!-- textlint-enable doubled-spaces -->
```

Note the newlines around the disable block, which is necessary, see the [`textlint-filter-rule-comments` docs](https://github.com/textlint/textlint-filter-rule-comments?tab=readme-ov-file#usage).

Or, you can use `<!-- textlint-disable -->` and `<!-- textlint-enable -->` to disable all rules for a block of text.

## Available scripts

To use the `npm` scripts defined in this project, please follow the setup instructions in the root [Readme](../../Readme.md#how-to-trigger-pipelines-on-demand).
Expand Down
3 changes: 2 additions & 1 deletion Lombiq.NodeJs.Extensions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"clean-css-cli": "5.6.2",
"copyfiles": "2.4.1",
"eslint": "8.47.0",
"if-env": "1.0.4",
"glob": "10.3.10",
"if-env": "1.0.4",
"markdownlint": "0.34.0",
"nodemon": "3.0.1",
"npm-run-all": "4.1.5",
Expand All @@ -26,6 +26,7 @@
"stylelint-config-standard-scss": "11.1.0",
"terser": "5.19.2",
"textlint": "13.3.3",
"textlint-filter-rule-comments": "1.2.2",
"textlint-rule-common-misspellings": "1.0.1",
"textlint-rule-doubled-spaces": "1.0.2",
"textlint-rule-max-comma": "3.0.1",
Expand Down
11 changes: 11 additions & 0 deletions Lombiq.NodeJs.Extensions/pnpm-lock.yaml

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

3 changes: 3 additions & 0 deletions Lombiq.NodeJs.Extensions/scripts/lint-markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ const textLintConfig = {
'max-comma',
'no-empty-section',
],
filterRules: [
'comments',
],
};

function getMarkdownPaths() {
Expand Down