Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JoshuaKGoldberg opened this issue Jun 4, 2024 · 1 comment · Fixed by #484
Closed

Comments

@JoshuaKGoldberg
Copy link
Contributor

JoshuaKGoldberg commented Jun 4, 2024

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. 😄

@aladdin-add
Copy link
Contributor

I also agreed to adding an option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants