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: add markdown lint check to default lint command #5074

Merged
merged 5 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
10 changes: 9 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,21 @@ cd packages/opentelemetry-module-name
npm run lint:fix
```

Similarly, Markdown files (such as README.md files) can be linted:
The default lint command will check majority of files, including Markdown files (such as README.md files), but you
also have the option to check just the Markdown files with:

```sh
npm run lint:markdown
npm run lint:markdown:fix # can automatically fix some Markdown rules
```

The default command doesn't check the examples folder. To lint just the examples, use the script:

```sh
npm run lint:examples
npm run lint:examples:fix # can automatically fix some errors
```

### Generating docs

We use [typedoc](https://www.npmjs.com/package/typedoc) to generate the api documentation.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"docs": "typedoc --readme none && touch docs/.nojekyll",
"docs-deploy": "gh-pages --dotfiles --dist docs",
"docs:test": "linkinator docs --silent --retry && linkinator doc/*.md --skip http://localhost:3000 --skip http://localhost:9464 --silent --retry",
"lint": "lerna run lint",
"lint": "lerna run lint && markdownlint-cli2 $(git ls-files '*.md')",
maryliag marked this conversation as resolved.
Show resolved Hide resolved
"lint:changed": "lerna run --concurrency 1 --stream lint --since HEAD --exclude-dependents",
"lint:fix": "lerna run lint:fix",
"lint:fix": "lerna run lint:fix && markdownlint-cli2 --fix $(git ls-files '*.md')",
maryliag marked this conversation as resolved.
Show resolved Hide resolved
"lint:fix:changed": "lerna run --concurrency 1 --stream lint:fix --since HEAD --exclude-dependents",
"lint:examples": "eslint --no-error-on-unmatched-pattern ./examples/**/*.js",
"lint:examples:fix": "eslint --no-error-on-unmatched-pattern ./examples/**/*.js --fix",
Expand Down
Loading