Skip to content
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

Bug: [no-useless-template-literals] Missing report for Infinity and NaN #8294

Closed
4 tasks done
StyleShit opened this issue Jan 23, 2024 · 0 comments · Fixed by #8295
Closed
4 tasks done

Bug: [no-useless-template-literals] Missing report for Infinity and NaN #8294

StyleShit opened this issue Jan 23, 2024 · 0 comments · Fixed by #8295
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@StyleShit
Copy link
Contributor

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Playground Link

https://typescript-eslint.io/play/#ts=5.3.3&showAST=es&fileType=.ts&code=AYEg3gkgdgZgllOAXAngX2AbgFCjAOQEN8NMg&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Jge1tmUSWWS18iALbF4AQ2G1Gw6BPioMkRNGgdokcGAC%2BIHUA&tsconfig=&tokens=false

Repro Code

`${Infinity}`;
`${NaN}`;

ESLint Config

module.exports = {
  parser: "@typescript-eslint/parser",
  rules: {
    "@typescript-eslint/no-useless-template-literals": ["error"],
  },
};

tsconfig

{
  "compilerOptions": {
    // ...
  }
}

Expected Result

Report on the nodes and suggest a fix

Actual Result

There is no report

Additional Info

Inspired by #8284 that made me curious 😅

@StyleShit StyleShit added bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Jan 23, 2024
StyleShit added a commit to StyleShit/typescript-eslint that referenced this issue Jan 23, 2024
StyleShit added a commit to StyleShit/typescript-eslint that referenced this issue Jan 23, 2024
@JoshuaKGoldberg JoshuaKGoldberg added accepting prs Go ahead, send a pull request that resolves this issue and removed triage Waiting for team members to take a look labels Jan 24, 2024
JoshuaKGoldberg pushed a commit that referenced this issue Jan 29, 2024
…NaN (#8295)

* fix(eslint-plugin): [no-useless-template-literals] report Infinity & NaN

Closes #8294

* remove unnecessary tests
danvk pushed a commit to danvk/typescript-eslint that referenced this issue Feb 4, 2024
…NaN (typescript-eslint#8295)

* fix(eslint-plugin): [no-useless-template-literals] report Infinity & NaN

Closes typescript-eslint#8294

* remove unnecessary tests
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2024
JoshuaKGoldberg added a commit that referenced this issue Jun 26, 2024
…ntation (#8173)

* new rule, pairing w/ josh

* start adding tests, discover some problesm

* failing testgs

* very simple version that fails with inferred return types

* some processing of inferred return types

* try to add inferred usages to count

* 11/12 passing!

* 12/12 pass

* weird circular JSON error

* oops

* add test with inferred tuple type

* add test with inferred tuple type

* failing test with inferred object type

* descend into object types

* copy over another test

* failing test case on method

* Run on MethodDefinition

* add TODO

* comment

* re-enable invalid eslint-plugin-etc test

* port one more

* shadowing test case

* port one more test

* port over DefinitelyTyped-tools tests; two failing

* resolve one failure

* resolve second failure

* enable two more tests

* one failing test from eslint-plugin-etc

* one more failing test

* full port of eslint-plugin-etc tests

* one failing test from ETS post

* fix previous error, expose a new one with a test

* resolve inferred return types on methods

* add both() function to test cases

* enable eslint rule, cleanup

* cleanup, add docs

* add to rules list

* generate configs

* update tests, docs

* Update packages/eslint-plugin/docs/rules/no-unnecessary-type-parameters.md

Co-authored-by: Josh Goldberg ✨ <[email protected]>

* Update packages/eslint-plugin/tests/rules/no-unnecessary-type-parameters.test.ts

Co-authored-by: Josh Goldberg ✨ <[email protected]>

* fix(utils): improve error message on typed rule with invalid parser (#8146)

* feat(utils): throw error on typed rule with invalid parser

* Switch to more informative error message

* fix tests

* chore: enable no-dynamic-delete internally (#7954)

* chore: rename release.ts to release.mts (#8204)

* chore: rename release.ts to release.mts

* Update tsconfig.eslint.json

Co-authored-by: auvred <[email protected]>

---------

Co-authored-by: auvred <[email protected]>

* chore: enable eslint-plugin-jsdoc internally (#8145)

* chore: enable eslint-plugin-jsdoc internally

* Disable jsdoc/check-param-names, with link to issue

* Sort jsdoc rule disables and add links to issues

* Switch typescript-estree-import.ts to line comments

* docs: document allowAutomaticSingleRunInference (#8138)

* docs: document allowAutomaticSingleRunInference

* so 'no' need

* chore: prevent a11y-alt-text-bot workflow when author is a bot (#8212)

* chore: prevent a11y-alt-text-bot workflow when author is a bot

* Update .github/workflows/a11y-alt-bot.yml

---------

Co-authored-by: Josh Goldberg ✨ <[email protected]>

* chore(typescript-estree): remove unnecessary old snapshots (#8198)

* chore(typescript-estree): remove unnecessary old snapshots

Co-authored-by: Brad Zacher <[email protected]>

* chore: remove unused jest include patterns

---------

Co-authored-by: Brad Zacher <[email protected]>

* fix(eslint-plugin): [no-non-null-assertion] provide valid fix when member access is on next line (#8185)

* fix(eslint-plugin): [no-non-null-assertion] provide valid fix when member access is on next line

* test: add new case

* fix(eslint-plugin): [no-unnecessary-condition] improve checking optional callee (#8178)

* fix(eslint-plugin): [prefer-readonly] support modifiers of unions and intersections (#8169)

* fix(eslint-plugin): [switch-exhaustiveness-check] fix new allowDefaultCaseForExhaustiveSwitch option (#8176)

* fix(allowDefaultCaseForExhaustiveSwitch): rule

* chore: format

* fix: add containsNonLiteralType

* chore: cleanup

* refactor: use type flags instead of strings

* Update packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts

* Update packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts

---------

Co-authored-by: Josh Goldberg ✨ <[email protected]>

* chore(deps): update dependency tsx to v4.7.0 (#8162)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore: fix yargs call in release script (#8221)

* chore: fix test formatting in prefer-readonly.test.ts (#8223)

* chore(release): publish 6.18.1

* feat(eslint-plugin): [prefer-promise-reject-errors] add rule (#8011)

* feat(eslint-plugin): [prefer-promise-reject-errors] new rule!

* test: ~100% coverage

* docs: add rule docs

* test: add some cases

* chore: lint --fix

* chore: reformat tests

* feat: add support for literal computed reject name

* chore: lint --fix

* refactor: get rid of one @ts-expect-error

* docs: refer to the original rule description

* test: add few cases

* docs: remove some examples

* refactor: move check if symbol is from default lib or not to new fn

* refactor: assert that rejectVariable is non-nullable

* chore: remove assertion in skipChainExpression

* test: specify error ranges for invalid test cases

* chore: format tests

* chore: remove unused check if variable reference is read or not

* chore: include rule to `strict-type-checked` config

* refactor: simplify isSymbolFromDefaultLibrary

* chore: remove ts-expect-error comment

* feat: add checks for Promise child classes and unions/intersections

* Update packages/eslint-plugin/docs/rules/prefer-promise-reject-errors.md

Co-authored-by: Josh Goldberg ✨ <[email protected]>

* refactor: `program` -> `services.program`

* refactor: split unreadable if condition

* docs: simplify examples

* refactor: rename `isBuiltinSymbolLike.ts` -> `builtinSymbolLikes.ts`

* perf: get type of `reject` callee lazily

* test: add cases with arrays,never,unknown

* feat: add support for `Readonly<Error>` and similar

* chore: fix lint issues

---------

Co-authored-by: Josh Goldberg ✨ <[email protected]>

* docs: base Testing Rules documentation (#8033)

* docs: base Testing Rules documentation

* fix(eslint-plugin): add no-unsafe-unary-minus, prefer-destructuring to disable-type-checked (#8038)

fix: add no-unsafe-unary-minus, prefer-destructuring to disable-type-checked

* docs: testing rules review changes + build callout

* docs(eslint-plugin): [require-array-sort-compare] sync rule description (#8061)

* chore: resolve internal lint issues with new no-useless-template-literals rule (#8060)

* docs(eslint-plugin): [require-array-sort-compare] generalize sort method names (#8062)

docs: streamline

* chore: update sponsors (#8069)

Co-authored-by: typescript-eslint[bot] <typescript-eslint[bot]@users.noreply.github.com>

* Update docs/contributing/local-development/Local_Linking.mdx

Co-authored-by: Josh Goldberg ✨ <[email protected]>

* docs: changed section name + callout type from caution to note

---------

Co-authored-by: Josh Goldberg ✨ <[email protected]>
Co-authored-by: auvred <[email protected]>
Co-authored-by: James <[email protected]>
Co-authored-by: typescript-eslint[bot] <53356952+typescript-eslint[bot]@users.noreply.github.com>
Co-authored-by: typescript-eslint[bot] <typescript-eslint[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Costa Moura <[email protected]>

* feat(eslint-plugin): [no-array-delete] add new rule (#8067)

* feat(eslint-plugin): [no-array-delete] add new rule

* small refactor

* add more cases

* fix docs

* fix message

* use suggestion instead of fix

* added more test cases

* remove redundant condition

* keep comments

* docs: force space after await in no-floating-promises snippet (#8228)

force space after await

* feat(eslint-plugin): [no-useless-template-literals] add fix suggestions (#8065)

* feat(eslint-plugin): [no-useless-template-literals] add fix suggestions

* change message

* add quasis to cspell

* add some test cases

* use fix instead of suggestion

* docs: link version in website header to GitHub release (#8236)

* fix(typescript-estree): add JSDocParsingMode enum merge for typescript/lib/tsserverlibrary (#8193)

* fix(eslint-plugin): [no-unnecessary-type-assertion] detect unnecessary non-null-assertion on a call expression (#8143)

* feat(eslint-plugin): [no-unnecessary-type-assertion] add `Identifier` check

* feat(eslint-plugin): [no-unnecessary-type-assertion] update fixer for `CallExpression`

* feat(eslint-plugin): [no-unnecessary-type-assertion] add test case

* feat(eslint-plugin): [no-unnecessary-type-assertion] fit more cases

* feat(eslint-plugin): [no-unnecessary-type-assertion] add valid test cases

* fix: fix a gap and add tests

* fix: typo

* fix(typescript-estree): disallow `using` as the variable keyword for `for..in` loops (#7649)

Co-authored-by: Brad Zacher <[email protected]>

* fix(eslint-plugin): [no-unnecesary-type-assertion] treat unknown/any as nullable (#8089)

Co-authored-by: Brad Zacher <[email protected]>

* fix(typescript-estree): fix incorrect backwards-compat augmentation in TS 5.3 (#8181)

* chore: make lint job use eslint-plugin outputs as inputs (#8245)

* chore(release): publish 6.19.0

* fix(type-utils): preventing isUnsafeAssignment infinite recursive calls (#8237)

* fix(type-utils): preventing isUnsafeAssignment infinite recursive calls

* chore: apply reviews

* fix(eslint-plugin): [no-unnecessary-condition] fix false positive for type variable (#8235)

* fix(eslint-plugin): [no-unnecessary-condition] fix false positive for type variable

* chore: simplify test cases

* chore(release): publish 6.19.1

* fix(eslint-plugin): [no-useless-template-literals] incorrect bigint autofix result (#8283)

* docs: underline URLs, change contrast in syntax highlighting (#8225)

* Add underlines on all links other than menu, table of contents

* Fix comment in css
Include next page in comment as I forgot to include it beforehand

* Add comment whitespace

* Remove underlines from navbar, buttons

* Fix CSS in blog page causing headers, sidebar links to be underlined

* Alter CSS to change only anchor elements inside .markdown class

* Update styles to change color contrast in syntax highlighting

* chore: update sponsors (#8303)

Co-authored-by: typescript-eslint[bot] <typescript-eslint[bot]@users.noreply.github.com>

* docs: add `import/no-unresolved` to perf troubleshooting docs (#8190)

* feat(eslint-plugin): [member-ordering] allow easy reuse of the default ordering (#8248)

* docs: show all articles in sidebar, and a missing truncate (#8306)

* chore: enable prefer-nullish-coalescing internally (#7955)

* chore: enable prefer-nullish-calescing internally

* A couple complaints

* One last complaint

* Enable ignoreConditionalTests

* fix(eslint-plugin): [prefer-nullish-coalescing] treat any/unknown as non-nullable (#8262)

* fix(eslint-plugin): [prefer-nullish-coalescing] treat any/unknown as non-nullable

* chore: rm unrelated changes

* test: add declarations of 'y' variable

* fix(eslint-plugin): [no-useless-template-literals] report Infinity & NaN (#8295)

* fix(eslint-plugin): [no-useless-template-literals] report Infinity & NaN

Closes #8294

* remove unnecessary tests

* chore(deps): update react (#8042)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(eslint-plugin): fix typos in schema definitions (#8311)

chore: Fix typos in schema definitions

* chore: fix broken and outdated links (#8264)

* fix(eslint-plugin): [prefer-readonly] disable checking accessors (#8300)

* Disable checking accessors for prefer-readonly

* Granular accessor tests

* Update packages/eslint-plugin/src/rules/prefer-readonly.ts

* fix: formatting and || for isModifierFlagSet suggestion

---------

Co-authored-by: Josh Goldberg ✨ <[email protected]>

* chore(release): publish 6.20.0

* chore(eslint-plugin): [no-unused-vars] remove unused nested TSModuleDeclaration rule listener (#8279)

* fix(eslint-plugin): [no-unused-vars] don't report on types referenced in export assignment expression (#8265)

* docs(eslint-plugin): remove `fixable` and `hasSuggestions` from rules that don't provide them (#8253)

* feat(typescript-estree): forbid duplicated accessibility modifiers (#8257)

* test(eslint-plugin): assert that `ts`/`tsx` code blocks in docs are syntactically valid (#8142)

* test(eslint-plugin): assert that `ts`/`tsx` code blocks in docs are syntactically valid

* revert unintended changes in space-before-blocks.md

* chore: shorten examples in consistent-type-assertions.md

* refactor: do not parse md file again

* docs: more consistent examples for consistent-type-assertions

* docs: convert `js` code blocks to `ts`

* Update packages/eslint-plugin/tests/docs.test.ts

Co-authored-by: Josh Goldberg ✨ <[email protected]>

* chore: use regex instead of startsWith

* chore: fix few codesamples

---------

Co-authored-by: Josh Goldberg ✨ <[email protected]>

* chore(deps): update dependency @swc/jest to v0.2.31 (#8313)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @swc/core to v1.3.106 (#8219)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update babel to v7.23.9 (#8199)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore: unpin primary node version in ci (#8167)

* fix(eslint-plugin): [switch-exhaustiveness-check] better support for intersections, infinite types, non-union values (#8250)

* feat(eslint-plugin): [switch-exhaustiveness-check] better support for intersections, infinite types, non-union values

* chore: try to fix weird diff with main

* refactor: no need to collect missing branches in function

* fix: provide valid fixes for unique symbols

* fix: valid fixes for unique symbols + few test cases for enums

* docs: add /maintenance/team page (#8057)

* docs: add /maintenance/team page

* Apply Brad's requested changes

* Styles and social links

* Mentioned Contributor Tiers

* Added Sponsor Us section

* chore(deps): update dependency eslint-plugin-jest to v27.6.3 (#230)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency netlify to v13.1.13 (#231)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency yargs to v17.7.2 (#233)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @prettier/sync to v0.5.0 (#235)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @types/node to v20.11.9 (#236)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency chai to v4.4.1 (#237)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @swc/core to v1.3.107 (#238)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency esbuild to ~0.20.0 (#240)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Alphabetized CSS (sorry StyleShit 😛)

* Update packages/website/src/components/team/TeamBio.module.css

Co-authored-by: StyleShit <[email protected]>

* The rest of .serviceIconLink

* <hr />

* Shrunk images and used my newer colors

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: StyleShit <[email protected]>

* chore: move generate-configs to repo-tools (#8329)

* chore: add `typescript-eslint` package scaffold (#8296)

* fix(eslint-plugin): [consistent-type-imports] dont report on types used in export assignment expressions (#8332)

* fix(eslint-plugin): [no-unnecessary-condition] handle left-hand optional with exactOptionalPropertyTypes option (#8249)

* fix(eslint-plugin): [no-unnecessary-condition] handle left-hand optional with exactOptionalPropertyTypes option

* typo: remove the 's'

---------

Co-authored-by: Josh Goldberg <[email protected]>

* chore: remove unnecessary eslint-disable comments (#8336)

* chore: update sponsors (#8340)

Co-authored-by: typescript-eslint[bot] <typescript-eslint[bot]@users.noreply.github.com>

* chore: bump eslint versions (#8338)

* chore: cleanup test-utils naming/locations (#8341)

* chore(website): [playground] add twoslash queries (#8119)

* fix(eslint-plugin): [class-literal-property-style] allow getter when same key setter exists (#8277)

* feat(utils): improve eslint types (#8344)

* feat: export plugin metadata (#8331)

* feat: export plugin metadata

* Update Config.ts

* feat(eslint-plugin): add rule prefer-find (#8216)

* Add rule prefer-find

* address lots of stuff

* remove console statement

* tweaks

* extract fix to function

* improve behavior around nulls

* add comments around array indexing checks

* messages were backwards

* filter syntax

* formatting

* add extra comma operator test

* pr feedback round 2

* Fix the the

Co-authored-by: auvred <[email protected]>

* fix up imports

* address intersections of arrays

---------

Co-authored-by: auvred <[email protected]>

* chore(deps): update dependency @prettier/sync to ^0.5.0 (#8342)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency clsx to v2.1.0 (#8343)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency netlify to v13.1.14 (#8321)

chore(deps): update dependency netlify to v13.1.13

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency lint-staged to v15.2.0 (#8043)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Josh Goldberg ✨ <[email protected]>

* chore(deps): update dependency prettier to v3.2.4 (#8127)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency markdownlint-cli to ^0.38.0 (#8159)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Josh Goldberg ✨ <[email protected]>

* chore(deps): update dependency monaco-editor to ~0.45.0 (#8161)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Josh Goldberg ✨ <[email protected]>

* chore(deps): update dependency react-resizable-panels to ^0.0.63 (#8328)

* chore(deps): update dependency react-resizable-panels to ^0.0.63

* Updated props for '*Percentage'

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Josh Goldberg <[email protected]>

* chore(deps): update dependency lint-staged to v15.2.1 (#8350)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(ast-spec): add `JSXElement` type to the `JSXAttribute['value']` (#8285)

* fix(ast-spec): add `JSXElement` type to the `JSXAttribute['value']`

* test: add fixtures

* chore: sync snapshots

* fix(eslint-plugin): [no-unnecessary-type-assertion] provide valid fixes for assertions with extra tokens before `as` keyword (#8326)

* fix(eslint-plugin): [no-unnecessary-type-assertion] provide valid fixes for assertions with extra tokens before `as` keyword

* fix: provide fixes for angle bracket assertions when there're tokens inside

* chore(eslint-plugin): [no-invalid-void-type] fix `Options` typing to reflect `minItems: 1` (#8312)

* fix(rule-tester): fix a phantom dependency on the "semver" package  (#8260)

* fix(rule-tester): Fix a phantom dependency on the "semver" package in DependencyConstraint.d.ts

* Update packages/rule-tester/src/types/DependencyConstraint.ts

Co-authored-by: Josh Goldberg ✨ <[email protected]>

* Remove 'extends Options'

---------

Co-authored-by: Josh Goldberg ✨ <[email protected]>
Co-authored-by: Brad Zacher <[email protected]>

* feat: allow `parserOptions.project: false` (#8339)

* chore(deps): update dependency @swc/jest to v0.2.34 (#8363)

chore(deps): update dependency @swc/jest to v0.2.33

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency ignore to v5.3.1 (#8360)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @types/node to v20.11.15 (#8356)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @types/react to v18.2.51 (#8361)

chore(deps): update dependency @types/react to v18.2.49

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Josh Goldberg ✨ <[email protected]>

* chore(deps): update dependency netlify to v13.1.14 (#8353)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency webpack to v5.90.0 (#8359)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Josh Goldberg ✨ <[email protected]>

* chore(deps): update dependency @babel/eslint-parser to v7.23.10 (#8349)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Josh Goldberg ✨ <[email protected]>

* chore(deps): update dependency @types/jest to v29.5.12 (#8371)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency markdownlint-cli to ^0.39.0 (#8354)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Josh Goldberg ✨ <[email protected]>

* chore(deps): update dependency prettier to v3.2.4 (#8357)

* chore(deps): update dependency prettier to v3.2.4

* chore: update formatting after prettier upgrade

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: JamesHenry <[email protected]>

* code review

* Apply suggestions from code review

* Fixed up the tsNode.body complaint

* Apply suggestions from code review

* Generated configs, and touched up docs

* Let's make it strict

* Account for type parameters used as type arguments

* Tweaked docs

* Correct lint and snapshot issues

* Aha, one more T

* Fixed up last test cases

* Reworked to be types-only

* Repo is passing build, lint, and typecheck

* Aha, no need for infinite type checking

* Updated snapshot

* Revert "Aha, no need for infinite type checking"

This reverts commit 581937d.

* Simplier general/return logic

* Wow so much simpler

* Adjusted comments

* Forward along asRepeatedType

* List -> Item

* fetchJson, alas

* Initial pass of the AST check

* chore: add missing output: nulls in prefer-optional-chain.test.ts

Result of merging a few PRs into main.

* skipConstituentsUpward optimization

* Docs and naming improvements

* Allow introduced convert.test.ts complaint

* Ah, yes, Prettier

* Disable comment for helpers isNodeOfTypeWithConditions

* Remove from strict and add an experimental notice

* shakes fist at nx

---------

Co-authored-by: Josh Goldberg ✨ <[email protected]>
Co-authored-by: auvred <[email protected]>
Co-authored-by: Hao Cheng <[email protected]>
Co-authored-by: Brad Zacher <[email protected]>
Co-authored-by: YeonJuan <[email protected]>
Co-authored-by: James <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: typescript-eslint[bot] <typescript-eslint[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Costa <[email protected]>
Co-authored-by: typescript-eslint[bot] <53356952+typescript-eslint[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Costa Moura <[email protected]>
Co-authored-by: StyleShit <[email protected]>
Co-authored-by: kirkwaiblinger <[email protected]>
Co-authored-by: Flo Edelmann <[email protected]>
Co-authored-by: LJX <[email protected]>
Co-authored-by: Steven <[email protected]>
Co-authored-by: Joshua Chen <[email protected]>
Co-authored-by: James Henry <[email protected]>
Co-authored-by: Lucas Amberg <[email protected]>
Co-authored-by: Alex Parloti <[email protected]>
Co-authored-by: Edwin Kofler <[email protected]>
Co-authored-by: NanderTGA <[email protected]>
Co-authored-by: James Browning <[email protected]>
Co-authored-by: Khairul Azhar Kasmiran <[email protected]>
Co-authored-by: Pete Gonzalez <[email protected]>
abrahamguo pushed a commit to abrahamguo/typescript-eslint that referenced this issue Jul 1, 2024
…ntation (typescript-eslint#8173)

* new rule, pairing w/ josh

* start adding tests, discover some problesm

* failing testgs

* very simple version that fails with inferred return types

* some processing of inferred return types

* try to add inferred usages to count

* 11/12 passing!

* 12/12 pass

* weird circular JSON error

* oops

* add test with inferred tuple type

* add test with inferred tuple type

* failing test with inferred object type

* descend into object types

* copy over another test

* failing test case on method

* Run on MethodDefinition

* add TODO

* comment

* re-enable invalid eslint-plugin-etc test

* port one more

* shadowing test case

* port one more test

* port over DefinitelyTyped-tools tests; two failing

* resolve one failure

* resolve second failure

* enable two more tests

* one failing test from eslint-plugin-etc

* one more failing test

* full port of eslint-plugin-etc tests

* one failing test from ETS post

* fix previous error, expose a new one with a test

* resolve inferred return types on methods

* add both() function to test cases

* enable eslint rule, cleanup

* cleanup, add docs

* add to rules list

* generate configs

* update tests, docs

* Update packages/eslint-plugin/docs/rules/no-unnecessary-type-parameters.md

Co-authored-by: Josh Goldberg ✨ <[email protected]>

* Update packages/eslint-plugin/tests/rules/no-unnecessary-type-parameters.test.ts

Co-authored-by: Josh Goldberg ✨ <[email protected]>

* fix(utils): improve error message on typed rule with invalid parser (typescript-eslint#8146)

* feat(utils): throw error on typed rule with invalid parser

* Switch to more informative error message

* fix tests

* chore: enable no-dynamic-delete internally (typescript-eslint#7954)

* chore: rename release.ts to release.mts (typescript-eslint#8204)

* chore: rename release.ts to release.mts

* Update tsconfig.eslint.json

Co-authored-by: auvred <[email protected]>

---------

Co-authored-by: auvred <[email protected]>

* chore: enable eslint-plugin-jsdoc internally (typescript-eslint#8145)

* chore: enable eslint-plugin-jsdoc internally

* Disable jsdoc/check-param-names, with link to issue

* Sort jsdoc rule disables and add links to issues

* Switch typescript-estree-import.ts to line comments

* docs: document allowAutomaticSingleRunInference (typescript-eslint#8138)

* docs: document allowAutomaticSingleRunInference

* so 'no' need

* chore: prevent a11y-alt-text-bot workflow when author is a bot (typescript-eslint#8212)

* chore: prevent a11y-alt-text-bot workflow when author is a bot

* Update .github/workflows/a11y-alt-bot.yml

---------

Co-authored-by: Josh Goldberg ✨ <[email protected]>

* chore(typescript-estree): remove unnecessary old snapshots (typescript-eslint#8198)

* chore(typescript-estree): remove unnecessary old snapshots

Co-authored-by: Brad Zacher <[email protected]>

* chore: remove unused jest include patterns

---------

Co-authored-by: Brad Zacher <[email protected]>

* fix(eslint-plugin): [no-non-null-assertion] provide valid fix when member access is on next line (typescript-eslint#8185)

* fix(eslint-plugin): [no-non-null-assertion] provide valid fix when member access is on next line

* test: add new case

* fix(eslint-plugin): [no-unnecessary-condition] improve checking optional callee (typescript-eslint#8178)

* fix(eslint-plugin): [prefer-readonly] support modifiers of unions and intersections (typescript-eslint#8169)

* fix(eslint-plugin): [switch-exhaustiveness-check] fix new allowDefaultCaseForExhaustiveSwitch option (typescript-eslint#8176)

* fix(allowDefaultCaseForExhaustiveSwitch): rule

* chore: format

* fix: add containsNonLiteralType

* chore: cleanup

* refactor: use type flags instead of strings

* Update packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts

* Update packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts

---------

Co-authored-by: Josh Goldberg ✨ <[email protected]>

* chore(deps): update dependency tsx to v4.7.0 (typescript-eslint#8162)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore: fix yargs call in release script (typescript-eslint#8221)

* chore: fix test formatting in prefer-readonly.test.ts (typescript-eslint#8223)

* chore(release): publish 6.18.1

* feat(eslint-plugin): [prefer-promise-reject-errors] add rule (typescript-eslint#8011)

* feat(eslint-plugin): [prefer-promise-reject-errors] new rule!

* test: ~100% coverage

* docs: add rule docs

* test: add some cases

* chore: lint --fix

* chore: reformat tests

* feat: add support for literal computed reject name

* chore: lint --fix

* refactor: get rid of one @ts-expect-error

* docs: refer to the original rule description

* test: add few cases

* docs: remove some examples

* refactor: move check if symbol is from default lib or not to new fn

* refactor: assert that rejectVariable is non-nullable

* chore: remove assertion in skipChainExpression

* test: specify error ranges for invalid test cases

* chore: format tests

* chore: remove unused check if variable reference is read or not

* chore: include rule to `strict-type-checked` config

* refactor: simplify isSymbolFromDefaultLibrary

* chore: remove ts-expect-error comment

* feat: add checks for Promise child classes and unions/intersections

* Update packages/eslint-plugin/docs/rules/prefer-promise-reject-errors.md

Co-authored-by: Josh Goldberg ✨ <[email protected]>

* refactor: `program` -> `services.program`

* refactor: split unreadable if condition

* docs: simplify examples

* refactor: rename `isBuiltinSymbolLike.ts` -> `builtinSymbolLikes.ts`

* perf: get type of `reject` callee lazily

* test: add cases with arrays,never,unknown

* feat: add support for `Readonly<Error>` and similar

* chore: fix lint issues

---------

Co-authored-by: Josh Goldberg ✨ <[email protected]>

* docs: base Testing Rules documentation (typescript-eslint#8033)

* docs: base Testing Rules documentation

* fix(eslint-plugin): add no-unsafe-unary-minus, prefer-destructuring to disable-type-checked (typescript-eslint#8038)

fix: add no-unsafe-unary-minus, prefer-destructuring to disable-type-checked

* docs: testing rules review changes + build callout

* docs(eslint-plugin): [require-array-sort-compare] sync rule description (typescript-eslint#8061)

* chore: resolve internal lint issues with new no-useless-template-literals rule (typescript-eslint#8060)

* docs(eslint-plugin): [require-array-sort-compare] generalize sort method names (typescript-eslint#8062)

docs: streamline

* chore: update sponsors (typescript-eslint#8069)

Co-authored-by: typescript-eslint[bot] <typescript-eslint[bot]@users.noreply.github.com>

* Update docs/contributing/local-development/Local_Linking.mdx

Co-authored-by: Josh Goldberg ✨ <[email protected]>

* docs: changed section name + callout type from caution to note

---------

Co-authored-by: Josh Goldberg ✨ <[email protected]>
Co-authored-by: auvred <[email protected]>
Co-authored-by: James <[email protected]>
Co-authored-by: typescript-eslint[bot] <53356952+typescript-eslint[bot]@users.noreply.github.com>
Co-authored-by: typescript-eslint[bot] <typescript-eslint[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Costa Moura <[email protected]>

* feat(eslint-plugin): [no-array-delete] add new rule (typescript-eslint#8067)

* feat(eslint-plugin): [no-array-delete] add new rule

* small refactor

* add more cases

* fix docs

* fix message

* use suggestion instead of fix

* added more test cases

* remove redundant condition

* keep comments

* docs: force space after await in no-floating-promises snippet (typescript-eslint#8228)

force space after await

* feat(eslint-plugin): [no-useless-template-literals] add fix suggestions (typescript-eslint#8065)

* feat(eslint-plugin): [no-useless-template-literals] add fix suggestions

* change message

* add quasis to cspell

* add some test cases

* use fix instead of suggestion

* docs: link version in website header to GitHub release (typescript-eslint#8236)

* fix(typescript-estree): add JSDocParsingMode enum merge for typescript/lib/tsserverlibrary (typescript-eslint#8193)

* fix(eslint-plugin): [no-unnecessary-type-assertion] detect unnecessary non-null-assertion on a call expression (typescript-eslint#8143)

* feat(eslint-plugin): [no-unnecessary-type-assertion] add `Identifier` check

* feat(eslint-plugin): [no-unnecessary-type-assertion] update fixer for `CallExpression`

* feat(eslint-plugin): [no-unnecessary-type-assertion] add test case

* feat(eslint-plugin): [no-unnecessary-type-assertion] fit more cases

* feat(eslint-plugin): [no-unnecessary-type-assertion] add valid test cases

* fix: fix a gap and add tests

* fix: typo

* fix(typescript-estree): disallow `using` as the variable keyword for `for..in` loops (typescript-eslint#7649)

Co-authored-by: Brad Zacher <[email protected]>

* fix(eslint-plugin): [no-unnecesary-type-assertion] treat unknown/any as nullable (typescript-eslint#8089)

Co-authored-by: Brad Zacher <[email protected]>

* fix(typescript-estree): fix incorrect backwards-compat augmentation in TS 5.3 (typescript-eslint#8181)

* chore: make lint job use eslint-plugin outputs as inputs (typescript-eslint#8245)

* chore(release): publish 6.19.0

* fix(type-utils): preventing isUnsafeAssignment infinite recursive calls (typescript-eslint#8237)

* fix(type-utils): preventing isUnsafeAssignment infinite recursive calls

* chore: apply reviews

* fix(eslint-plugin): [no-unnecessary-condition] fix false positive for type variable (typescript-eslint#8235)

* fix(eslint-plugin): [no-unnecessary-condition] fix false positive for type variable

* chore: simplify test cases

* chore(release): publish 6.19.1

* fix(eslint-plugin): [no-useless-template-literals] incorrect bigint autofix result (typescript-eslint#8283)

* docs: underline URLs, change contrast in syntax highlighting (typescript-eslint#8225)

* Add underlines on all links other than menu, table of contents

* Fix comment in css
Include next page in comment as I forgot to include it beforehand

* Add comment whitespace

* Remove underlines from navbar, buttons

* Fix CSS in blog page causing headers, sidebar links to be underlined

* Alter CSS to change only anchor elements inside .markdown class

* Update styles to change color contrast in syntax highlighting

* chore: update sponsors (typescript-eslint#8303)

Co-authored-by: typescript-eslint[bot] <typescript-eslint[bot]@users.noreply.github.com>

* docs: add `import/no-unresolved` to perf troubleshooting docs (typescript-eslint#8190)

* feat(eslint-plugin): [member-ordering] allow easy reuse of the default ordering (typescript-eslint#8248)

* docs: show all articles in sidebar, and a missing truncate (typescript-eslint#8306)

* chore: enable prefer-nullish-coalescing internally (typescript-eslint#7955)

* chore: enable prefer-nullish-calescing internally

* A couple complaints

* One last complaint

* Enable ignoreConditionalTests

* fix(eslint-plugin): [prefer-nullish-coalescing] treat any/unknown as non-nullable (typescript-eslint#8262)

* fix(eslint-plugin): [prefer-nullish-coalescing] treat any/unknown as non-nullable

* chore: rm unrelated changes

* test: add declarations of 'y' variable

* fix(eslint-plugin): [no-useless-template-literals] report Infinity & NaN (typescript-eslint#8295)

* fix(eslint-plugin): [no-useless-template-literals] report Infinity & NaN

Closes typescript-eslint#8294

* remove unnecessary tests

* chore(deps): update react (typescript-eslint#8042)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(eslint-plugin): fix typos in schema definitions (typescript-eslint#8311)

chore: Fix typos in schema definitions

* chore: fix broken and outdated links (typescript-eslint#8264)

* fix(eslint-plugin): [prefer-readonly] disable checking accessors (typescript-eslint#8300)

* Disable checking accessors for prefer-readonly

* Granular accessor tests

* Update packages/eslint-plugin/src/rules/prefer-readonly.ts

* fix: formatting and || for isModifierFlagSet suggestion

---------

Co-authored-by: Josh Goldberg ✨ <[email protected]>

* chore(release): publish 6.20.0

* chore(eslint-plugin): [no-unused-vars] remove unused nested TSModuleDeclaration rule listener (typescript-eslint#8279)

* fix(eslint-plugin): [no-unused-vars] don't report on types referenced in export assignment expression (typescript-eslint#8265)

* docs(eslint-plugin): remove `fixable` and `hasSuggestions` from rules that don't provide them (typescript-eslint#8253)

* feat(typescript-estree): forbid duplicated accessibility modifiers (typescript-eslint#8257)

* test(eslint-plugin): assert that `ts`/`tsx` code blocks in docs are syntactically valid (typescript-eslint#8142)

* test(eslint-plugin): assert that `ts`/`tsx` code blocks in docs are syntactically valid

* revert unintended changes in space-before-blocks.md

* chore: shorten examples in consistent-type-assertions.md

* refactor: do not parse md file again

* docs: more consistent examples for consistent-type-assertions

* docs: convert `js` code blocks to `ts`

* Update packages/eslint-plugin/tests/docs.test.ts

Co-authored-by: Josh Goldberg ✨ <[email protected]>

* chore: use regex instead of startsWith

* chore: fix few codesamples

---------

Co-authored-by: Josh Goldberg ✨ <[email protected]>

* chore(deps): update dependency @swc/jest to v0.2.31 (typescript-eslint#8313)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @swc/core to v1.3.106 (typescript-eslint#8219)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update babel to v7.23.9 (typescript-eslint#8199)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore: unpin primary node version in ci (typescript-eslint#8167)

* fix(eslint-plugin): [switch-exhaustiveness-check] better support for intersections, infinite types, non-union values (typescript-eslint#8250)

* feat(eslint-plugin): [switch-exhaustiveness-check] better support for intersections, infinite types, non-union values

* chore: try to fix weird diff with main

* refactor: no need to collect missing branches in function

* fix: provide valid fixes for unique symbols

* fix: valid fixes for unique symbols + few test cases for enums

* docs: add /maintenance/team page (typescript-eslint#8057)

* docs: add /maintenance/team page

* Apply Brad's requested changes

* Styles and social links

* Mentioned Contributor Tiers

* Added Sponsor Us section

* chore(deps): update dependency eslint-plugin-jest to v27.6.3 (typescript-eslint#230)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency netlify to v13.1.13 (typescript-eslint#231)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency yargs to v17.7.2 (typescript-eslint#233)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @prettier/sync to v0.5.0 (typescript-eslint#235)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @types/node to v20.11.9 (typescript-eslint#236)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency chai to v4.4.1 (typescript-eslint#237)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @swc/core to v1.3.107 (typescript-eslint#238)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency esbuild to ~0.20.0 (typescript-eslint#240)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Alphabetized CSS (sorry StyleShit 😛)

* Update packages/website/src/components/team/TeamBio.module.css

Co-authored-by: StyleShit <[email protected]>

* The rest of .serviceIconLink

* <hr />

* Shrunk images and used my newer colors

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: StyleShit <[email protected]>

* chore: move generate-configs to repo-tools (typescript-eslint#8329)

* chore: add `typescript-eslint` package scaffold (typescript-eslint#8296)

* fix(eslint-plugin): [consistent-type-imports] dont report on types used in export assignment expressions (typescript-eslint#8332)

* fix(eslint-plugin): [no-unnecessary-condition] handle left-hand optional with exactOptionalPropertyTypes option (typescript-eslint#8249)

* fix(eslint-plugin): [no-unnecessary-condition] handle left-hand optional with exactOptionalPropertyTypes option

* typo: remove the 's'

---------

Co-authored-by: Josh Goldberg <[email protected]>

* chore: remove unnecessary eslint-disable comments (typescript-eslint#8336)

* chore: update sponsors (typescript-eslint#8340)

Co-authored-by: typescript-eslint[bot] <typescript-eslint[bot]@users.noreply.github.com>

* chore: bump eslint versions (typescript-eslint#8338)

* chore: cleanup test-utils naming/locations (typescript-eslint#8341)

* chore(website): [playground] add twoslash queries (typescript-eslint#8119)

* fix(eslint-plugin): [class-literal-property-style] allow getter when same key setter exists (typescript-eslint#8277)

* feat(utils): improve eslint types (typescript-eslint#8344)

* feat: export plugin metadata (typescript-eslint#8331)

* feat: export plugin metadata

* Update Config.ts

* feat(eslint-plugin): add rule prefer-find (typescript-eslint#8216)

* Add rule prefer-find

* address lots of stuff

* remove console statement

* tweaks

* extract fix to function

* improve behavior around nulls

* add comments around array indexing checks

* messages were backwards

* filter syntax

* formatting

* add extra comma operator test

* pr feedback round 2

* Fix the the

Co-authored-by: auvred <[email protected]>

* fix up imports

* address intersections of arrays

---------

Co-authored-by: auvred <[email protected]>

* chore(deps): update dependency @prettier/sync to ^0.5.0 (typescript-eslint#8342)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency clsx to v2.1.0 (typescript-eslint#8343)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency netlify to v13.1.14 (typescript-eslint#8321)

chore(deps): update dependency netlify to v13.1.13

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency lint-staged to v15.2.0 (typescript-eslint#8043)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Josh Goldberg ✨ <[email protected]>

* chore(deps): update dependency prettier to v3.2.4 (typescript-eslint#8127)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency markdownlint-cli to ^0.38.0 (typescript-eslint#8159)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Josh Goldberg ✨ <[email protected]>

* chore(deps): update dependency monaco-editor to ~0.45.0 (typescript-eslint#8161)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Josh Goldberg ✨ <[email protected]>

* chore(deps): update dependency react-resizable-panels to ^0.0.63 (typescript-eslint#8328)

* chore(deps): update dependency react-resizable-panels to ^0.0.63

* Updated props for '*Percentage'

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Josh Goldberg <[email protected]>

* chore(deps): update dependency lint-staged to v15.2.1 (typescript-eslint#8350)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(ast-spec): add `JSXElement` type to the `JSXAttribute['value']` (typescript-eslint#8285)

* fix(ast-spec): add `JSXElement` type to the `JSXAttribute['value']`

* test: add fixtures

* chore: sync snapshots

* fix(eslint-plugin): [no-unnecessary-type-assertion] provide valid fixes for assertions with extra tokens before `as` keyword (typescript-eslint#8326)

* fix(eslint-plugin): [no-unnecessary-type-assertion] provide valid fixes for assertions with extra tokens before `as` keyword

* fix: provide fixes for angle bracket assertions when there're tokens inside

* chore(eslint-plugin): [no-invalid-void-type] fix `Options` typing to reflect `minItems: 1` (typescript-eslint#8312)

* fix(rule-tester): fix a phantom dependency on the "semver" package  (typescript-eslint#8260)

* fix(rule-tester): Fix a phantom dependency on the "semver" package in DependencyConstraint.d.ts

* Update packages/rule-tester/src/types/DependencyConstraint.ts

Co-authored-by: Josh Goldberg ✨ <[email protected]>

* Remove 'extends Options'

---------

Co-authored-by: Josh Goldberg ✨ <[email protected]>
Co-authored-by: Brad Zacher <[email protected]>

* feat: allow `parserOptions.project: false` (typescript-eslint#8339)

* chore(deps): update dependency @swc/jest to v0.2.34 (typescript-eslint#8363)

chore(deps): update dependency @swc/jest to v0.2.33

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency ignore to v5.3.1 (typescript-eslint#8360)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @types/node to v20.11.15 (typescript-eslint#8356)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @types/react to v18.2.51 (typescript-eslint#8361)

chore(deps): update dependency @types/react to v18.2.49

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Josh Goldberg ✨ <[email protected]>

* chore(deps): update dependency netlify to v13.1.14 (typescript-eslint#8353)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency webpack to v5.90.0 (typescript-eslint#8359)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Josh Goldberg ✨ <[email protected]>

* chore(deps): update dependency @babel/eslint-parser to v7.23.10 (typescript-eslint#8349)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Josh Goldberg ✨ <[email protected]>

* chore(deps): update dependency @types/jest to v29.5.12 (typescript-eslint#8371)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency markdownlint-cli to ^0.39.0 (typescript-eslint#8354)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Josh Goldberg ✨ <[email protected]>

* chore(deps): update dependency prettier to v3.2.4 (typescript-eslint#8357)

* chore(deps): update dependency prettier to v3.2.4

* chore: update formatting after prettier upgrade

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: JamesHenry <[email protected]>

* code review

* Apply suggestions from code review

* Fixed up the tsNode.body complaint

* Apply suggestions from code review

* Generated configs, and touched up docs

* Let's make it strict

* Account for type parameters used as type arguments

* Tweaked docs

* Correct lint and snapshot issues

* Aha, one more T

* Fixed up last test cases

* Reworked to be types-only

* Repo is passing build, lint, and typecheck

* Aha, no need for infinite type checking

* Updated snapshot

* Revert "Aha, no need for infinite type checking"

This reverts commit 581937d.

* Simplier general/return logic

* Wow so much simpler

* Adjusted comments

* Forward along asRepeatedType

* List -> Item

* fetchJson, alas

* Initial pass of the AST check

* chore: add missing output: nulls in prefer-optional-chain.test.ts

Result of merging a few PRs into main.

* skipConstituentsUpward optimization

* Docs and naming improvements

* Allow introduced convert.test.ts complaint

* Ah, yes, Prettier

* Disable comment for helpers isNodeOfTypeWithConditions

* Remove from strict and add an experimental notice

* shakes fist at nx

---------

Co-authored-by: Josh Goldberg ✨ <[email protected]>
Co-authored-by: auvred <[email protected]>
Co-authored-by: Hao Cheng <[email protected]>
Co-authored-by: Brad Zacher <[email protected]>
Co-authored-by: YeonJuan <[email protected]>
Co-authored-by: James <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: typescript-eslint[bot] <typescript-eslint[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Costa <[email protected]>
Co-authored-by: typescript-eslint[bot] <53356952+typescript-eslint[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Costa Moura <[email protected]>
Co-authored-by: StyleShit <[email protected]>
Co-authored-by: kirkwaiblinger <[email protected]>
Co-authored-by: Flo Edelmann <[email protected]>
Co-authored-by: LJX <[email protected]>
Co-authored-by: Steven <[email protected]>
Co-authored-by: Joshua Chen <[email protected]>
Co-authored-by: James Henry <[email protected]>
Co-authored-by: Lucas Amberg <[email protected]>
Co-authored-by: Alex Parloti <[email protected]>
Co-authored-by: Edwin Kofler <[email protected]>
Co-authored-by: NanderTGA <[email protected]>
Co-authored-by: James Browning <[email protected]>
Co-authored-by: Khairul Azhar Kasmiran <[email protected]>
Co-authored-by: Pete Gonzalez <[email protected]>
JoshuaKGoldberg added a commit that referenced this issue Jul 5, 2024
… v7 (#9473)

feat(eslint-plugin): [no-unnecessary-type-parameters] initial implementation (#8173)

* new rule, pairing w/ josh

* start adding tests, discover some problesm

* failing testgs

* very simple version that fails with inferred return types

* some processing of inferred return types

* try to add inferred usages to count

* 11/12 passing!

* 12/12 pass

* weird circular JSON error

* oops

* add test with inferred tuple type

* add test with inferred tuple type

* failing test with inferred object type

* descend into object types

* copy over another test

* failing test case on method

* Run on MethodDefinition

* add TODO

* comment

* re-enable invalid eslint-plugin-etc test

* port one more

* shadowing test case

* port one more test

* port over DefinitelyTyped-tools tests; two failing

* resolve one failure

* resolve second failure

* enable two more tests

* one failing test from eslint-plugin-etc

* one more failing test

* full port of eslint-plugin-etc tests

* one failing test from ETS post

* fix previous error, expose a new one with a test

* resolve inferred return types on methods

* add both() function to test cases

* enable eslint rule, cleanup

* cleanup, add docs

* add to rules list

* generate configs

* update tests, docs

* Update packages/eslint-plugin/docs/rules/no-unnecessary-type-parameters.md



* Update packages/eslint-plugin/tests/rules/no-unnecessary-type-parameters.test.ts



* fix(utils): improve error message on typed rule with invalid parser (#8146)

* feat(utils): throw error on typed rule with invalid parser

* Switch to more informative error message

* fix tests

* chore: enable no-dynamic-delete internally (#7954)

* chore: rename release.ts to release.mts (#8204)

* chore: rename release.ts to release.mts

* Update tsconfig.eslint.json



---------



* chore: enable eslint-plugin-jsdoc internally (#8145)

* chore: enable eslint-plugin-jsdoc internally

* Disable jsdoc/check-param-names, with link to issue

* Sort jsdoc rule disables and add links to issues

* Switch typescript-estree-import.ts to line comments

* docs: document allowAutomaticSingleRunInference (#8138)

* docs: document allowAutomaticSingleRunInference

* so 'no' need

* chore: prevent a11y-alt-text-bot workflow when author is a bot (#8212)

* chore: prevent a11y-alt-text-bot workflow when author is a bot

* Update .github/workflows/a11y-alt-bot.yml

---------



* chore(typescript-estree): remove unnecessary old snapshots (#8198)

* chore(typescript-estree): remove unnecessary old snapshots



* chore: remove unused jest include patterns

---------



* fix(eslint-plugin): [no-non-null-assertion] provide valid fix when member access is on next line (#8185)

* fix(eslint-plugin): [no-non-null-assertion] provide valid fix when member access is on next line

* test: add new case

* fix(eslint-plugin): [no-unnecessary-condition] improve checking optional callee (#8178)

* fix(eslint-plugin): [prefer-readonly] support modifiers of unions and intersections (#8169)

* fix(eslint-plugin): [switch-exhaustiveness-check] fix new allowDefaultCaseForExhaustiveSwitch option (#8176)

* fix(allowDefaultCaseForExhaustiveSwitch): rule

* chore: format

* fix: add containsNonLiteralType

* chore: cleanup

* refactor: use type flags instead of strings

* Update packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts

* Update packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts

---------



* chore(deps): update dependency tsx to v4.7.0 (#8162)



* chore: fix yargs call in release script (#8221)

* chore: fix test formatting in prefer-readonly.test.ts (#8223)

* chore(release): publish 6.18.1

* feat(eslint-plugin): [prefer-promise-reject-errors] add rule (#8011)

* feat(eslint-plugin): [prefer-promise-reject-errors] new rule!

* test: ~100% coverage

* docs: add rule docs

* test: add some cases

* chore: lint --fix

* chore: reformat tests

* feat: add support for literal computed reject name

* chore: lint --fix

* refactor: get rid of one @ts-expect-error

* docs: refer to the original rule description

* test: add few cases

* docs: remove some examples

* refactor: move check if symbol is from default lib or not to new fn

* refactor: assert that rejectVariable is non-nullable

* chore: remove assertion in skipChainExpression

* test: specify error ranges for invalid test cases

* chore: format tests

* chore: remove unused check if variable reference is read or not

* chore: include rule to `strict-type-checked` config

* refactor: simplify isSymbolFromDefaultLibrary

* chore: remove ts-expect-error comment

* feat: add checks for Promise child classes and unions/intersections

* Update packages/eslint-plugin/docs/rules/prefer-promise-reject-errors.md



* refactor: `program` -> `services.program`

* refactor: split unreadable if condition

* docs: simplify examples

* refactor: rename `isBuiltinSymbolLike.ts` -> `builtinSymbolLikes.ts`

* perf: get type of `reject` callee lazily

* test: add cases with arrays,never,unknown

* feat: add support for `Readonly<Error>` and similar

* chore: fix lint issues

---------



* docs: base Testing Rules documentation (#8033)

* docs: base Testing Rules documentation

* fix(eslint-plugin): add no-unsafe-unary-minus, prefer-destructuring to disable-type-checked (#8038)

fix: add no-unsafe-unary-minus, prefer-destructuring to disable-type-checked

* docs: testing rules review changes + build callout

* docs(eslint-plugin): [require-array-sort-compare] sync rule description (#8061)

* chore: resolve internal lint issues with new no-useless-template-literals rule (#8060)

* docs(eslint-plugin): [require-array-sort-compare] generalize sort method names (#8062)

docs: streamline

* chore: update sponsors (#8069)



* Update docs/contributing/local-development/Local_Linking.mdx



* docs: changed section name + callout type from caution to note

---------








* feat(eslint-plugin): [no-array-delete] add new rule (#8067)

* feat(eslint-plugin): [no-array-delete] add new rule

* small refactor

* add more cases

* fix docs

* fix message

* use suggestion instead of fix

* added more test cases

* remove redundant condition

* keep comments

* docs: force space after await in no-floating-promises snippet (#8228)

force space after await

* feat(eslint-plugin): [no-useless-template-literals] add fix suggestions (#8065)

* feat(eslint-plugin): [no-useless-template-literals] add fix suggestions

* change message

* add quasis to cspell

* add some test cases

* use fix instead of suggestion

* docs: link version in website header to GitHub release (#8236)

* fix(typescript-estree): add JSDocParsingMode enum merge for typescript/lib/tsserverlibrary (#8193)

* fix(eslint-plugin): [no-unnecessary-type-assertion] detect unnecessary non-null-assertion on a call expression (#8143)

* feat(eslint-plugin): [no-unnecessary-type-assertion] add `Identifier` check

* feat(eslint-plugin): [no-unnecessary-type-assertion] update fixer for `CallExpression`

* feat(eslint-plugin): [no-unnecessary-type-assertion] add test case

* feat(eslint-plugin): [no-unnecessary-type-assertion] fit more cases

* feat(eslint-plugin): [no-unnecessary-type-assertion] add valid test cases

* fix: fix a gap and add tests

* fix: typo

* fix(typescript-estree): disallow `using` as the variable keyword for `for..in` loops (#7649)



* fix(eslint-plugin): [no-unnecesary-type-assertion] treat unknown/any as nullable (#8089)



* fix(typescript-estree): fix incorrect backwards-compat augmentation in TS 5.3 (#8181)

* chore: make lint job use eslint-plugin outputs as inputs (#8245)

* chore(release): publish 6.19.0

* fix(type-utils): preventing isUnsafeAssignment infinite recursive calls (#8237)

* fix(type-utils): preventing isUnsafeAssignment infinite recursive calls

* chore: apply reviews

* fix(eslint-plugin): [no-unnecessary-condition] fix false positive for type variable (#8235)

* fix(eslint-plugin): [no-unnecessary-condition] fix false positive for type variable

* chore: simplify test cases

* chore(release): publish 6.19.1

* fix(eslint-plugin): [no-useless-template-literals] incorrect bigint autofix result (#8283)

* docs: underline URLs, change contrast in syntax highlighting (#8225)

* Add underlines on all links other than menu, table of contents

* Fix comment in css
Include next page in comment as I forgot to include it beforehand

* Add comment whitespace

* Remove underlines from navbar, buttons

* Fix CSS in blog page causing headers, sidebar links to be underlined

* Alter CSS to change only anchor elements inside .markdown class

* Update styles to change color contrast in syntax highlighting

* chore: update sponsors (#8303)



* docs: add `import/no-unresolved` to perf troubleshooting docs (#8190)

* feat(eslint-plugin): [member-ordering] allow easy reuse of the default ordering (#8248)

* docs: show all articles in sidebar, and a missing truncate (#8306)

* chore: enable prefer-nullish-coalescing internally (#7955)

* chore: enable prefer-nullish-calescing internally

* A couple complaints

* One last complaint

* Enable ignoreConditionalTests

* fix(eslint-plugin): [prefer-nullish-coalescing] treat any/unknown as non-nullable (#8262)

* fix(eslint-plugin): [prefer-nullish-coalescing] treat any/unknown as non-nullable

* chore: rm unrelated changes

* test: add declarations of 'y' variable

* fix(eslint-plugin): [no-useless-template-literals] report Infinity & NaN (#8295)

* fix(eslint-plugin): [no-useless-template-literals] report Infinity & NaN

Closes #8294

* remove unnecessary tests

* chore(deps): update react (#8042)



* chore(eslint-plugin): fix typos in schema definitions (#8311)

chore: Fix typos in schema definitions

* chore: fix broken and outdated links (#8264)

* fix(eslint-plugin): [prefer-readonly] disable checking accessors (#8300)

* Disable checking accessors for prefer-readonly

* Granular accessor tests

* Update packages/eslint-plugin/src/rules/prefer-readonly.ts

* fix: formatting and || for isModifierFlagSet suggestion

---------



* chore(release): publish 6.20.0

* chore(eslint-plugin): [no-unused-vars] remove unused nested TSModuleDeclaration rule listener (#8279)

* fix(eslint-plugin): [no-unused-vars] don't report on types referenced in export assignment expression (#8265)

* docs(eslint-plugin): remove `fixable` and `hasSuggestions` from rules that don't provide them (#8253)

* feat(typescript-estree): forbid duplicated accessibility modifiers (#8257)

* test(eslint-plugin): assert that `ts`/`tsx` code blocks in docs are syntactically valid (#8142)

* test(eslint-plugin): assert that `ts`/`tsx` code blocks in docs are syntactically valid

* revert unintended changes in space-before-blocks.md

* chore: shorten examples in consistent-type-assertions.md

* refactor: do not parse md file again

* docs: more consistent examples for consistent-type-assertions

* docs: convert `js` code blocks to `ts`

* Update packages/eslint-plugin/tests/docs.test.ts



* chore: use regex instead of startsWith

* chore: fix few codesamples

---------



* chore(deps): update dependency @swc/jest to v0.2.31 (#8313)



* chore(deps): update dependency @swc/core to v1.3.106 (#8219)



* chore(deps): update babel to v7.23.9 (#8199)



* chore: unpin primary node version in ci (#8167)

* fix(eslint-plugin): [switch-exhaustiveness-check] better support for intersections, infinite types, non-union values (#8250)

* feat(eslint-plugin): [switch-exhaustiveness-check] better support for intersections, infinite types, non-union values

* chore: try to fix weird diff with main

* refactor: no need to collect missing branches in function

* fix: provide valid fixes for unique symbols

* fix: valid fixes for unique symbols + few test cases for enums

* docs: add /maintenance/team page (#8057)

* docs: add /maintenance/team page

* Apply Brad's requested changes

* Styles and social links

* Mentioned Contributor Tiers

* Added Sponsor Us section

* chore(deps): update dependency eslint-plugin-jest to v27.6.3 (#230)



* chore(deps): update dependency netlify to v13.1.13 (#231)



* chore(deps): update dependency yargs to v17.7.2 (#233)



* chore(deps): update dependency @prettier/sync to v0.5.0 (#235)



* chore(deps): update dependency @types/node to v20.11.9 (#236)



* chore(deps): update dependency chai to v4.4.1 (#237)



* chore(deps): update dependency @swc/core to v1.3.107 (#238)



* chore(deps): update dependency esbuild to ~0.20.0 (#240)



* Alphabetized CSS (sorry StyleShit 😛)

* Update packages/website/src/components/team/TeamBio.module.css



* The rest of .serviceIconLink

* <hr />

* Shrunk images and used my newer colors

---------




* chore: move generate-configs to repo-tools (#8329)

* chore: add `typescript-eslint` package scaffold (#8296)

* fix(eslint-plugin): [consistent-type-imports] dont report on types used in export assignment expressions (#8332)

* fix(eslint-plugin): [no-unnecessary-condition] handle left-hand optional with exactOptionalPropertyTypes option (#8249)

* fix(eslint-plugin): [no-unnecessary-condition] handle left-hand optional with exactOptionalPropertyTypes option

* typo: remove the 's'

---------



* chore: remove unnecessary eslint-disable comments (#8336)

* chore: update sponsors (#8340)



* chore: bump eslint versions (#8338)

* chore: cleanup test-utils naming/locations (#8341)

* chore(website): [playground] add twoslash queries (#8119)

* fix(eslint-plugin): [class-literal-property-style] allow getter when same key setter exists (#8277)

* feat(utils): improve eslint types (#8344)

* feat: export plugin metadata (#8331)

* feat: export plugin metadata

* Update Config.ts

* feat(eslint-plugin): add rule prefer-find (#8216)

* Add rule prefer-find

* address lots of stuff

* remove console statement

* tweaks

* extract fix to function

* improve behavior around nulls

* add comments around array indexing checks

* messages were backwards

* filter syntax

* formatting

* add extra comma operator test

* pr feedback round 2

* Fix the the



* fix up imports

* address intersections of arrays

---------



* chore(deps): update dependency @prettier/sync to ^0.5.0 (#8342)



* chore(deps): update dependency clsx to v2.1.0 (#8343)



* chore(deps): update dependency netlify to v13.1.14 (#8321)

chore(deps): update dependency netlify to v13.1.13



* chore(deps): update dependency lint-staged to v15.2.0 (#8043)




* chore(deps): update dependency prettier to v3.2.4 (#8127)



* chore(deps): update dependency markdownlint-cli to ^0.38.0 (#8159)




* chore(deps): update dependency monaco-editor to ~0.45.0 (#8161)




* chore(deps): update dependency react-resizable-panels to ^0.0.63 (#8328)

* chore(deps): update dependency react-resizable-panels to ^0.0.63

* Updated props for '*Percentage'

---------




* chore(deps): update dependency lint-staged to v15.2.1 (#8350)



* fix(ast-spec): add `JSXElement` type to the `JSXAttribute['value']` (#8285)

* fix(ast-spec): add `JSXElement` type to the `JSXAttribute['value']`

* test: add fixtures

* chore: sync snapshots

* fix(eslint-plugin): [no-unnecessary-type-assertion] provide valid fixes for assertions with extra tokens before `as` keyword (#8326)

* fix(eslint-plugin): [no-unnecessary-type-assertion] provide valid fixes for assertions with extra tokens before `as` keyword

* fix: provide fixes for angle bracket assertions when there're tokens inside

* chore(eslint-plugin): [no-invalid-void-type] fix `Options` typing to reflect `minItems: 1` (#8312)

* fix(rule-tester): fix a phantom dependency on the "semver" package  (#8260)

* fix(rule-tester): Fix a phantom dependency on the "semver" package in DependencyConstraint.d.ts

* Update packages/rule-tester/src/types/DependencyConstraint.ts



* Remove 'extends Options'

---------




* feat: allow `parserOptions.project: false` (#8339)

* chore(deps): update dependency @swc/jest to v0.2.34 (#8363)

chore(deps): update dependency @swc/jest to v0.2.33



* chore(deps): update dependency ignore to v5.3.1 (#8360)



* chore(deps): update dependency @types/node to v20.11.15 (#8356)



* chore(deps): update dependency @types/react to v18.2.51 (#8361)

chore(deps): update dependency @types/react to v18.2.49




* chore(deps): update dependency netlify to v13.1.14 (#8353)



* chore(deps): update dependency webpack to v5.90.0 (#8359)




* chore(deps): update dependency @babel/eslint-parser to v7.23.10 (#8349)




* chore(deps): update dependency @types/jest to v29.5.12 (#8371)



* chore(deps): update dependency markdownlint-cli to ^0.39.0 (#8354)




* chore(deps): update dependency prettier to v3.2.4 (#8357)

* chore(deps): update dependency prettier to v3.2.4

* chore: update formatting after prettier upgrade

---------




* code review

* Apply suggestions from code review

* Fixed up the tsNode.body complaint

* Apply suggestions from code review

* Generated configs, and touched up docs

* Let's make it strict

* Account for type parameters used as type arguments

* Tweaked docs

* Correct lint and snapshot issues

* Aha, one more T

* Fixed up last test cases

* Reworked to be types-only

* Repo is passing build, lint, and typecheck

* Aha, no need for infinite type checking

* Updated snapshot

* Revert "Aha, no need for infinite type checking"

This reverts commit 581937d.

* Simplier general/return logic

* Wow so much simpler

* Adjusted comments

* Forward along asRepeatedType

* List -> Item

* fetchJson, alas

* Initial pass of the AST check

* chore: add missing output: nulls in prefer-optional-chain.test.ts

Result of merging a few PRs into main.

* skipConstituentsUpward optimization

* Docs and naming improvements

* Allow introduced convert.test.ts complaint

* Ah, yes, Prettier

* Disable comment for helpers isNodeOfTypeWithConditions

* Remove from strict and add an experimental notice

* shakes fist at nx

---------

Co-authored-by: Dan Vanderkam <[email protected]>
Co-authored-by: Josh Goldberg ✨ <[email protected]>
Co-authored-by: auvred <[email protected]>
Co-authored-by: Hao Cheng <[email protected]>
Co-authored-by: Brad Zacher <[email protected]>
Co-authored-by: YeonJuan <[email protected]>
Co-authored-by: James <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: typescript-eslint[bot] <typescript-eslint[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Costa <[email protected]>
Co-authored-by: typescript-eslint[bot] <53356952+typescript-eslint[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Costa Moura <[email protected]>
Co-authored-by: StyleShit <[email protected]>
Co-authored-by: kirkwaiblinger <[email protected]>
Co-authored-by: Flo Edelmann <[email protected]>
Co-authored-by: LJX <[email protected]>
Co-authored-by: Steven <[email protected]>
Co-authored-by: Joshua Chen <[email protected]>
Co-authored-by: James Henry <[email protected]>
Co-authored-by: Lucas Amberg <[email protected]>
Co-authored-by: Alex Parloti <[email protected]>
Co-authored-by: Edwin Kofler <[email protected]>
Co-authored-by: NanderTGA <[email protected]>
Co-authored-by: James Browning <[email protected]>
Co-authored-by: Khairul Azhar Kasmiran <[email protected]>
Co-authored-by: Pete Gonzalez <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants