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: docs/contributing/Pull_Requests.mdx
+28-1
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,26 @@ Please don't:
25
25
- Comment on a closed PR
26
26
- Reasoning: It is much easier for maintainers to not lose track of things if they are posted as issues. If you think there's a bug in typescript-eslint, the right way to ask is to [file a new issue](https://github.com/typescript-eslint/typescript-eslint/issues/new/choose). The issue templates include helpful & necessary practices such as making sure you're on the latest version of all our packages. You can provide the link to the relevant PR to add more context.
27
27
28
-
### Raising a PR
28
+
### Testing Changes
29
+
30
+
#### Code Coverage
31
+
32
+
We aim for 100% code coverage in all PRs when possible, except in the `website/` package.
33
+
Coverage reports are generated locally whenever `yarn test` is run.
34
+
35
+
The `codecov` bot also comments on each PR with its percentage, as well as links to the line-by-line coverage of each file touched by the PR.
36
+
37
+
#### Granular Unit Tests
38
+
39
+
Most tests in most packages are set up as small, self-contained unit tests.
40
+
We generally prefer that to keep tests and their failure reports granular.
41
+
42
+
For rule tests we recommend, when reasonable:
43
+
44
+
- Including both `valid` and `invalid` code changes in most PRs that affect rule behavior
45
+
- Limiting to one error per `invalid` case
46
+
47
+
### Raising the PR
29
48
30
49
Once your changes are ready, you can raise a PR! 🙌
31
50
The title of your PR should match the following format:
@@ -84,6 +103,14 @@ Once you've addressed all our feedback by making code changes and/or started a f
84
103
85
104
Once the feedback is addressed, and the PR is approved, we'll ensure the branch is up to date with `main`, and merge it for you.
86
105
106
+
#### Updating Over Time
107
+
108
+
You generally don't need to keep merging commits from `main` into your PR branch.
109
+
If you see merge conflicts or other intersections that worry you, then you can preemptively - but that's optional.
110
+
111
+
If we think merge conflicts need to be resolved in order to merge and/or review a PR, we might do that for you as a courtesy _if_ we have time.
112
+
If not, we may ask you to.
113
+
87
114
### Asking Questions
88
115
89
116
If you need help and/or have a question, posting a comment in the PR is a great way to do so.
Copy file name to clipboardExpand all lines: docs/maintenance/Releases.mdx
+1-1
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ In parallel to the general PR flow of the major version:
50
50
51
51
In parallel to the shared config changes work, make sure to test out the beta version on popular community projects willing to try it out.
52
52
53
-
1. Create a pinned issue offering to try out the new version's beta for consumers [example: [Try out v6 beta on various important community repos](https://github.com/typescript-eslint/typescript-eslint/issues/6760)]
53
+
1. Create a pinned issue offering to try out the new version's beta for consumers [example: [Try out v8 beta on various influential community repos](https://github.com/typescript-eslint/typescript-eslint/issues/9141)]
54
54
- Ask each community project if they'd be interested in trying out the new version, such as in their Discord or on their issue tracker.
55
55
- Each community project that's indicated willingness to receive a PR should have one.
56
56
1. Once the proposed _Shared Config Changes_ are merged into the `v${major}` branch, send a draft PR to each project with the new beta version.
Copy file name to clipboardExpand all lines: docs/troubleshooting/FAQ.mdx
+3-3
Original file line number
Diff line number
Diff line change
@@ -115,9 +115,9 @@ These errors are caused by an ESLint config requesting type information be gener
115
115
- If you **do** want to lint the file with [type-aware linting](../getting-started/Typed_Linting.mdx):
116
116
- Check the `include` option of each of the TSConfigs that you provide to `parserOptions.project` - you must ensure that all files match an `include` glob, or else our tooling will not be able to find it.
117
117
- If the file is a `.cjs`, `.js`, or `.mjs` file, make sure [`allowJs`](https://www.typescriptlang.org/tsconfig#allowJs) is enabled.
118
-
- If your file shouldn't be a part of one of your existing tsconfigs (for example, it is a script/tool local to the repo), then consider creating a new tsconfig (we advise calling it `tsconfig.eslint.json`) in your project root which lists this file in its `include`. For an example of this, you can check out the configuration we use in this repo:
- If your file shouldn't be a part of one of your existing tsconfigs (for example, it is a script/tool local to the repo), then consider creating a new tsconfig (we advise calling it `tsconfig.eslint.json`) in your project root which lists this file in its `include`. For an example of this, you can check out the configuration we previously used in this repo:
Copy file name to clipboardExpand all lines: docs/users/Shared_Configurations.mdx
+27-2
Original file line number
Diff line number
Diff line change
@@ -184,10 +184,15 @@ module.exports = {
184
184
Some rules also enabled in `recommended` default to more strict settings in this configuration.
185
185
See [`configs/strict.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/strict.ts) for the exact contents of this config.
186
186
187
-
:::caution
187
+
:::tip
188
188
We recommend a TypeScript project extend from `plugin:@typescript-eslint/strict` only if a nontrivial percentage of its developers are highly proficient in TypeScript.
189
189
:::
190
190
191
+
:::warning
192
+
This configuration is not considered "stable" under Semantic Versioning (semver).
193
+
Its enabled rules and/or their options may change outside of major version updates.
194
+
:::
195
+
191
196
### `strict-type-checked`
192
197
193
198
Contains all of `recommended`, `recommended-type-checked`, and `strict`, along with additional strict rules that require type information.
@@ -215,10 +220,15 @@ module.exports = {
215
220
Some rules also enabled in `recommended-type-checked` default to more strict settings in this configuration.
216
221
See [`configs/strict-type-checked.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/strict-type-checked.ts) for the exact contents of this config.
217
222
218
-
:::caution
223
+
:::tip
219
224
We recommend a TypeScript project extend from `plugin:@typescript-eslint/strict-type-checked` only if a nontrivial percentage of its developers are highly proficient in TypeScript.
220
225
:::
221
226
227
+
:::warning
228
+
This configuration is not considered "stable" under Semantic Versioning (semver).
229
+
Its enabled rules and/or their options may change outside of major version updates.
230
+
:::
231
+
222
232
### `stylistic`
223
233
224
234
Rules considered to be best practice for modern TypeScript codebases, but that do not impact program logic.
@@ -293,6 +303,11 @@ We do not recommend TypeScript projects extend from `plugin:@typescript-eslint/a
293
303
Many rules conflict with each other and/or are intended to be configured per-project.
294
304
:::
295
305
306
+
:::warning
307
+
This configuration is not considered "stable" under Semantic Versioning (semver).
308
+
Its enabled rules and/or their options may change outside of major version updates.
309
+
:::
310
+
296
311
### `base`
297
312
298
313
A minimal ruleset that sets only the required parser and plugin options needed to run typescript-eslint.
@@ -366,6 +381,11 @@ module.exports = {
366
381
</TabItem>
367
382
</Tabs>
368
383
384
+
:::warning
385
+
This configuration is not considered "stable" under Semantic Versioning (semver).
386
+
Its enabled rules and/or their options may change outside of major version updates.
387
+
:::
388
+
369
389
### `eslint-recommended`
370
390
371
391
This ruleset is meant to be used after extending `eslint:recommended`.
@@ -427,6 +447,11 @@ module.exports = {
427
447
428
448
See [`configs/strict-type-checked-only.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/strict-type-checked-only.ts) for the exact contents of this config.
429
449
450
+
:::warning
451
+
This configuration is not considered "stable" under Semantic Versioning (semver).
452
+
Its enabled rules and/or their options may change outside of major version updates.
453
+
:::
454
+
430
455
### `stylistic-type-checked-only`
431
456
432
457
A version of `stylistic` that _only_ contains type-checked rules and disables of any corresponding core ESLint rules.
Copy file name to clipboardExpand all lines: packages/eslint-plugin/docs/rules/restrict-template-expressions.mdx
+1-1
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ import TabItem from '@theme/TabItem';
10
10
> See **https://typescript-eslint.io/rules/restrict-template-expressions** for documentation.
11
11
12
12
JavaScript automatically [converts an object to a string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) in a string context, such as when concatenating it with a string using `+` or embedding it in a template literal using `${}`.
13
-
The default `toString()` method of objects returns`"[object Object]"`, which is often not what was intended.
13
+
The default `toString()` method of objects uses the format`"[object Object]"`, which is often not what was intended.
14
14
This rule reports on values used in a template literal string that aren't strings, optionally allowing other data types that provide useful stringification results.
Copy file name to clipboardExpand all lines: packages/eslint-plugin/docs/rules/sort-type-constituents.mdx
+6-9
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,12 @@ import TabItem from '@theme/TabItem';
9
9
>
10
10
> See **https://typescript-eslint.io/rules/sort-type-constituents** for documentation.
11
11
12
+
:::danger Deprecated
13
+
This rule has been deprecated in favor of the [`perfectionist/sort-intersection-types`](https://eslint-plugin-perfectionist.azat.io/rules/sort-intersection-types) and [`perfectionist/sort-union-types`](https://eslint-plugin-perfectionist.azat.io/rules/sort-union-types) rules.
14
+
15
+
See [Docs: Deprecate sort-type-constituents in favor of eslint-plugin-perfectionist](https://github.com/typescript-eslint/typescript-eslint/issues/8915) and [eslint-plugin: Feature freeze naming and sorting stylistic rules](https://github.com/typescript-eslint/typescript-eslint/issues/8792) for more information.
16
+
:::
17
+
12
18
Sorting union (`|`) and intersection (`&`) types can help:
13
19
14
20
- keep your codebase standardized
@@ -19,15 +25,6 @@ This rule reports on any types that aren't sorted alphabetically.
19
25
20
26
> Types are sorted case-insensitively and treating numbers like a human would, falling back to character code sorting in case of ties.
21
27
22
-
:::note
23
-
This rule is _feature frozen_: it will no longer receive new features such as new options.
24
-
It still will accept bug and documentation fixes for its existing area of features.
25
-
26
-
Stylistic rules that enforce naming and/or sorting conventions tend to grow incomprehensibly complex as increasingly obscure features are requested.
27
-
This rule has reached the limit of what is reasonable for the typescript-eslint project to maintain.
28
-
See [eslint-plugin: Feature freeze naming and sorting stylistic rules](https://github.com/typescript-eslint/typescript-eslint/issues/8792) for more information.
0 commit comments