diff --git a/docs/development/architecture/ASTS.md b/docs/development/architecture/ASTS.md index 055ffa713d8b..09526ac611a5 100644 --- a/docs/development/architecture/ASTS.md +++ b/docs/development/architecture/ASTS.md @@ -1,10 +1,9 @@ --- id: asts -title: ASTs sidebar_label: ASTs --- -## Abstract Syntax Trees (AST)s +# Abstract Syntax Trees (ASTs) Parsers such as those in ESLint and TypeScript read in the text of source code and parse it into a standard format they can reason about known as an **Abstract Syntax Tree** (AST). ASTs are called such because although they might contain information on the location of constructs within source code, they are an abstract representation that cares more about the semantic structure. @@ -43,7 +42,9 @@ ESTree is more broadly used than just for ESLint -- it is the de facto community ESLint's built-in parser that outputs an `estree`-shaped AST is also a separate package, called **[`espree`]**. :::note + You can play more with various ASTs such as ESTree on [astexplorer.net] and read more details on their [Wikipedia article](https://en.wikipedia.org/wiki/Abstract_syntax_tree). + ::: [astexplorer.net]: https://astexplorer.net diff --git a/packages/eslint-plugin/docs/rules/README.md b/packages/eslint-plugin/docs/rules/README.md index 6e4098a5308a..1145ec14aa12 100644 --- a/packages/eslint-plugin/docs/rules/README.md +++ b/packages/eslint-plugin/docs/rules/README.md @@ -107,7 +107,7 @@ slug: / -### Extension Rules +## Extension Rules In some cases, ESLint provides a rule itself, but it doesn't support TypeScript syntax; either it crashes, or it ignores the syntax, or it falsely reports against it. In these cases, we create what we call an extension rule; a rule within our plugin that has the same functionality, but also supports TypeScript. diff --git a/packages/eslint-plugin/docs/rules/naming-convention.md b/packages/eslint-plugin/docs/rules/naming-convention.md index a55dfde13181..ef917b1a239c 100644 --- a/packages/eslint-plugin/docs/rules/naming-convention.md +++ b/packages/eslint-plugin/docs/rules/naming-convention.md @@ -9,7 +9,11 @@ There are many different rules that have existed over time, but they have had th This rule allows you to enforce conventions for any identifier, using granular selectors to create a fine-grained style guide. -### Note - this rule only needs type information in specific cases, detailed below +:::note + +This rule only needs type information in specific cases, detailed below. + +::: ## Options @@ -105,7 +109,7 @@ The `format` option defines the allowed formats for the identifier. This option Instead of an array, you may also pass `null`. This signifies "this selector shall not have its format checked". This can be useful if you want to enforce no particular format for a specific selector, after applying a group selector. -### `custom` +#### `custom` The `custom` option defines a custom regex that the identifier must (or must not) match. This option allows you to have a bit more finer-grained control over identifiers, letting you ban (or force) certain patterns and substrings. Accepts an object with the following properties: @@ -113,7 +117,7 @@ Accepts an object with the following properties: - `regex` - a string that is then passed into RegExp to create a new regular expression: `new RegExp(regex)` - `match` - true if the identifier _must_ match the `regex`, false if the identifier _must not_ match the `regex`. -### `filter` +#### `filter` The `filter` option operates similar to `custom`, accepting the same shaped object, except that it controls if the rest of the configuration should or should not be applied to an identifier. diff --git a/packages/eslint-plugin/docs/rules/prefer-readonly.md b/packages/eslint-plugin/docs/rules/prefer-readonly.md index 6e336d8c7956..52703de7d839 100644 --- a/packages/eslint-plugin/docs/rules/prefer-readonly.md +++ b/packages/eslint-plugin/docs/rules/prefer-readonly.md @@ -64,6 +64,8 @@ You may pass `"onlyInlineLambdas": true` as a rule option within an object to re Example of code for the `{ "onlyInlineLambdas": true }` options: + + #### ❌ Incorrect ```ts diff --git a/packages/eslint-plugin/docs/rules/unbound-method.md b/packages/eslint-plugin/docs/rules/unbound-method.md index aa9a8c40d090..60caa4018f36 100644 --- a/packages/eslint-plugin/docs/rules/unbound-method.md +++ b/packages/eslint-plugin/docs/rules/unbound-method.md @@ -94,7 +94,7 @@ const { log } = OtherClass; log(); ``` -### Example +## Example ```json {