Skip to content

Commit

Permalink
chore: add markdown lint check to default lint command (#5074)
Browse files Browse the repository at this point in the history
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
  • Loading branch information
maryliag and pichlermarc authored Oct 17, 2024
1 parent c208991 commit be1737f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:
run: |
npm run lint
npm run lint:examples
npm run lint:markdown
- name: Lint doc files
run: |
Expand Down
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 && npm run lint:markdown",
"lint:changed": "lerna run --concurrency 1 --stream lint --since HEAD --exclude-dependents",
"lint:fix": "lerna run lint:fix",
"lint:fix": "lerna run lint:fix && npm run lint:markdown:fix",
"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

0 comments on commit be1737f

Please sign in to comment.