8000 Merge branch 'main' into feat/no-array-delete · StyleShit/typescript-eslint@0d9642f · GitHub
[go: up one dir, main page]

Skip to content

Commit 0d9642f

Browse files
authored
Merge branch 'main' into feat/no-array-delete
2 parents 4b29b59 + 675e987 commit 0d9642f

File tree

134 files changed

+3204
-1322
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+3204
-1322
lines changed

.cspell.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"declarators",
7373
"destructure",
7474
"destructured",
75+
"destructures",
7576
"discoverability",
7677
"dprint",
7778
"errored",
@@ -121,6 +122,7 @@
121122
"stringification",
122123
"stringifying",
123124
"stringly",
125+
"subclassing",
124126
"superset",
125127
"thenables",
126128
"transpiled",
@@ -137,7 +139,6 @@
137139
"unfixable",
138140
"unoptimized",
139141
"unprefixed",
140-
"upcasting",
141142
"upsert",
142143
"warnonunsupportedtypescriptversion",
143144
"Zacher"

.lintstagedrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}": ["prettier --write"]
2+
"*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,mdx,css}": ["prettier --write"]
33
}

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,40 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [6.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v6.15.0...v6.16.0) (2023-12-25)
7+
8+
9+
### Bug Fixes
10+
11+
* **eslint-plugin:** [unbound-method] exempt all non-Promise built-in statics ([#8096](https://github.com/typescript-eslint/typescript-eslint/issues/8096)) ([3182959](https://github.com/typescript-eslint/typescript-eslint/commit/31829591e2c5cf6bdbdd5da23b12c5782f710fa5))
12+
13+
14+
### Features
15+
16+
* **eslint-plugin:** deprecate formatting (meta.type: layout) rules ([#8073 10000 ](https://github.com/typescript-eslint/typescript-eslint/issues/8073)) ([04dea84](https://github.com/typescript-eslint/typescript-eslint/commit/04dea84e8e934a415ec1381a90de3cde670d0dc3))
17+
* **eslint-plugin:** deprecate no-extra-semi in favor of ESLint Stylistic equivalent ([#8123](https://github.com/typescript-eslint/typescript-eslint/issues/8123)) ([9368bf3](https://github.com/typescript-eslint/typescript-eslint/commit/9368bf390afc58a19123782f8dff2bb5cdd3cccc))
18+
* **typescript-estree:** add allowDefaultProjectForFiles project service allowlist option ([#7752](https://github.com/typescript-eslint/typescript-eslint/issues/7752)) ([7ddadda](https://github.com/typescript-eslint/typescript-eslint/commit/7ddadda10845bc53967eeec83ba6b7cdc71a079f))
19+
20+
You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
21+
22+
23+
24+
25+
26+
# [6.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v6.14.0...v6.15.0) (2023-12-18)
27+
28+
29+
### Features
30+
31+
* **eslint-plugin:** [no-useless-template-literals] add new rule ([#7957](https://github.com/typescript-eslint/typescript-eslint/issues/7957)) ([ff75785](https://github.com/typescript-eslint/typescript-eslint/commit/ff75785f4c6cc41999f8ce946bfca469d6e40e50)), closes [#2846](https://github.com/typescript-eslint/typescript-eslint/issues/2846)
32+
* require-array-sort-compare + toSorted ([#8052](https://github.com/typescript-eslint/typescript-eslint/issues/8052)) ([c9661c8](https://github.com/typescript-eslint/typescript-eslint/commit/c9661c8bbf048e9fa3ef55985e1e2e82bc098b1a))
33+
34+
You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
35+
36+
37+
38+
39+
640
# [6.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v6.13.2...v6.14.0) (2023-12-11)
741

842

docs/Maintenance.mdx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,32 @@ We keep it in the open for visibility into our processes.
1212
If you're reading this as a new maintainer: welcome!
1313
We're happy to have you! ❤️‍🔥
1414
:::
15+
16+
## Governance
17+
18+
We follow a loose governance model that covers roles on the maintenance team and their associated responsibilities.
19+
We see a few major benefits from doing so:
20+
21+
- We want it to be clear how & why we do the things we do _(especially around compensation and expectations around roles)_
22+
- We want community input to make sure we're doing things the right way & focusing on truly useful improvements
23+
- As we add to the processes over time, it'll be easier to make those changes clear & reviewable by everyone
24+
25+
The following pages are a rough "v1.x" of our governance.
26+
We do our best to roughly adhere to this model - though at times we may shortcut tasks if there is no downside in doing so.
27+
28+
### Changes to Governance
29+
30+
Any changes to this document will be posted for open discussion on the [typescript-eslint GitHub Discussions](https://github.com/typescript-eslint/typescript-eslint/discussions) and kept open for at least one month.
31+
The discussion will be shared at the beginning, middle, and end of that month on Discord and all our social media accounts.
32+
33+
## Providing Feedback
34+
35+
We're always receptive to suggestions on how to improve our processes!
36+
For general feedback, we'd suggest posting in the [`#development` channel on Discord](https://discord.com/channels/1026804805894672454/1088474511759917106).
37+
We can help you turn that into a GitHub discussion.
38+
39+
:::note
40+
Please be kind: open source governance is an unsolved challenge.
41+
We might not know what impractical or non-ideal things we're doing.
42+
If there's anything sensitive you don't feel comfortable talking about in public, you can always DM or email one of the maintainers privately.
43+
:::

docs/linting/Troubleshooting.mdx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,27 @@ module.exports = {
153153
};
154154
```
155155

156+
## typescript-eslint thinks my variable is never nullish / is `any` / etc., but that is clearly not the case to me
157+
158+
Our type-aware rules almost always trust the type information provided by the TypeScript compiler. Therefore, an easy way to check if our rule is behaving correctly is to inspect the type of the variable in question, such as by hovering over it in your IDE.
159+
160+
If the IDE also shows that the type is never nullish / is `any`, you need to fix the type. A very common case is with the [`no-unnecessary-condition`](/rules/no-unnecessary-condition) rule. Take this code for example:
161+
162+
```ts
163+
let condition = false;
164+
165+
const f = () => (condition = true);
166+
f();
167+
168+
if (condition) {
169+
//^^^^^^^^^ Unnecessary conditional, value is always falsy.
170+
}
171+
```
172+
173+
You can see that the type of `condition` is actually the literal type `false` by hovering over it in your IDE. In this case, typescript-eslint cannot possible know better than TypeScript itself, so you need to fix the report by fixing the type, such as through an assertion (`let condition = false as boolean`).
174+
175+
If the IDE provides different type information from typescript-eslint's report, then make sure that the TypeScript setup used for your IDE, typescript-eslint, and `tsc` are the same: the same TypeScript version, the same type-checking compiler options, and the same files being included in the project. For example, if a type is declared in another file but that file is not included, the type will become `any`, and cause our `no-unsafe-*` rules to report.
176+
156177
## I use a framework (like Vue) that requires custom file extensions, and I get errors like "You should add `parserOptions.extraFileExtensions` to your config"
157178

158179
You can use `parserOptions.extraFileExtensions` to specify an array of non-TypeScript extensions to allow, for example:
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
---
2+
id: contributor-tiers
3+
title: Contributor Tiers
4+
---
5+
6+
These tiers of contributors, committers, and maintainers roughly reflect how we've worked the past several years.
7+
8+
<table>
9+
<thead>
10+
<tr>
11+
<th>Tier</th>
12+
<th>Entry Requirements</th>
13+
<th>Monthly Expectations</th>
14+
<th>Monthly Reimbursement</th>
15+
</tr>
16+
</thead>
17+
<tbody>
18+
<tr>
19+
<th>Contributor</th>
20+
<td>1 point</td>
21+
<td>
22+
<em>(none)</em>
23+
</td>
24+
<td>
25+
<em>(none)</em>
26+
</td>
27+
</tr>
28+
<tr>
29+
<th>Code Contributor</th>
30+
<td>1 point in pull requests</td>
31+
<td>
32+
<em>(none)</em>
33+
</td>
34+
<td>
35+
<em>(none)</em>
36+
</td>
37+
</tr>
38+
<tr>
39+
<th>Committer</th>
40+
<td>
41+
~5 points in issues
42+
<br />
43+
~5 points in pull requests
44+
<br />
45+
~15 points total
46+
<br />2 of 4 consecutive active months
47+
</td>
48+
<td>~10 points</td>
49+
<td>~1 share / active month</td>
50+
</tr>
51+
<tr>
52+
<th>Maintainer</th>
53+
<td>
54+
~10 points in issues
55+
<br />
56+
~10 points in pull requests
57+
<br />
58+
~30 points total
59+
<br />3 of 6 active months
60+
</td>
61+
<td>~20 points</td>
62+
<td>~2 shares / active month</td>
63+
</tr>
64+
</tbody>
65+
</table>
66+
67+
:::note
68+
We treat everything here as approximate numbers.
69+
We're a small enough team to informally discuss changes ad hoc and allow off-by-one-or-two months.
70+
:::
71+
72+
## Pointing
73+
74+
Although it's impossible to accurately estimate software projects, we want to roughly establish expectations of effort+time spent on the tiers.
75+
These are all rough estimations and should be taken as approximate starting guides to consider.
76+
77+
We treat both the creation and review of issues and PRs along the rough scale of:
78+
79+
<table>
80+
<thead>
81+
<tr>
82+
<th>Size</th>
83+
<th>Description</th>
84+
<th>Points</th>
85+
<th>Examples</th>
86+
</tr>
87+
</thead>
88+
<tbody>
89+
<tr>
90+
<th>Trivial</th>
91+
<td>Small typos or single-file bugfixes</td>
92+
<td>1</td>
93+
<td>
94+
<a href="https://github.com/typescript-eslint/typescript-eslint/pull/6976">
95+
#6976
96+
</a>
97+
, <a href="https://github.com/typescript-eslint/typescript-eslint/issues/6992">#6992</a>
98+
</td>
99+
</tr>
100+
<tr>
101+
<th>Straightforward</th>
102+
<td>2-3 files at most, with minimal logical changes</td>
103+
<td>2</td>
104+
<td>
105+
<a href="https://github.com/typescript-eslint/typescript-eslint/pull/6780">
106+
#6780
107+
</a>
108+
, <a href="https://github.com/typescript-eslint/typescript-eslint/pull/6910">#6910</a>
109+
</td>
110+
</tr>
111+
<tr>
112+
<th>Large</th>
113+
<td>Multi-file logical changes that require real review+thought</td>
114+
<td>3</td>
115+
<td>
116+
<a href="https://github.com/typescript-eslint/typescript-eslint/pull/6107">
117+
#6107
118+
</a>
119+
, <a href="https://github.com/typescript-eslint/typescript-eslint/pull/6907">#6907</a>
120+
</td>
121+
</tr>
122+
<tr>
123+
<th>Unusual</th>
124+
<td>Dozen+ file logical changes that require deep investigation</td>
125+
<td>≥5*</td>
126+
<td>
127+
<a href="https://github.com/typescript-eslint/typescript-eslint/pull/6084">
128+
#6084
129+
</a>
130+
, <a href="https://github.com/typescript-eslint/typescript-eslint/pull/6777">#6777</a>
131+
</td>
132+
</tr>
133+
</tbody>
134+
</table>
135+
136+
> \*Unusually large efforts may be >5 points at maintainer discretion depending on time spent.
137+
138+
Any other activities (e.g. responding to Discord threads, working on upstream dependencies, …) should be treated as gaining points equal to their nearest equivalent point task in terms of complexity and effort.
139+
140+
## Advancement
141+
142+
Each tier corresponds to a role on Discord and GitHub.
143+
When you first hit a tier, you can post in the [`#roles` channel on Discord](https://discord.com/channels/1026804805894672454/1184219870691328051).
144+
145+
We will confirm privately that you've hit the intent of the contribution tiers.
146+
We'll then grant you the role on Discord and GitHub and profusely thank you for everything you've done. ❤️
147+
148+
### Recognition
149+
150+
Depending on the tier you reach, you can also provide information for an upcoming _Team_ page:
151+
152+
- Contributor and Code Contributor: Preferred photo, name, social media handles
153+
- Committer and Maintainer: ~2 paragraph bio of yourself
154+
155+
See existing bios for examples of what to put.
156+
157+
:::note
158+
You can decline to opt into the Discord role or site recognition, and you can always opt out after the fact.
159+
Nothing is mandatory.
160+
We just like including recognition as thanks for working with us. 💕
161+
:::
162+
163+
## Reimbursement
164+
165+
Team members will be reimbursed the minimum of their activity level and their tier.
166+
Each month:
167+
168+
- Committers and maintainers who hit their expectation receive their full shares
169+
- Committers and maintainers who hit roughly half their expectation receive half shares
170+
171+
Reimbursements are generally handled through [our Open Collective page](https://opencollective.com/typescript-eslint).
172+
173+
### Community Reimbursements
174+
175+
Contributors who contribute nontrivial changes in a month (roughly ≥5 points and at least one _Large_ item) may be privately nominated at any time by a committer or maintainer to be reimbursed at the equivalent shares.
176+
177+
Our intention is to always do this for contributors who submit _Large_ or greater contributions and don't need significant assistance in getting them merged.

docs/maintenance/Governance.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
id: governance
3+
title: Governance
4+
---

docs/maintenance/Issues.mdx

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,25 @@ title: Issues
55

66
This document serves as a guide for how you might manage our [GitHub Issues](https://docs.github.com/issues), also known as issue triaging.
77

8-
Use your best judgement when triaging issues, and most of all remember to be **kind, friendly, and encouraging** when responding to users.
8+
Use your best judgement when triaging issues, and most of all remember to be **encouraging, friendly, and kind** when responding to users.
99
Many users are new to open source and/or typed linting.
1010
It's imperative we give them a positive, uplifting experience.
1111

1212
:::tip
1313
If you're ever unsure on any part of issue management, don't hesitate to loop in a maintainer that has more context to help!
1414
:::
1515

16+
## Governance
17+
18+
Per the scales from [Contribution Tiers > Pointing](./Contributor_Tiers.mdx#pointing):
19+
20+
- Straightforward: at reviewer discretion, may be marked as approved by any committer or maintainer.
21+
This includes docs enhancements, bug fixes, and feature additions.
22+
- Non-straightforward: may be marked as approved with either two committer approvals or one maintainer approval.
23+
These include significant internal refactors and non-breaking public API changes.
24+
- "Unusual"-categorized: require a public discussion followed by two maintainer approvals.
25+
These include significant refactors with cross-project and public API ramifications.
26+
1627
## Issue Flow
1728

1829
:::note
@@ -21,17 +32,17 @@ Don't treat these as exact responses you must use: they're just a starting copy+
2132
Please do adopt your specific responses to your personal tone and to match the thread for non-straightforward issues.
2233
:::
2334

24-
[Issues pending triage](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aopen+is%3Aissue+label%3Atriage) are searchable the `triage` label.
35+
[Issues pending triage](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aopen+is%3Aissue+label%3Atriage) are searchable with the `triage` label.
2536
That label is added automatically when a new issue is created.
2637
Most issues go through the following review flow when created or updated:
2738

2839
1. A maintainer ensures the issue is valid:
2940
- If the poster didn't fill out an appropriate template with enough information:
30-
- Add the `please fill out the template` and `awaiting response` labels
41+
- Add the `please fill out the template` and `awaiting response` labels, and remove the `triage` label
3142
- Ask the poster for more information using a _Needs More Info_ response
3243
- If it's a duplicate of an issue that already exists:
33-
- Add the `duplicate` label and remove the `bug` label
34-
- If it's an obvious duplicate, post a _Clearly Duplicate Issue_ response
44+
- Add the `duplicate` label and remove the `triage` label
45+
- If it's an obvious duplicate, post a _Clearly Duplicate Issue_ response linking to the existing issue
3546
- If it's not an obvious duplicate, link to the existing issue and explain why
3647
- If the code is working as intended:
3748
- Add the `working as intended` label and remove the `bug` and `triage` labels
@@ -135,6 +146,6 @@ Every so often, we like to [search for open issues `awaiting response`](https://
135146
Our flow for issues that have been waiting for >=1 month is:
136147

137148
1. Ping the author with a message like the _Checking In_ template
138-
2. Add the `stale` label to the issue
139-
3. Wait 2 weeks
140-
4. If they still haven't responded, close the issue with a message like the _Pruning Stale Issue_ template
149+
1. Add the `stale` label to the issue
150+
1. Wait 2 weeks
151+
1. If they still haven't responded, close the issue with a message like the _Pruning Stale Issue_ template

docs/maintenance/Pull_Requests.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ It's imperative we give them a positive, uplifting experience.
1313
If you're ever unsure on any part of PR reviews, don't hesitate to loop in a maintainer that has more context to help!
1414
:::
1515

16+
## Governance
17+
18+
Per the scales from [Contribution Tiers > Pointing](./Contributor_Tiers.mdx#pointing):
19+
20+
- Straightforward: At reviewer discretion, may be merged with a single approval by any committer or maintainer.
21+
This includes docs enhancements, bug fixes, and feature additions.
22+
- Non-straightforward: may be merged with either two committer approvals or one maintainer approval.
23+
These include multi-package internal refactors and non-breaking public API changes.
24+
- "Unusual"-categorized: require two maintainer approvals.
25+
These include significant refactors with cross-project and public API ramifications.
26+
1627
## PR Flow
1728

1829
:::note

0 commit comments

Comments
 (0)
0