Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nodejs/remark-preset-lint-node
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f0a61fd9b450f5be2125277ff27de2397e259cb8
Choose a base ref
...
head repository: nodejs/remark-preset-lint-node
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c434c529393ebfc64e55aeb52ea16a37ddc620b1
Choose a head ref
Loading
Showing with 174 additions and 166 deletions.
  1. +3 −3 .github/workflows/test.yml
  2. +1 −1 .gitignore
  3. +28 −6 README.md
  4. +4 −1 index.js
  5. +103 −128 package-lock.json
  6. +4 −4 package.json
  7. +31 −23 remark-lint-nodejs-yaml-comments.js
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -16,16 +16,16 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v2
uses: actions/checkout@v2.3.4

- name: Clone nodejs/node repository
uses: actions/checkout@v2
uses: actions/checkout@v2.3.4
with:
repository: nodejs/node
path: tmp

- name: Set up Node.js
uses: actions/setup-node@v2.1.2
uses: actions/setup-node@v2.1.5
with:
node-version: "${{ env.NODE }}"

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -37,4 +37,4 @@ jspm_packages
.node_repl_history

# Cloned nodejs/node for testing
tmp/
tmp
34 changes: 28 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -20,12 +20,34 @@ npm test

### Adding the language to the documentation style guide

1. PR the [nodejs/node](https://github.com/nodejs/node) repo adding the language/grammar to the [documentation style guide](https://github.com/nodejs/node/blob/master/doc/guides/doc-style-guide.md)
1. PR the [nodejs/node](https://github.com/nodejs/node) repo adding the
language/grammar to the
[documentation style guide](https://github.com/nodejs/node/blob/master/doc/guides/doc-style-guide.md).

### Adding the language to the linter

1. PR this repo adding the language/grammar
1. Bump this package version, publish it
1. In [node-lint-md-cli-rollup](https://github.com/nodejs/node/tree/master/tools/node-lint-md-cli-rollup), bump the `remark-preset-lint-node` dependency
1. In the `nodejs/node` repo, rebuild the Markdown linter (`make lint-md-rollup`)
1. PR the `nodejs/node` repo with the updated linter
1. PR this repo adding the language/grammar.
1. Bump this package version, publish it.
1. In
[node-lint-md-cli-rollup](https://github.com/nodejs/node/tree/master/tools/node-lint-md-cli-rollup),
bump the `remark-preset-lint-node` dependency.
1. In the `nodejs/node` repo, rebuild the Markdown linter
(`make lint-md-rollup`).
1. PR the `nodejs/node` repo with the updated linter.

## Environment variables

#### `NODE_RELEASED_VERSIONS`

On runtime, the linter will check the environment if the
`NODE_RELEASED_VERSIONS` variable is defined; if it's there, it will use the
content of the variable as a comma-separated list of allowed version numbers.
This list is supposed to be built from the changelog(s), and validates the
version numbers for the `nodejs-yaml-comments` rule.

For better compatibility with the nodejs/node changelogs, there are a few
exceptions:

- Version numbers `^0.0.0 || ^0.1.0` are not validated using the provided list,
they are validating using the `vx.x.x` pattern.
- `REPLACEME` placeholder is always valid, regardless it's in the list or not.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ module.exports.plugins = [
flags: [
"bash",
"c",
"cjs",
"coffee",
"console",
"cpp",
@@ -32,6 +33,7 @@ module.exports.plugins = [
"js",
"json",
"markdown",
"mjs",
"powershell",
"r",
"text",
@@ -63,7 +65,8 @@ module.exports.plugins = [
{ yes: "GitHub" },
{ no: "hostname", yes: "host name" },
{ yes: "JavaScript" },
{ no: "Node", yes: "Node.js" },
{ no: "[Ll]ong[ -][Tt]erm [Ss]upport", yes: "Long Term Support" },
{ no: "Node", yes: "Node.js", ignoreNextTo: "-API" },
{ yes: "Node.js" },
{ no: "Node[Jj][Ss]", yes: "Node.js" },
{ no: "Node\\.js's?", yes: "the Node.js" },
Loading