-
Notifications
You must be signed in to change notification settings - Fork 11
Description
We have really narrow scoped node rules just around imports in the importNodeEsmConfig rules:
javascript-styleguide/packages/eslint-config-javascript/lib/import-node-esm.js
Lines 7 to 20 in f9e1ad7
| export const importNodeEsmConfig = defineConfig([ | |
| { | |
| rules: { | |
| // node esm relative resolution requires extensions | |
| 'import/extensions': 'off', | |
| // node esm relative resolution requires full path name | |
| 'import/no-useless-path-segments': 'off', | |
| // eslint-plugin-import doesn't know how to resolve entry points in packages | |
| // that use modern export maps in package.json. | |
| // https://github.com/typescript-eslint/typescript-eslint/issues/7565 | |
| // https://github.com/import-js/eslint-plugin-import/issues/2703 | |
| 'import/no-unresolved': 'off', | |
| } | |
| } |
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: typescript-eslint/typescript-eslint#11212
Should also recommend node libraries be built with moduleResolution: 'node16'