diff --git a/packages/scripts/README.md b/packages/scripts/README.md index 28b2a0236809e..28d5d1cf3d1b7 100644 --- a/packages/scripts/README.md +++ b/packages/scripts/README.md @@ -31,7 +31,7 @@ _Example:_ "lint:css": "wp-scripts lint-style", "lint:js": "wp-scripts lint-js", "lint:md:docs": "wp-scripts lint-md-docs", - "lint-md:js": "wp-scripts lint-md-js", + "lint:md:js": "wp-scripts lint-md-js", "lint:pkg-json": "wp-scripts lint-pkg-json", "packages-update": "wp-scripts packages-update", "start": "wp-scripts start", @@ -235,14 +235,14 @@ _Example:_ ```json { "scripts": { - "lint-md:docs": "wp-scripts lint-md-docs" + "lint:md:docs": "wp-scripts lint-md-docs" } } ``` This is how you execute the script with presented setup: -* `npm run lint-md:docs` - lints markdown files in the entire project’s directories. +* `npm run lint:md:docs` - lints markdown files in the entire project’s directories. By default, files located in `build` and `node_modules` folders are ignored. @@ -259,14 +259,14 @@ _Example:_ ```json { "scripts": { - "lint-md:js": "wp-scripts lint-md-js" + "lint:md:js": "wp-scripts lint-md-js" } } ``` This is how you execute the script with presented setup: -* `npm run lint-md:js` - lints markdown files in the entire project’s directories. +* `npm run lint:md:js` - lints markdown files in the entire project’s directories. By default, files located in `build` and `node_modules` folders are ignored. diff --git a/packages/scripts/scripts/lint-md-docs.js b/packages/scripts/scripts/lint-md-docs.js index 69532986bb406..c2949985cb35c 100644 --- a/packages/scripts/scripts/lint-md-docs.js +++ b/packages/scripts/scripts/lint-md-docs.js @@ -43,7 +43,7 @@ const hasIgnoredFiles = hasArgInCLI( '--ignore' ) || hasArgInCLI( '-i' ) || // 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', '**/build/**', '--ignore', '**/node_modules/**' ] : []; const result = spawn(