Comments (4)
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
from typescript-eslint.
@JoshuaKGoldberg once the PR lighting this up in typescript-eslint-parser
gets finalized and merged, I can certainly write up some docs.
from typescript-eslint.
@j-f1 - couldn't you import some of that from typescript-estree
?
I.e. your file eslint-rules/types/ast-node-types.ts
is exported from the package
Also you're probably thinking of this issue which is about converting the plugin code to TS #40
This issue is about documenting how to write rules which use type information
from typescript-eslint.
Here’s what I had to do: desktop/desktop@e1f7b9b (check the eslint-rules/types
directory)
from typescript-eslint.
Related Issues (20)
- Bug: EXPERIMENTAL_useProjectService does not respect extraFileExtensions HOT 2
- Rule proposal: prefer `satisfies` over `as` HOT 1
- Bug: no-unused-vars does not account for references in JsDoc HOT 5
- Bug: [@typescript-eslint/no-unnecessary-type-assertion] False positives when using non-null assertion operator for functions with potentially void return type
- Bug: [return-await] should handle nested try-catch-finally blocks with "in-try-catch" option
- Repo: Examine precedences in getOperatorPrecedence and getWrappingFixer HOT 1
- Configs: Better resolution for `tsconfigRootDir` in monorepo with flat config HOT 11
- Docs: disableTypeChecked example should say **/*.js, not *.js
- Docs: Deprecate sort-type-constituents in favor of eslint-plugin-perfectionist?
- Bug: [explicit-function-return-type] false positive when returning an object with a typed function property HOT 2
- Rule proposal: break up consistent-type-assertions into consistent-type-assertion-syntax and no-unsafe-object-literal-type-assertion HOT 4
- Enhancement: ban wide globs in `parserOptions.useProjectService.allowDefaultProjectForFiles` HOT 1
- Bug: Error while loading rule '@typescript-eslint/await-thenable' HOT 1
- Docs: Separate FAQs into discrete sections
- Enhancement: Remove AST properties deprecated in v6
- Enhancement: Remove deprecated emitDecoratorMetadata
- Enhancement: Raise minimum versions of dependencies for v8 HOT 7
- Enhancement: Remove deprecated getTypeArguments from type-utils HOT 1
- Enhancement: Remove IsNullableTypeOptions from type-utils
- Bug: [prefer-readonly-parameter-types] Doesn't work on `DeepReadonly` from `ts-essentials`, `utility-types`, and `type-fest` HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typescript-eslint.