Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add docs on using type information in rules #63

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 Jan 8, 2019 · 4 comments · Fixed by #4124
Closed

Add docs on using type information in rules #63

JoshuaKGoldberg opened this issue Jan 8, 2019 · 4 comments · Fixed by #4124
Assignees
Labels
accepting prs Go ahead, send a pull request that resolves this issue documentation Documentation ("docs") that needs adding/updating package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@JoshuaKGoldberg
Copy link
Member

JoshuaKGoldberg commented Jan 8, 2019

Spinning off of bradzacher/eslint-plugin-typescript#276 and as a backing documentation request to help with #62: would you mind writing some docs on how to use TypeScript-specific features (the type checker? anything else?) on top of ESLint?

@armano2
Copy link
Collaborator

armano2 commented Jan 8, 2019

type check is available from parser service, and its same one as used in TSLint (typescript), there is additional task to do before using it, you have to get ts node from context.parserServices.esTreeNodeToTSNodeMap.

context.parserServices.esTreeNodeToTSNodeMap.get(node)

will return node witch you can pass to TypeChecker


estree has some additional nodes, and esTreeNodeToTSNodeMap can return undefined


about ast structure, you can find "estimate" of structure definition for currently used version here

@uniqueiniquity
Copy link
Contributor

@JoshuaKGoldberg once the PR lighting this up in typescript-eslint-parser gets finalized and merged, I can certainly write up some docs.

@JamesHenry JamesHenry transferred this issue from bradzacher/eslint-plugin-typescript Jan 18, 2019
@bradzacher bradzacher added documentation Documentation ("docs") that needs adding/updating package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin labels Jan 18, 2019
@j-f1

This comment has been minimized.

@bradzacher bradzacher changed the title Docs on typed rules? Add docs on using type information in rules Feb 23, 2019
@bradzacher

This comment has been minimized.

@typescript-eslint typescript-eslint deleted a comment Sep 15, 2019
SkReD pushed a commit to SkReD/typescript-eslint that referenced this issue Jul 9, 2021
* fix(eslint-plugin) replace interface-name-prefix

* fix(eslint-plugin) fix lint errors

* fix(eslint-plugin) replace interface-name-prefix

- fix regexp in replacement rule
- move rule to upper file

Co-authored-by: SuperOleg39 <[email protected]>
@JoshuaKGoldberg JoshuaKGoldberg added the accepting prs Go ahead, send a pull request that resolves this issue label Oct 25, 2021
@JoshuaKGoldberg JoshuaKGoldberg moved this to Todo in Documentation Nov 9, 2021
@JoshuaKGoldberg JoshuaKGoldberg moved this from Todo to In Progress in Documentation Nov 11, 2021
@JoshuaKGoldberg JoshuaKGoldberg self-assigned this Nov 11, 2021
@JoshuaKGoldberg JoshuaKGoldberg moved this from In Progress to In Review in Documentation Nov 11, 2021
Repository owner moved this from In Review to Done in Documentation Nov 14, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue documentation Documentation ("docs") that needs adding/updating package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants