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: Remove broken lint-md-js command #40511

Merged
merged 4 commits into from
Apr 21, 2022
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
96 changes: 0 additions & 96 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@
"lint-lockfile": "node ./bin/validate-package-lock.js",
"lint-css": "wp-scripts lint-style \"**/*.scss\"",
"lint-css:fix": "npm run lint-css -- --fix",
"lint:md-js": "wp-scripts lint-md-js",
"lint:md-docs": "wp-scripts lint-md-docs",
"native": "npm run --prefix packages/react-native-editor",
"postinstall": "patch-package && node ./patches/patch-xcode.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Replace them with your own styles or remove the file completely.
*/

.wp-block-{{namespace}}-{{slug}} input[type='text'] {
.wp-block-{{namespace}}-{{slug}} input[type="text"] {
font-family: Gilbert, sans-serif;
font-size: 64px;
color: inherit;
Expand Down
11 changes: 10 additions & 1 deletion packages/scripts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@

## Breaking Changes

- Remove `lint-md-js` script that was broken for some time and it's extemely hard to make it work correctly with the recommended ESLint config in Markdown files ([#40511](https://github.com/WordPress/gutenberg/pull/40511)).

### Bug Fixes

- Remove the previously deprecated and undocumented `format-js` command ([#40512](https://github.com/WordPress/gutenberg/pull/40512)). You should use the `format` command instead.

## 22.5.0 (2022-04-21)

### Bug Fixes

- Update `markdownlint` and `markdownlint-cli` to the latest versions ([#40479](https://github.com/WordPress/gutenberg/pull/40479)).
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one was misplaced 🙈


## 22.4.0 (2022-04-08)

### New Feature
Expand All @@ -17,7 +27,6 @@
- Add `vendor/` to `.markdownlintignore`, to match `lint-md-docs` docs ([#39724](https://github.com/WordPress/gutenberg/pull/39724)).
- Include files with `.jsx` extension in the build process ([#39613](https://github.com/WordPress/gutenberg/pull/39613)).
- Ensure that the default logic for entry points in the build commands is executed only when used the default config ([#39618](https://github.com/WordPress/gutenberg/pull/39618)).
- Update `markdownlint` and `markdownlint-cli` to the latest versions ([#40479](https://github.com/WordPress/gutenberg/pull/40479)).

## 22.2.0 (2022-03-11)

Expand Down
30 changes: 2 additions & 28 deletions packages/scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ _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:pkg-json": "wp-scripts lint-pkg-json",
"packages-update": "wp-scripts packages-update",
"plugin-zip": "wp-scripts plugin-zip",
Expand All @@ -48,8 +47,8 @@ _Example:_
It might also be a good idea to get familiar with the [JavaScript Build Setup tutorial](https://github.com/WordPress/gutenberg/tree/HEAD/docs/how-to-guides/javascript/js-build-setup.md) for setting up a development environment to use ESNext syntax. It gives a very in-depth explanation of how to use the [build](#build) and [start](#start) scripts.

## Automatic block.json detection and the source code directory
When using the `start` or `build` commands, the source code directory ( the default is `./src`) and its subdirectories are scanned for the existence of `block.json` files. If one or more are found, they are treated a entry points and will be output into corresponding folders in the `build` directory. The allows for the creation of multiple blocks that use a single build process. The source directory can be customized using the `--webpack-src-dir` flag.

When using the `start` or `build` commands, the source code directory ( the default is `./src`) and its subdirectories are scanned for the existence of `block.json` files. If one or more are found, they are treated a entry points and will be output into corresponding folders in the `build` directory. This allows for the creation of multiple blocks that use a single build process. The source directory can be customized using the `--webpack-src-dir` flag.

## Updating to New Release

Expand All @@ -59,7 +58,6 @@ In most cases bumping the `@wordpress/scripts` version in `package.json` and run

We commit to keeping the breaking changes minimal so you can upgrade `@wordpress/scripts` as seamless as possible.


## Available Scripts

### `build`
Expand Down Expand Up @@ -256,30 +254,6 @@ By default, files located in `build`, `node_modules`, and `vendor` folders are i

It uses [markdownlint](https://github.com/DavidAnson/markdownlint) with the [.markdownlint.json](https://github.com/WordPress/gutenberg/blob/HEAD/packages/scripts/config/.markdownlint.json) configuration. This configuration tunes the linting rules to match WordPress standard, you can override with your own config, see [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli/) for command-line parameters.

### `lint-md-js`

Uses ESLint to lint the source included in markdown files to enforce standards for JS code.

_Example:_

```json
{
"scripts": {
"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.

By default, files located in `build`, `node_modules`, and `vendor` 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/HEAD/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 Expand Up @@ -380,7 +354,7 @@ _Example:_
"start:hot": "wp-scripts start --hot",
"start:custom": "wp-scripts start entry-one.js entry-two.js --output-path=custom",
"start:copy-php": "wp-scripts start --webpack-copy-php",
"start:custom-directory": "wp-scripts start --webpack-src-dir=custom-directory",
"start:custom-directory": "wp-scripts start --webpack-src-dir=custom-directory"
}
}
```
Expand Down
15 changes: 0 additions & 15 deletions packages/scripts/config/.eslintrc-md.js

This file was deleted.

2 changes: 0 additions & 2 deletions packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,12 @@
"cwd": "^0.10.0",
"dir-glob": "^3.0.1",
"eslint": "^8.3.0",
"eslint-plugin-markdown": "^2.2.0",
"expect-puppeteer": "^4.4.0",
"fast-glob": "^3.2.7",
"filenamify": "^4.2.0",
"jest": "^27.4.5",
"jest-dev-server": "^6.0.2",
"jest-environment-node": "^27.4.4",
"markdownlint": "^0.25.1",
"markdownlint-cli": "^0.31.1",
"merge-deep": "^3.0.3",
"mini-css-extract-plugin": "^2.5.1",
Expand Down
51 changes: 0 additions & 51 deletions packages/scripts/scripts/lint-md-js.js

This file was deleted.