From f0acce2bfb3e665a969f80a3d946f9f0eb32a761 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Fri, 15 Oct 2021 11:32:17 -0400 Subject: [PATCH] Only run linting on node 14 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 https://github.com/mysticatea/eslint-plugin-node/issues/299 --- .github/workflows/ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d77972c..36e7fde 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }}"