Skip to content

Commit

Permalink
Only run linting on node 14
Browse files Browse the repository at this point in the history
This works around an issue with node/no-missing-import that doesn't
properly see that `node:path` is a valid module on Node 12.x.

They are using `is-core-module` to figure out if it is a module or not,
and it seems that `is-core-module` doesn't differentiate between core
modules that are available for CJS (the `node:` prefixed paths are only
available in 14.18+ and 16+ in CJS files) and those that are available
to ESM.

This is really just a bandaid, the right fix would be to send a PR to
is-core-module to allow it to check CJS vs MJS modules (since they are
actually different).

See mysticatea/eslint-plugin-node#299
  • Loading branch information
rwjblue committed Oct 15, 2021
1 parent 1909f53 commit f0acce2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -7,6 +7,17 @@ on:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 14.x
- run: npm ci
- run: npm run lint:js

build:
name: "Node ${{ matrix.node-version }}"

Expand Down

0 comments on commit f0acce2

Please sign in to comment.