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

Scripts: Update lint-md-docs script to use ignore-path #32633

Merged
merged 3 commits into from
Jun 18, 2021
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
147 changes: 84 additions & 63 deletions package-lock.json

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

9 changes: 9 additions & 0 deletions packages/scripts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

## Unreleased

### New Features

- Add .markdownlintignore config and reference from lint-md-docs script ([#32633](https://github.com/WordPress/gutenberg/pull/32633)).

### Enhancements

- Update `markdownlint` package to `0.23.1` ([#32633](https://github.com/WordPress/gutenberg/pull/32633)).
- Update `markdownlint-cli` package to `0.27.1` ([#32633](https://github.com/WordPress/gutenberg/pull/32633)).

## 16.1.0 (2021-05-20)

### Bug Fix
Expand Down
2 changes: 2 additions & 0 deletions packages/scripts/config/.markdownlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/build/**
**/node_modules/**
4 changes: 2 additions & 2 deletions packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
"jest-circus": "^26.6.3",
"jest-dev-server": "^4.4.0",
"jest-environment-node": "^26.6.2",
"markdownlint": "^0.18.0",
"markdownlint-cli": "^0.21.0",
"markdownlint": "^0.23.1",
"markdownlint-cli": "^0.27.1",
"merge-deep": "^3.0.3",
"mini-css-extract-plugin": "^1.3.9",
"minimist": "^1.2.0",
Expand Down
6 changes: 1 addition & 5 deletions packages/scripts/scripts/lint-md-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,8 @@ const hasIgnoredFiles =
hasProjectFile( '.markdownlintignore' );

// Default ignore [ build, node_modules ] directories
// TODO: Once https://github.com/igorshubovych/markdownlint-cli/issues/46 is in
// we can switch this to specify an ignore file on the command-line. By default,
// markdownlint looks for .markdownlintignore in project direcotry, but how our
// scripts work we store the configs in the scripts/config directory
const defaultIgnoreArgs = ! hasIgnoredFiles
? [ '--ignore', '**/build/**', '--ignore', '**/node_modules/**' ]
? [ '--ignore-path', fromConfigRoot( '.markdownlintignore' ) ]
: [];

const result = spawn(
Expand Down