You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: decisions/004-types.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -26,13 +26,13 @@ We do not intend to take over full maintenance of `@types/eslint`. Instead, we w
26
26
27
27
For the ESLint team, this decision will:
28
28
29
-
-Ensure we have control over our type definitions.
30
-
-Allow us to design a more coherent and well-integrated type system in the new `@eslint/core`.
31
-
-Provide a clear path for integrating these types with `@types/eslint`, improving consistency across the ecosystem.
29
+
- Ensure we have control over our type definitions.
30
+
- Allow us to design a more coherent and well-integrated type system in the new `@eslint/core`.
31
+
- Provide a clear path for integrating these types with `@types/eslint`, improving consistency across the ecosystem.
32
32
33
33
For the community, this decision may:
34
34
35
-
-Require adjustments to adapt to the new type definitions in `@eslint/core`.
36
-
-Improve the accuracy and reliability of type definitions used in ESLint-related projects.
35
+
- Require adjustments to adapt to the new type definitions in `@eslint/core`.
36
+
- Improve the accuracy and reliability of type definitions used in ESLint-related projects.
37
37
38
38
We recognize that this may frustrate or anger some contributors, but we believe that this approach balances the need for accurate type definitions with the practicalities of maintaining a complex project like ESLint.
Copy file name to clipboardExpand all lines: packages/compat/README.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -30,10 +30,10 @@ deno add @eslint/compat
30
30
31
31
This package exports the following functions in both ESM and CommonJS format:
32
32
33
-
-`fixupRule(rule)` - wraps the given rule in a compatibility layer and returns the result
34
-
-`fixupPluginRules(plugin)` - wraps each rule in the given plugin using `fixupRule()` and returns a new object that represents the plugin with the fixed-up rules
35
-
-`fixupConfigRules(configs)` - wraps all plugins found in an array of config objects using `fixupPluginRules()`
36
-
-`includeIgnoreFile(path)` - reads an ignore file (like `.gitignore`) and converts the patterns into the correct format for the config file
33
+
-`fixupRule(rule)` - wraps the given rule in a compatibility layer and returns the result
34
+
-`fixupPluginRules(plugin)` - wraps each rule in the given plugin using `fixupRule()` and returns a new object that represents the plugin with the fixed-up rules
35
+
-`fixupConfigRules(configs)` - wraps all plugins found in an array of config objects using `fixupPluginRules()`
36
+
-`includeIgnoreFile(path)` - reads an ignore file (like `.gitignore`) and converts the patterns into the correct format for the config file
Copy file name to clipboardExpand all lines: packages/config-array/README.md
+17-17Lines changed: 17 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -283,10 +283,10 @@ The config array always returns an object, even if there are no configs matching
283
283
284
284
A few things to keep in mind:
285
285
286
-
-If a filename is not an absolute path, it will be resolved relative to the base path directory.
287
-
-The returned config object never has `files`, `ignores`, or `name` properties; the only properties on the object will be the other configuration options specified.
288
-
-The config array caches configs, so subsequent calls to `getConfig()` with the same filename will return in a fast lookup rather than another calculation.
289
-
-A config will only be generated if the filename matches an entry in a `files` key. A config will not be generated without matching a `files` key (configs without a `files` key are only applied when another config with a `files` key is applied; configs without `files` are never applied on their own). Any config with a `files` key entry that is `*` or ends with `/**` or `/*` will only be applied if another entry in the same `files` key matches or another config matches.
286
+
- If a filename is not an absolute path, it will be resolved relative to the base path directory.
287
+
- The returned config object never has `files`, `ignores`, or `name` properties; the only properties on the object will be the other configuration options specified.
288
+
- The config array caches configs, so subsequent calls to `getConfig()` with the same filename will return in a fast lookup rather than another calculation.
289
+
- A config will only be generated if the filename matches an entry in a `files` key. A config will not be generated without matching a `files` key (configs without a `files` key are only applied when another config with a `files` key is applied; configs without `files` are never applied on their own). Any config with a `files` key entry that is `*` or ends with `/**` or `/*` will only be applied if another entry in the same `files` key matches or another config matches.
A file is considered ignored if any of the following is true:
300
300
301
-
-**It's parent directory is ignored.** For example, if `foo` is in `ignores`, then `foo/a.js` is considered ignored.
302
-
-**It has an ancestor directory that is ignored.** For example, if `foo` is in `ignores`, then `foo/baz/a.js` is considered ignored.
303
-
-**It matches an ignored file pattern.** For example, if `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored.
304
-
-**If it matches an entry in `files` and also in `ignores`.** For example, if `**/*.js` is in `files` and `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored.
305
-
-**The file is outside the `basePath`.** If the `basePath` is `/usr/me`, then `/foo/a.js` is considered ignored.
301
+
-**It's parent directory is ignored.** For example, if `foo` is in `ignores`, then `foo/a.js` is considered ignored.
302
+
-**It has an ancestor directory that is ignored.** For example, if `foo` is in `ignores`, then `foo/baz/a.js` is considered ignored.
303
+
-**It matches an ignored file pattern.** For example, if `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored.
304
+
-**If it matches an entry in `files` and also in `ignores`.** For example, if `**/*.js` is in `files` and `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored.
305
+
-**The file is outside the `basePath`.** If the `basePath` is `/usr/me`, then `/foo/a.js` is considered ignored.
306
306
307
307
For directories, use the `isDirectoryIgnored()` method and pass in the path of any directory, as in this example:
A directory is considered ignored if any of the following is true:
314
314
315
-
-**It's parent directory is ignored.** For example, if `foo` is in `ignores`, then `foo/baz` is considered ignored.
316
-
-**It has an ancestor directory that is ignored.** For example, if `foo` is in `ignores`, then `foo/bar/baz/a.js` is considered ignored.
317
-
-**It matches and ignored file pattern.** For example, if `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored.
318
-
-**If it matches an entry in `files` and also in `ignores`.** For example, if `**/*.js` is in `files` and `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored.
319
-
-**The file is outside the `basePath`.** If the `basePath` is `/usr/me`, then `/foo/a.js` is considered ignored.
315
+
-**It's parent directory is ignored.** For example, if `foo` is in `ignores`, then `foo/baz` is considered ignored.
316
+
-**It has an ancestor directory that is ignored.** For example, if `foo` is in `ignores`, then `foo/bar/baz/a.js` is considered ignored.
317
+
-**It matches and ignored file pattern.** For example, if `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored.
318
+
-**If it matches an entry in `files` and also in `ignores`.** For example, if `**/*.js` is in `files` and `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored.
319
+
-**The file is outside the `basePath`.** If the `basePath` is `/usr/me`, then `/foo/a.js` is considered ignored.
320
320
321
321
**Important:** A pattern such as `foo/**` means that `foo` and `foo/` are _not_ ignored whereas `foo/bar` is ignored. If you want to ignore `foo` and all of its subdirectories, use the pattern `foo` or `foo/` in `ignores`.
322
322
@@ -331,9 +331,9 @@ Each `ConfigArray` aggressively caches configuration objects to avoid unnecessar
331
331
332
332
The design of this project was influenced by feedback on the ESLint RFC, and incorporates ideas from:
Copy file name to clipboardExpand all lines: packages/migrate-config/README.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -10,9 +10,9 @@ This package aids in the migration of the legacy ESLint configuration file forma
10
10
11
11
This tool currently works well for the following config file formats:
12
12
13
-
-`.eslintrc`
14
-
-`.eslintrc.json`
15
-
-`.eslintrc.yml`
13
+
-`.eslintrc`
14
+
-`.eslintrc.json`
15
+
-`.eslintrc.yml`
16
16
17
17
If you are using a JavaScript configuration file (`.eslintrc.js`, `.eslintrc.cjs`, `.eslintrc.mjs`), this tool currently is only capable of migrating the _evaluated_ configuration. That means any logic you may have inside of the file will be lost. If your configuration file is mostly static, then you'll get a good result; if your configuration file is more complex (using functions, calculating paths, etc.) then this tool will not provide an equivalent configuration file.
Copy file name to clipboardExpand all lines: packages/plugin-kit/README.md
+14-14Lines changed: 14 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -28,10 +28,10 @@ deno add @eslint/plugin-kit
28
28
29
29
This package exports the following utilities:
30
30
31
-
-`ConfigCommentParser` - used to parse ESLint configuration comments (i.e., `/* eslint-disable rule */`)
32
-
-`VisitNodeStep` and `CallMethodStep` - used to help implement `SourceCode#traverse()`
33
-
-`Directive` - used to help implement `SourceCode#getDisableDirectives()`
34
-
-`TextSourceCodeBase` - base class to help implement the `SourceCode` interface
31
+
-`ConfigCommentParser` - used to parse ESLint configuration comments (i.e., `/* eslint-disable rule */`)
32
+
-`VisitNodeStep` and `CallMethodStep` - used to help implement `SourceCode#traverse()`
33
+
-`Directive` - used to help implement `SourceCode#getDisableDirectives()`
34
+
-`TextSourceCodeBase` - base class to help implement the `SourceCode` interface
35
35
36
36
### `ConfigCommentParser`
37
37
@@ -85,9 +85,9 @@ The `VisitNodeStep` and `CallMethodStep` classes represent steps in the traversa
85
85
86
86
The `VisitNodeStep` class is the more common of the two, where you are describing a visit to a particular node during the traversal. The constructor accepts three arguments:
87
87
88
-
-`target` - the node being visited. This is used to determine the method to call inside of a rule. For instance, if the node's type is `Literal` then ESLint will call a method named `Literal()` on the rule (if present).
89
-
-`phase` - either 1 for enter or 2 for exit.
90
-
-`args` - an array of arguments to pass into the visitor method of a rule.
88
+
-`target` - the node being visited. This is used to determine the method to call inside of a rule. For instance, if the node's type is `Literal` then ESLint will call a method named `Literal()` on the rule (if present).
89
+
-`phase` - either 1 for enter or 2 for exit.
90
+
-`args` - an array of arguments to pass into the visitor method of a rule.
91
91
92
92
For example:
93
93
@@ -115,8 +115,8 @@ class MySourceCode {
115
115
116
116
The `CallMethodStep` class is less common and is used to tell ESLint to call a specific method on the rule. The constructor accepts two arguments:
117
117
118
-
-`target` - the name of the method to call, frequently beginning with `"on"` such as `"onCodePathStart"`.
119
-
-`args` - an array of arguments to pass to the method.
118
+
-`target` - the name of the method to call, frequently beginning with `"on"` such as `"onCodePathStart"`.
119
+
-`args` - an array of arguments to pass to the method.
120
120
121
121
For example:
122
122
@@ -205,11 +205,11 @@ class MySourceCode {
205
205
206
206
The `TextSourceCodeBase` class is intended to be a base class that has several of the common members found in `SourceCode` objects already implemented. Those members are:
207
207
208
-
-`lines` - an array of text lines that is created automatically when the constructor is called.
209
-
-`getLoc(node)` - gets the location of a node. Works for nodes that have the ESLint-style `loc` property and nodes that have the Unist-style [`position` property](https://github.com/syntax-tree/unist?tab=readme-ov-file#position). If you're using an AST with a different location format, you'll still need to implement this method yourself.
210
-
-`getRange(node)` - gets the range of a node within the source text. Works for nodes that have the ESLint-style `range` property and nodes that have the Unist-style [`position` property](https://github.com/syntax-tree/unist?tab=readme-ov-file#position). If you're using an AST with a different range format, you'll still need to implement this method yourself.
211
-
-`getText(nodeOrToken, charsBefore, charsAfter)` - gets the source text for the given node or token that has range information attached. Optionally, can return additional characters before and after the given node or token. As long as `getRange()` is properly implemented, this method will just work.
212
-
-`getAncestors(node)` - returns the ancestry of the node. In order for this to work, you must implement the `getParent()` method yourself.
208
+
-`lines` - an array of text lines that is created automatically when the constructor is called.
209
+
-`getLoc(node)` - gets the location of a node. Works for nodes that have the ESLint-style `loc` property and nodes that have the Unist-style [`position` property](https://github.com/syntax-tree/unist?tab=readme-ov-file#position). If you're using an AST with a different location format, you'll still need to implement this method yourself.
210
+
-`getRange(node)` - gets the range of a node within the source text. Works for nodes that have the ESLint-style `range` property and nodes that have the Unist-style [`position` property](https://github.com/syntax-tree/unist?tab=readme-ov-file#position). If you're using an AST with a different range format, you'll still need to implement this method yourself.
211
+
-`getText(nodeOrToken, charsBefore, charsAfter)` - gets the source text for the given node or token that has range information attached. Optionally, can return additional characters before and after the given node or token. As long as `getRange()` is properly implemented, this method will just work.
212
+
-`getAncestors(node)` - returns the ancestry of the node. In order for this to work, you must implement the `getParent()` method yourself.
0 commit comments