Skip to content

feat: v8 integration branch #9165

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

Merged
merged 129 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
6464df2
feat(typescript-estree): remove slow deprecated and isolated programs…
JoshuaKGoldberg Apr 15, 2024
b8e8853
fix(typescript-estree): add TSEnumBody node for TSEnumDeclaration bod…
JoshuaKGoldberg Apr 15, 2024
2d835ee
fix(typescript-estree): enable dot globs for project by default (#8818)
JoshuaKGoldberg Apr 19, 2024
1a22a53
feat(typescript-estree): split TSMappedType typeParameter into constr…
JoshuaKGoldberg Apr 19, 2024
adf8f3b
feat(eslint-plugin): remove formatting/layout rules (#8833)
JoshuaKGoldberg Apr 19, 2024
151cae2
feat(eslint-plugin): [prefer-nullish-coalescing] change ignoreConditi…
JoshuaKGoldberg Apr 22, 2024
61c2ee7
feat(eslint-plugin): deprecate no-loss-of-precision extension rule (#…
JoshuaKGoldberg Apr 22, 2024
f9520fe
Merge branch 'main' into v8
JoshuaKGoldberg Apr 22, 2024
bea2e44
chore(type-utils): remove getTypeArguments (#8938)
y-hsgw Apr 22, 2024
f4cbbe6
chore(type-utils)!: remove IsNullableTypeOptions interface (#8934)
thuchede Apr 23, 2024
8284a18
Merge branch 'main' into v8
JoshuaKGoldberg Apr 25, 2024
21abb00
Merge branch 'main' into v8
JoshuaKGoldberg Apr 26, 2024
67fbca5
feat(eslint-plugin): [no-unused-vars] align catch behavior to ESLint …
JoshuaKGoldberg Apr 26, 2024
3cdb011
chore: bump minimum versions for v8 (#8973)
JoshuaKGoldberg Apr 26, 2024
7bdd008
Merge branch 'main' into v8
JoshuaKGoldberg Apr 26, 2024
6028711
feat(utils): add Linter configType constructor option (#8999)
JoshuaKGoldberg Apr 26, 2024
5650142
feat(typescript-estree): rename automaticSingleRunInference to disall…
JoshuaKGoldberg Apr 26, 2024
571bb9d
feat(parser): always enable comment, loc, range, tokens (#8617)
JoshuaKGoldberg Apr 26, 2024
e21b26e
feat(utils): swap LegacyESLint out for FlatESLint as ESLint export (#…
JoshuaKGoldberg Apr 26, 2024
47d874d
test(rule-tester): update test config snapshots to include new disall…
auvred Apr 28, 2024
25a126b
Merge branch 'main' into v8
JoshuaKGoldberg Apr 29, 2024
1b36f83
chore: fix v8 branch snapshots for flat-config-types (#9029)
JoshuaKGoldberg Apr 29, 2024
496dd36
Merge branch 'main' into v8
JoshuaKGoldberg Apr 29, 2024
72d1066
docs: remove eslint v9 tracking issue from main readme for v8 (#9006)
kirkwaiblinger Apr 29, 2024
07044c6
feat(utils): remove deprecated context helpers (#9000)
abrahamguo Apr 30, 2024
b1c92d4
feat(utils): allow specifying additional rule meta.docs in RuleCreato…
JoshuaKGoldberg May 9, 2024
04f1938
Merge branch 'main'
JoshuaKGoldberg May 9, 2024
fd097ef
feat(eslint-plugin): split no-empty-object-type out from ban-types an…
JoshuaKGoldberg May 12, 2024
b765f7b
feat: support ESLint v9 (#9002)
JoshuaKGoldberg May 12, 2024
0d85360
Merge branch 'main' into v8
JoshuaKGoldberg May 12, 2024
94bd289
fix: correct eslint-plugin's peerDependency on parser@8 (#9089)
JoshuaKGoldberg May 13, 2024
5753fe5
fix(eslint-plugin): include alpha pre-releases in parser peer depende…
bachmacintosh May 15, 2024
5c80828
feat(rule-tester): support multipass fixes (#8883)
auvred May 16, 2024
87a0a48
Merge branch 'main'
JoshuaKGoldberg May 18, 2024
ad3ff43
feat(ast-spec): remove deprecated type params (#8933)
abrahamguo May 24, 2024
b9796c1
feat(typescript-estree): stabilize EXPERIMENTAL_useProjectService as …
JoshuaKGoldberg May 24, 2024
c0bf6fc
Merge branch 'main'
JoshuaKGoldberg May 26, 2024
e8e79e0
feat(eslint-plugin): remove deprecated no-throw-literal rule (#9092)
y-hsgw May 26, 2024
92d4a26
feat(typescript-estree): remove EXPERIMENTAL_useSourceOfProjectRefere…
JoshuaKGoldberg May 27, 2024
ae1414c
feat(eslint-plugin): apply initial config changes for v8 (#9079)
JoshuaKGoldberg May 27, 2024
d97366e
chore(eslint-plugin): deprecate no-var-requires in favor of no-requir…
arkapratimc May 28, 2024
4f0a46f
chore: use recommended config for Node.js 18 in TSConfig (#9113)
lesha1201 May 28, 2024
540d97e
chore: enable `prefer-object-has-own` ESLint rule (#9123)
lesha1201 May 28, 2024
c3031c8
Merge branch 'main'
JoshuaKGoldberg May 28, 2024
06b0e08
Two introduced lint suppressions
JoshuaKGoldberg May 28, 2024
713fc21
Update RuleTester.test.ts snapshots
JoshuaKGoldberg May 29, 2024
8897c14
fix(typescript-estree): pass extraFileExtensions to projectService (#…
alfredringstad May 29, 2024
04591f0
Merge branch 'main' into v8
JoshuaKGoldberg May 29, 2024
6966e3b
Fix eslint-plugin-internal tests, or maybe just made them worse...
JoshuaKGoldberg May 29, 2024
10aecc8
Fix a parse.test.ts spacing issue
JoshuaKGoldberg May 29, 2024
a42afd3
One more EXPERIMENTAL_ rename
JoshuaKGoldberg May 29, 2024
8d4bba9
fix snapshot ordering
JoshuaKGoldberg May 29, 2024
e3eb1ad
fix(rule-tester): set configType to eslintrc in Linter options (#9178)
JamesHenry May 30, 2024
f279b6d
docs: fix only-throw-error link to no-throw-literal
JoshuaKGoldberg May 30, 2024
7afd3f3
fix(rule-tester): re-apply updates from main (#9180)
JoshuaKGoldberg May 30, 2024
ebad5e4
Merge branch 'main'
JoshuaKGoldberg Jun 2, 2024
31e70cf
chore: fix introduced Object.hasOwn lint complaint
JoshuaKGoldberg Jun 2, 2024
b4fbf6d
Merge branch 'main' into v8
JoshuaKGoldberg Jun 3, 2024
7b6b8bc
feat(eslint-plugin): remove no-useless-template-literals (#9207)
y-hsgw Jun 4, 2024
b222625
Merge branch 'main'
JoshuaKGoldberg Jun 6, 2024
585423d
chore: fix test typing too
JoshuaKGoldberg Jun 6, 2024
8e95924
feat(eslint-plugin): [no-floating-promises] add 'allowForKnownSafeCal…
JoshuaKGoldberg Jun 8, 2024
3c3370f
feat(typescript-estree): also remove projectService in withoutProject…
JoshuaKGoldberg Jun 8, 2024
0f1b064
fix(types): allow ProjectServiceOptions for projectService (#9318)
JoshuaKGoldberg Jun 10, 2024
007850d
Merge branch 'main'
JoshuaKGoldberg Jun 12, 2024
5cd80ca
feat(eslint-plugin): replace ban-types with no-restricted-types, no-u…
JoshuaKGoldberg Jun 13, 2024
10f984e
chore: [no-empty-object-type] remove unused option in-type-alias-with…
kirkwaiblinger Jun 15, 2024
c170c3d
feat(typescript-estree): exposes ProjectService logs through the plug…
higherorderfunctor Jun 17, 2024
d1ddbc2
fix(typescript-estree): only run projectService setHostConfiguration …
higherorderfunctor Jun 22, 2024
ee46c9c
Merge branch 'main'
JoshuaKGoldberg Jun 22, 2024
9311c69
Merge branch 'main'
JoshuaKGoldberg Jun 24, 2024
cef031c
Test and link fixes
JoshuaKGoldberg Jun 24, 2024
51a74dc
More test fixes
JoshuaKGoldberg Jun 24, 2024
7dfceee
fix: bring back in allowdefaultprojectforfiles rename
JoshuaKGoldberg Jun 25, 2024
b8d1d39
feat(eslint-plugin): [no-unused-vars] add `reportUnusedIgnorePattern`…
bradzacher Jun 25, 2024
2cdf240
test(type-utils): skip mysteriously failing type unit tests (#9427)
JoshuaKGoldberg Jun 25, 2024
332a271
feat(eslint-plugin): [no-unused-vars] support `ignoreClassWithStaticI…
bradzacher Jun 25, 2024
ec20eaf
feat(eslint-plugin): [no-unused-vars] handle comma operator for assig…
bradzacher Jun 25, 2024
78ed7d4
feat(eslint-plugin): [no-unnecessary-type-parameters] initial impleme…
danvk Jun 26, 2024
1b4b4c2
feat(type-utils): remove getTokenAtPosition (#9444)
y-hsgw Jun 29, 2024
7812072
fix(eslint-plugin): correct rules.d.ts types to not rely on non-exist…
JoshuaKGoldberg Jun 29, 2024
afcfbfc
Merge branch 'main'
JoshuaKGoldberg Jun 29, 2024
924913d
feat(eslint-plugin): [no-unused-vars] report if var used only in type…
StyleShit Jun 30, 2024
9eb6cec
chore: revert "test(type-utils): skip mysteriously failing type unit …
auvred Jun 30, 2024
e088709
fix: disable `projectService` in `disabled-type-checked` shared confi…
auvred Jul 1, 2024
dfe9869
chore: add GitHub workflow to close issues resolved in `v8` branch (#…
auvred Jul 1, 2024
901f64f
chore: add necessary permissions to the `v8` issues autocloser workfl…
auvred Jul 1, 2024
f340033
chore: change the `v8` issue autocloser trigger to `pull_request_targ…
auvred Jul 1, 2024
9dce771
fix(eslint-plugin): remove duplicate import `RuleModuleWithMetaDocs` …
abrahamguo Jul 1, 2024
a846ffe
Merge branch 'main'
JoshuaKGoldberg Jul 5, 2024
0d70d62
chore: add missing rule test suggestions
JoshuaKGoldberg Jul 5, 2024
86811d7
chore: use eslint 9 internally (#9119)
abrahamguo Jul 6, 2024
1593840
Merge branch 'main'
JoshuaKGoldberg Jul 6, 2024
e0a435d
test(type-utils): disable automatic single run inference for isSymbol…
auvred Jul 8, 2024
d1d282e
test(eslint-plugin): update outdated docs.test.ts snapshots (#9522)
auvred Jul 8, 2024
46dd42f
docs: [no-wrapper-object-types] clean up a bit of phrasing (#9363)
kirkwaiblinger Jul 12, 2024
6bd4211
Merge branch 'main'
JoshuaKGoldberg Jul 13, 2024
0aa8eac
feat(eslint-plugin): [no-floating-promises] disable checkThenables by…
JoshuaKGoldberg Jul 14, 2024
78fd2f4
feat: stricter parent types for the AST (#9560)
bradzacher Jul 14, 2024
c365664
Merge branch 'main'
JoshuaKGoldberg Jul 17, 2024
8ea3108
chore: fix website lint
JoshuaKGoldberg Jul 18, 2024
8f712ee
fix(type-utils): also check declared modules for package names in Typ…
JoshuaKGoldberg Jul 18, 2024
850d909
Merge branch 'main' into v8
JoshuaKGoldberg Jul 18, 2024
d26e1d1
chore(website): correct version to be v8, not latest merged v7 (#9593)
JoshuaKGoldberg Jul 19, 2024
a3230a9
chore: fix inferSingleRun.test.ts merge type errors
JoshuaKGoldberg Jul 19, 2024
def1da1
fix(eslint-plugin): [no-unnecessary-template-expression] do not rende…
auvred Jul 20, 2024
6dc3240
docs: clarify projectService out-of-project remediation steps (#9585)
JoshuaKGoldberg Jul 21, 2024
97cb1a3
fix(typescript-estree): specific error for parserOptions.project not …
JoshuaKGoldberg Jul 21, 2024
fd22484
feat: speed up non-type-aware linting with project service (#8322)
yepitschunked Jul 21, 2024
ae980e3
Merge branch 'main'
JoshuaKGoldberg Jul 22, 2024
88a8673
feat(eslint-plugin): [return-await] add return-await to strict-type-c…
kirkwaiblinger Jul 22, 2024
87af726
fix(eslint-plugin): [no-unused-vars] incorporate upstream changes aro…
abrahamguo Jul 22, 2024
f3dfc0a
Merge branch 'main' into v8
JoshuaKGoldberg Jul 23, 2024
32a7a70
feat(rule-tester): switched to flat config (#9603)
JoshuaKGoldberg Jul 24, 2024
2b09d61
Merge branch 'main' into v8
JoshuaKGoldberg Jul 24, 2024
56ef573
Merge branch 'main'
JoshuaKGoldberg Jul 24, 2024
2a05336
fix(typescript-estree): adds support for project services using exten…
higherorderfunctor Jul 28, 2024
f38728c
Merge branch 'main' into v8
bradzacher Jul 29, 2024
3c4ff73
chore: fix lint errors
bradzacher Jul 29, 2024
37c10e8
fix(eslint-plugin): [no-misused-promises] perf: avoid getting types o…
bradzacher Jul 29, 2024
8197f71
docs: switch Typed Linting docs to project service (#9614)
JoshuaKGoldberg Jul 29, 2024
90432a2
feat(type-utils): support intersection types in TypeOrValueSpecifier …
JoshuaKGoldberg Jul 29, 2024
6cebdf6
feat(eslint-plugin): [no-unnecessary-type-parameters] promote to stri…
JoshuaKGoldberg Jul 29, 2024
838dd0c
chore: use parserOptions.projectService internally (#9659)
JoshuaKGoldberg Jul 30, 2024
1b0468e
Merge branch 'main'
JoshuaKGoldberg Jul 30, 2024
b8274d3
fix(rule-tester): provide Linter a cwd in its constructor (#9678)
JoshuaKGoldberg Jul 31, 2024
48fc385
fix(typescript-estree): factor tsconfigRootDir into allowDefaultProje…
JoshuaKGoldberg Jul 31, 2024
ce09260
docs(eslint-plugin): [no-unnecessary-type-parameters] add admonition …
kirkwaiblinger Jul 31, 2024
b413ec4
Merge branch 'main' into v8
JoshuaKGoldberg Jul 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
"words": [
"Airbnb",
"Airbnb's",
"ambiently",
"allowdefaultproject",
"allowdefaultprojectforfiles",
"ambiently",
"Arka",
Expand Down Expand Up @@ -98,6 +100,7 @@
"esquery",
"esrecurse",
"estree",
"extrafileextensions",
"falsiness",
"fisker",
"García",
Expand Down Expand Up @@ -145,6 +148,7 @@
"preact",
"Premade",
"prettier's",
"projectservice",
"quasis",
"Quickstart",
"Rebecca",
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/breaking-pr-check/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-check
/* eslint-disable jsdoc/no-types */
/* eslint-disable jsdoc/no-types, @typescript-eslint/no-require-imports */

const core = require('@actions/core');
const github = require('@actions/github');
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ jobs:
- name: Build
uses: ./.github/actions/prepare-build

- name: Run integrations tests
- name: Run integration tests
run: yarn test-integration
env:
CI: true
Expand Down Expand Up @@ -220,8 +220,8 @@ jobs:
# Sadly 1 day is the minimum
retention-days: 1

unit_tests_tsserver:
name: Run Unit Tests with Experimental TSServer
unit_tests_project_service:
name: Run Unit Tests with Project Service
needs: [build]
runs-on: ubuntu-latest
strategy:
Expand All @@ -245,7 +245,7 @@ jobs:
run: npx nx test ${{ matrix.package }} --coverage=false
env:
CI: true
TYPESCRIPT_ESLINT_EXPERIMENTAL_TSSERVER: true
TYPESCRIPT_ESLINT_PROJECT_SERVICE: true

upload_coverage:
name: Upload Codecov Coverage
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/close-v8-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Close issues related to a merged pull request based on v8 branch.

on:
pull_request_target:
types: [closed]
branches:
- v8

jobs:
close_v8_issue_on_pr_merge:
permissions:
issues: write
runs-on: ubuntu-latest
steps:
- name: Closes issues related to a merged pull request.
uses: ldez/gha-mjolnir@v1.4.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
<p align="center">
👆
</p>
<p align="center">
Using ESLint v9? See: <a href="https://github.com/typescript-eslint/typescript-eslint/issues/8211">ESLint v9 Support</a>.
</p>
<!-- markdownlint-enable MD033 -->

## Code Contributors
Expand Down
26 changes: 26 additions & 0 deletions docs/developers/Custom_Rules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,32 @@ export const rule = createRule<Options, MessageIds>({
});
```

#### Extra Rule Docs Types

By default, rule `meta.docs` is allowed to contain only `description` and `url` as described in [ESLint's Custom Rules > Rule Structure docs](https://eslint.org/docs/latest/extend/custom-rules#rule-structure).
Additional docs properties may be added as a type argument to `ESLintUtils.RuleCreator`:

```ts
interface MyPluginDocs {
recommended: boolean;
}

const createRule = ESLintUtils.RuleCreator<MyPluginDocs>(
name => `https://example.com/rule/${name}`,
);

createRule({
// ...
meta: {
docs: {
description: '...',
recommended: true,
},
// ...
},
});
```

### Undocumented Rules

Although it is generally not recommended to create custom rules without documentation, if you are sure you want to do this you can use the `ESLintUtils.RuleCreator.withoutDocs` function to directly create a rule.
Expand Down
21 changes: 13 additions & 8 deletions docs/getting-started/Typed_Linting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default tseslint.config(
{
languageOptions: {
parserOptions: {
project: true,
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
Expand All @@ -42,7 +42,7 @@ For CommonJS modules and/or older versions of Node.js, [use `__dirname` or an al
In more detail:

- `tseslint.configs.recommendedTypeChecked` is another [shared configuration](../users/Shared_Configurations.mdx) we provide. This one contains recommended rules that additionally require type information.
- `parserOptions.project: true` indicates to find the closest `tsconfig.json` for each source file (see [Parser#project](../packages/Parser.mdx#project)).
- `parserOptions.projectService: true` indicates to ask TypeScript's type checking service for each source file's type information (see [Parser#projectService](../packages/Parser.mdx#projectService)).
- `parserOptions.tsconfigRootDir` tells our parser the absolute path of your project's root directory (see [Parser#tsconfigRootDir](../packages/Parser.mdx#tsconfigrootdir)).

</TabItem>
Expand All @@ -65,7 +65,7 @@ module.exports = {
parser: '@typescript-eslint/parser',
// Added lines start
parserOptions: {
project: true,
projectService: true,
tsconfigRootDir: __dirname,
},
// Added lines end
Expand All @@ -76,7 +76,7 @@ module.exports = {
In more detail:

- `plugin:@typescript-eslint/recommended-type-checked` is another [shared configuration](../users/Shared_Configurations.mdx) we provide. This one contains recommended rules that additionally require type information.
- `parserOptions.project: true` indicates to find the closest `tsconfig.json` for each source file (see [Parser#project](../packages/Parser.mdx#project)).
- `parserOptions.projectService: true` indicates to ask TypeScript's type checking service for each source file's type information (see [Parser#projectService](../packages/Parser.mdx#projectService)).
- `parserOptions.tsconfigRootDir` tells our parser the absolute path of your project's root directory (see [Parser#tsconfigRootDir](../packages/Parser.mdx#tsconfigrootdir)).

</TabItem>
Expand Down Expand Up @@ -142,7 +142,11 @@ You can read more about the rules provided by typescript-eslint in our [rules do

### Can I customize the TSConfig used for typed linting?

The `project` option can be turned on with either:
Yes, but it's not recommended in most configurations.
`parserOptions.projectService` uses the same "project service" APIs used by editors such as VS Code to generate TypeScript's type information.
Using a different TSConfig runs the risk of providing different types for typed linting than what your editor or `tsc` see.

If you absolutely must, the `parserOptions.project` option can be used instead of `parserOptions.projectService` with either:

- `true`: to always use `tsconfig.json`s nearest to source files
- `string | string[]`: any number of glob paths to match TSConfig files relative to `parserOptions.tsconfigRootDir`, or the current working directory if that is not provided
Expand Down Expand Up @@ -182,7 +186,7 @@ module.exports = {
</TabItem>
</Tabs>

See [the `@typescript-eslint/parser` docs for more details](../packages/Parser.mdx#project).
See [the `@typescript-eslint/parser` `project` docs for more details](../packages/Parser.mdx#project).

:::note
If your project is a multi-package monorepo, see [our docs on configuring a monorepo](../troubleshooting/typed-linting/Monorepos.mdx).
Expand All @@ -203,7 +207,8 @@ export default tseslint.config(
{
languageOptions: {
parserOptions: {
project: true,
projectService: true,
tsconfigRootDir: import.meta.name,
},
},
},
Expand Down Expand Up @@ -254,7 +259,7 @@ If you use type-aware rules from other plugins, you will need to manually disabl
### How is performance?

Typed rules come with a catch.
By including `parserOptions.project` in your config, you incur the performance penalty of asking TypeScript to do a build of your project before ESLint can do its linting.
By using typed linting in your config, you incur the performance penalty of asking TypeScript to do a build of your project before ESLint can do its linting.
For small projects this takes a negligible amount of time (a few seconds or less); for large projects, it can take longer.

Most of our users do not mind this cost as the power and safety of type-aware static analysis rules is worth the tradeoff.
Expand Down
2 changes: 1 addition & 1 deletion docs/maintenance/Issues.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ For enhancements meant to limit which kinds of nodes the rule targets, mark the
#### 🚀 New Rules

We're generally accepting of new rules that meet the above feature request criteria.
The biggest exception is rules that can roughly be implemented with [`@typescript-eslint/ban-types`](/rules/ban-types) and/or [`no-restricted-syntax`](https://eslint.org/docs/latest/rules/no-restricted-syntax).
The biggest exception is rules that can roughly be implemented with [`@typescript-eslint/no-restricted-types`](/rules/no-restricted-types) and/or [`no-restricted-syntax`](https://eslint.org/docs/latest/rules/no-restricted-syntax).

## Pruning Old Issues

Expand Down
Loading
Loading