diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8197a4f89f..8eb99d7140 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -28,7 +28,6 @@ jobs: run: | npm run lint npm run lint:examples - npm run lint:markdown - name: Lint doc files run: | diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3d78418a01..7c4c6fc0e4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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. diff --git a/package.json b/package.json index 5341baed1c..dc11f3e0d2 100644 --- a/package.json +++ b/package.json @@ -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",