Skip to content

Bug: no-property-in-node doesn't recognize locally linked typescript-eslint types #482

Closed
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Coming over from typescript-eslint/typescript-eslint#8226 -> typescript-eslint/typescript-eslint#9261: amusingly+ironically, the eslint-plugin/no-property-in-node rules doesn't detect any types in the https://github.com/typescript-eslint/typescript-eslint codebase. This is because typescript-eslint's types are defined at a path like:

/Users/josh/repos/typescript-eslint/packages/types/dist/generated/ast-spec.d.ts

...while the rule only checks node_modules/ style paths:

const typedNodeSourceFileTesters = [
/@types[/\\]estree[/\\]index\.d\.ts/,
/@typescript-eslint[/\\]types[/\\]dist[/\\]generated[/\\]ast-spec\.d\.ts/,
];

I suppose we have two possible fixes:

  • Add a third path like /packages[/\\]types[/\\]dist[/\\]generated[/\\]ast-spec\.d\.ts/, to hardcode for typescript-eslint
  • Add an option to allow user configs to specify their own paths

Proposal: can we go for the latter fix, adding a rule option? I feel awkward asking to hardcode this rule for one project. 😄

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