ni / ni/javascript-styleguide

Add node rules

Open
#186 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
9
Forks
11
PR merge metrics
No merged PRs in 30d

Description

We have really narrow scoped node rules just around imports in the importNodeEsmConfig rules:

https://github.com/ni/javascript-styleguide/blob/f9e1ad7d2905c9252e9dc714fa2632911d061ce8/packages/eslint-config-javascript/lib/import-node-esm.js#L7-L20

We should consider having more general node js and node ts rules. They can just live in the js and ts packages as separate imports and include the importNodeEsm rules

We should also re-evaluate the 'import/no-unresolved': 'off' configuration. It would be handy to keep around and was disabled (hastily) in the eslint 9 migration (see issues linked next to rule). Maybe we can switch to eslint-plugin-import-x: https://github.com/typescript-eslint/typescript-eslint/issues/11212

Should also recommend node libraries be built with moduleResolution: 'node16'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with packages/eslint-config-javascript/lib/import-node-esm.js and inspect the js and ts packages where separate Node imports would live. Review the existing importNodeEsm rules, the ESLint 9 migration change, and the linked typescript-eslint issue. Done means the scope of the general Node JS/TS rules, unresolved-import behavior, and node16 moduleResolution recommendation is decided and documented in the configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, javascript, typescript
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.