Skip to content

Commit

Permalink
Add lint-md section to scripts readme (#19716)
Browse files Browse the repository at this point in the history
* Add lint-md section to scripts readme

* Update lint-md feature to CHANGELOG

* Update CHANGELOG.md

Co-authored-by: Grzegorz (Greg) Ziółkowski <grzegorz@gziolo.pl>
  • Loading branch information
mkaz and gziolo committed Jan 17, 2020
1 parent e8d9d90 commit eaf6937
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/scripts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

### New Features

- Add SVGR support to compile SVG files to React components using the `@svgr/webpack` plugin. [#18243](https://github.com/WordPress/gutenberg/pull/18243)
- Add `packages-update` command to update WordPress packages to the latest version automatically ([#19448](https://github.com/WordPress/gutenberg/pull/19448)).
- Add SVGR support to compile SVG files to React components using the `@svgr/webpack` plugin ([#18243](https://github.com/WordPress/gutenberg/pull/18243)).
- Add `lint-md` script to lint JavaScript source code in markdown files, uses the `eslint-plugin-markdown` plugin ([#19518](https://github.com/WordPress/gutenberg/pull/19518)).
- Add `packages-update` script to update WordPress packages to the latest version automatically ([#19448](https://github.com/WordPress/gutenberg/pull/19448)).

## 6.1.1 (2020-01-01)

Expand Down
25 changes: 25 additions & 0 deletions packages/scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ _Example:_
"check-licenses": "wp-scripts check-licenses",
"lint:css": "wp-scripts lint-style",
"lint:js": "wp-scripts lint-js",
"lint:md": "wp-scripts lint-md",
"lint:pkg-json": "wp-scripts lint-pkg-json",
"packages-update": "wp-scripts packages-update",
"start": "wp-scripts start",
Expand Down Expand Up @@ -224,6 +225,30 @@ By default, files located in `build` and `node_modules` folders are ignored.

It uses [npm-package-json-lint](https://www.npmjs.com/package/npm-package-json-lint) with the set of recommended rules defined in [@wordpress/npm-package-json-lint-config](https://www.npmjs.com/package/@wordpress/npm-package-json-lint-config) npm package. You can override default rules with your own as described in [npm-package-json-lint wiki](https://github.com/tclindner/npm-package-json-lint/wiki). Learn more in the [Advanced Usage](#advanced-usage) section.

### `lint-md`

Helps enforce standards for JS source code in your markdown files.

_Example:_

```json
{
"scripts": {
"lint:md": "wp-scripts lint-md"
}
}
```

This is how you execute the script with presented setup:

* `npm run lint:md` - lints markdown files in the entire project’s directories.

By default, files located in `build` and `node_modules` folders are ignored.

#### Advanced information

It uses [eslint-plugin-markdown](https://github.com/eslint/eslint-plugin-markdown) with the [.eslintrc-md.js](https://github.com/WordPress/gutenberg/blob/master/packages/scripts/config/.eslintrc-md.js) configuration. This configuration tunes down the linting rules since documentation often includes just snippets of code. It is recommended to use the markdown linting as a check, but not necessarily a blocker since it might report more false errors.

### `lint-style`

Helps enforce coding style guidelines for your style files.
Expand Down

0 comments on commit eaf6937

Please sign in to comment.