-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
docs: add ast-spec, type-utils docs with docusaurus-plugin-typedoc #9293
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
Changes from all commits
1ea3573
9b6b2e2
0924498
584df32
d0c8ce7
0db3d52
f958009
1698570
dda405a
cf490b1
9fe7448
3021816
7185b7e
15c0870
258419e
fa89b9e
0e8f79d
dd17e7a
e73bc3f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,31 @@ | ||
--- | ||
id: type-utils | ||
sidebar_label: type-utils | ||
toc_max_heading_level: 3 | ||
--- | ||
|
||
import GeneratedDocs from './type-utils/generated/index.md'; | ||
|
||
# `@typescript-eslint/type-utils` | ||
|
||
<PackageLink packageName="type-utils" scope="@typescript-eslint" /> | ||
|
||
> Type utilities for working with TypeScript within ESLint rules. ✨ | ||
> Type utilities for working with TypeScript types ✨ | ||
|
||
This package contains public utilities for working with TypeScript types that ESLint rules often use. | ||
This package contains public utilities for working with TypeScript types. | ||
Rules declared in [`@typescript-eslint/eslint-plugin`](./ESLint_Plugin.mdx) use these utility functions. | ||
|
||
The utilities in this package are both: | ||
|
||
- More generally ESLint-focused than the broad TypeScript utilities in [`ts-api-utils`](https://npmjs.com/package/ts-api-utils) | ||
- Separated from [`@typescript-eslint/utils`](./Utils.mdx) so that that package does not require a dependency on `typescript` | ||
|
||
> See [Custom Rules](../developers/Custom_Rules.mdx) for documentation on creating your own custom ESLint rules for TypeScript code. | ||
:::tip | ||
See [Custom Rules](../developers/Custom_Rules.mdx) for documentation on creating your own custom ESLint rules for TypeScript code. | ||
::: | ||
|
||
--- | ||
|
||
The following documentation is auto-generated from source code. | ||
|
||
<GeneratedDocs /> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
--- | ||
id: utils | ||
sidebar_label: utils | ||
toc_max_heading_level: 3 | ||
--- | ||
|
||
# `@typescript-eslint/utils` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
id: ast-spec | ||
sidebar_label: AST Specification | ||
toc_max_heading_level: 3 | ||
--- | ||
|
||
import GeneratedDocs from '../ast-spec/generated/index.md'; | ||
|
||
# AST Specification | ||
|
||
The following auto-generated documentation describes the Abstract Syntax Tree (AST) generated by [`@typescript-eslint/typescript-estree`](../TypeScript_ESTree.mdx) for parsers such as [`@typescript-eslint/parser`](../Parser.mdx). | ||
|
||
<GeneratedDocs /> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,14 +6,9 @@ export interface NodeOrTokenData { | |
* The source location information of the node. | ||
* | ||
* The loc property is defined as nullable by ESTree, but ESLint requires this property. | ||
* | ||
* @see {SourceLocation} | ||
*/ | ||
loc: SourceLocation; | ||
|
||
/** | ||
* @see {Range} | ||
*/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These |
||
range: Range; | ||
|
||
type: string; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,15 +7,17 @@ export interface TSEnumDeclaration extends BaseNode { | |
type: AST_NODE_TYPES.TSEnumDeclaration; | ||
/** | ||
* Whether this is a `const` enum. | ||
* ``` | ||
* const enum Foo {...} | ||
* @example | ||
* ```ts | ||
* const enum Foo {} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Invalid TS syntax in
The Markdown in question: #### Properties
| Property | Type | Description | Overrides |
| :------ | :------ | :------ | :------ |
| `const` | `boolean` | <p>Whether this is a `const` enum.</p><p>**Example**</p><code>const enum Foo {...}</code> | - |
| `declare` | `boolean` | <p>Whether this is a `declare`d enum.</p><p>**Example**</p><code>declare enum Foo {...}</code> | - |
| `id` | [`Identifier`](index.md#identifier) | The enum name. | - |
| `members` | [`TSEnumMember`](index.md#tsenummember)[] | The enum members. | - |
| `type` | `TSEnumDeclaration` | - | [`BaseNode`](index.md#basenode).`type` |
*** ...where the issue is on the |
||
* ``` | ||
*/ | ||
const: boolean; | ||
/** | ||
* Whether this is a `declare`d enum. | ||
* ``` | ||
* declare enum Foo {...} | ||
* @example | ||
* ```ts | ||
* declare enum Foo {} | ||
* ``` | ||
*/ | ||
declare: boolean; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
/** ... */
JSDoc style comment was getting picked up as a comment on specificallyTSAbstractAccessorProperty
.