Skip to content

Add node rules #186

@rajsite

Description

@rajsite

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

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions