Skip to content

feat: remove @types/eslint package#70735

Merged
typescript-bot merged 3 commits intoDefinitelyTyped:masterfrom
snitin315:rm-eslint
Oct 16, 2024
Merged

feat: remove @types/eslint package#70735
typescript-bot merged 3 commits intoDefinitelyTyped:masterfrom
snitin315:rm-eslint

Conversation

@snitin315
Copy link
Copy Markdown
Contributor

@snitin315 snitin315 commented Sep 29, 2024

Reference eslint/eslint#18928

Please fill in this template.

Select one of these and delete the others:

If removing a declaration:

  • If a package was never on Definitely Typed, you don't need to do anything. (If you wrote a package and provided types, you don't need to register it with us.)
  • Delete the package's directory.
  • Add it to notNeededPackages.json.

@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented Sep 29, 2024

@snitin315 Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through.

This is a live comment that I will keep updated.

1 package in this PR

Code Reviews

Because this is a widely-used package, a DT maintainer will need to review it before it can be merged.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ A DT maintainer needs to approve changes that affect module config files

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 70735,
  "author": "snitin315",
  "headCommitOid": "25a0a797d2bf24498119dd6e281d33b391c71add",
  "mergeBaseOid": "29a5cdc0807e42681cf7cf300bd49ab865a77d9b",
  "lastPushDate": "2024-09-29T11:32:18.000Z",
  "lastActivityDate": "2024-10-16T16:12:03.000Z",
  "mergeOfferDate": "2024-10-16T13:44:12.000Z",
  "mergeRequestDate": "2024-10-16T16:12:03.000Z",
  "mergeRequestUser": "snitin315",
  "hasMergeConflict": false,
  "isFirstContribution": true,
  "tooManyFiles": false,
  "hugeChange": true,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "eslint",
      "kind": "delete",
      "files": [
        {
          "path": "types/eslint/.eslintrc.json",
          "kind": "package-meta",
          "suspect": "edited"
        },
        {
          "path": "types/eslint/.npmignore",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/eslint/eslint-tests.ts",
          "kind": "test"
        },
        {
          "path": "types/eslint/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/eslint/package.json",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/eslint/rules/best-practices.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/eslint/rules/deprecated.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/eslint/rules/ecmascript-6.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/eslint/rules/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/eslint/rules/node-commonjs.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/eslint/rules/possible-errors.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/eslint/rules/strict-mode.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/eslint/rules/stylistic-issues.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/eslint/rules/variables.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/eslint/tsconfig.json",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/eslint/use-at-your-own-risk.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/eslint/v8/.eslintrc.json",
          "kind": "package-meta",
          "suspect": "edited"
        },
        {
          "path": "types/eslint/v8/.npmignore",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/eslint/v8/eslint-tests.ts",
          "kind": "test"
        },
        {
          "path": "types/eslint/v8/helpers.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/eslint/v8/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/eslint/v8/package.json",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/eslint/v8/rules/best-practices.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/eslint/v8/rules/deprecated.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/eslint/v8/rules/ecmascript-6.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/eslint/v8/rules/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/eslint/v8/rules/node-commonjs.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/eslint/v8/rules/possible-errors.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/eslint/v8/rules/strict-mode.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/eslint/v8/rules/stylistic-issues.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/eslint/v8/rules/variables.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/eslint/v8/tsconfig.json",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/eslint/v8/use-at-your-own-risk.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "pmdartus",
        "j-f1",
        "saadq",
        "JasonHK",
        "bradzacher",
        "JounQin",
        "bmish"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "sandersn",
      "date": "2024-10-16T13:43:28.000Z",
      "isMaintainer": true
    },
    {
      "type": "stale",
      "reviewer": "bradzacher",
      "date": "2024-10-10T13:57:39.000Z",
      "abbrOid": "d4dc8eb"
    },
    {
      "type": "stale",
      "reviewer": "JoshuaKGoldberg",
      "date": "2024-09-29T13:04:38.000Z",
      "abbrOid": "d4dc8eb"
    }
  ],
  "mainBotCommentID": 2381321344,
  "ciResult": "pass"
}

@typescript-bot
Copy link
Copy Markdown
Contributor

🔔 @pmdartus @j-f1 @saadq @JasonHK @bradzacher @JounQin @bmish — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

Copy link
Copy Markdown
Collaborator

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔪

@typescript-bot typescript-bot added the Other Approved This PR was reviewed and signed-off by a community member. label Sep 29, 2024
@typescript-bot typescript-bot removed the Other Approved This PR was reviewed and signed-off by a community member. label Sep 29, 2024
@typescript-bot
Copy link
Copy Markdown
Contributor

@JoshuaKGoldberg Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review?

Copy link
Copy Markdown
Collaborator

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔪🔪

@typescript-bot typescript-bot added the Other Approved This PR was reviewed and signed-off by a community member. label Sep 29, 2024
@sandersn
Copy link
Copy Markdown
Contributor

sandersn commented Oct 3, 2024

@types/eslint has so many dependents that I'd recommend skipping the publish of the deprecated stub. Especially old types dependents like eslint-plugin-markdown will break when they get the stub. Not a (big) problem if people have upgraded to an eslint with types, since they'll get those instead. But lots of projects haven't upgraded yet.

To skip the stub publish, revert the addition to notNeededPackage.json.

@typescript-bot typescript-bot added the Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer. label Oct 10, 2024
@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented Oct 10, 2024

Re-ping @pmdartus, @j-f1, @saadq, @JasonHK, @bradzacher, @JounQin, @bmish:

This PR has been out for over a week, yet I haven't seen any reviews.

Could someone please give it some attention? Thanks!

@typescript-bot typescript-bot added the Owner Approved A listed owner of this package signed off on the pull request. label Oct 10, 2024
@typescript-bot typescript-bot removed Other Approved This PR was reviewed and signed-off by a community member. Owner Approved A listed owner of this package signed off on the pull request. Edits Infrastructure labels Oct 11, 2024
@snitin315
Copy link
Copy Markdown
Contributor Author

@sandersn Done.

@typescript-bot
Copy link
Copy Markdown
Contributor

@bradzacher, @JoshuaKGoldberg Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review?

@typescript-bot typescript-bot merged commit 6809be1 into DefinitelyTyped:master Oct 16, 2024
@snitin315 snitin315 deleted the rm-eslint branch October 16, 2024 16:15
@karlhorky
Copy link
Copy Markdown
Contributor

Nice, thanks for this @snitin315 and others involved!

What happens with the existing @types/eslint package on npm now?

It is currently still published at version 9.6.1 (last publish: 26 Aug 2024) without any warnings or deprecation notices:

Screenshot 2024-10-17 at 12 05 19

Or maybe there are plans already which I missed to manually deprecate this from npm...?

@pauliesnug
Copy link
Copy Markdown

@karlhorky I believe usually after some time the DT bot deprecates the package and adds the warning This is a stub types definition. eslint provides its own type definitions, so you do not need this installed.. Maybe this was granted a special exception as it is such a popular types package?

@sandersn
Copy link
Copy Markdown
Contributor

That's right. My explanation is at #70735 (comment)

@karlhorky
Copy link
Copy Markdown
Contributor

karlhorky commented Oct 20, 2024

@sandersn oh, yeah I saw that comment.

Does that mean that the obsolete @types/eslint package will stay online and published in the future without any notice to users?

If yes, seems like this will lead to confusion for new projects and existing projects, and unnecessary dependencies being installed...?

@pauliesnug
Copy link
Copy Markdown

pauliesnug commented Oct 21, 2024

@karlhorky @sandersn Yeah I agree, I think instead of not publishing a stub and not publishing a deprecation notice, we should only skip the stub, but keep the notice.

This shouldn't break anything, unless for some reason they have a fail on deprecation notice option enabled.

Maybe even a custom deprecation notice, linking to an explaination page, seeing how big this dependency is? @types/eslint is no longer maintained or up to date with ESLint's types, as it includes its own. See https://github.com/DefinitelyTyped/DefinitelyTyped/pull/70735

We definitely shouldn't stub the types though, that would break a lot of projects.

@sandersn
Copy link
Copy Markdown
Contributor

@karlhorky @types/eslint stays online with the last version at 9.6.1 -- no more publishes.

@pauliesnug I like the idea of a custom deprecate notice, but there's no place to put it unless we publish another version of @types/eslint -- [email protected] doesn't ship types, so it makes sense for people to install @types/[email protected]. I guess we could re-publish 9.6.1 manually as 9.10.0, but that seems misleading as well.

@karlhorky
Copy link
Copy Markdown
Contributor

I like the idea of a custom deprecate notice, but there's no place to put it unless we publish another version of @types/eslint

What about npm deprecate? That wouldn't require publishing another version I guess, would it?

@sandersn
Copy link
Copy Markdown
Contributor

What I mean is, npm deprecate @types/[email protected] doesn't make sense, because [email protected] doesn't ship types. So @types/[email protected] shouldn't be deprecated. It still makes sense to install.

@karlhorky
Copy link
Copy Markdown
Contributor

karlhorky commented Oct 22, 2024

Ok, I think I'm understanding what you mean.

To be clear, what I think could be a common user flow:

  1. User is setting up a new project with ESLint, and relies on their memory (or by looking at a project they set up previously)
  2. User remembers that for ESLint, the types are not included and @types/eslint is required
  3. User checks npm page @types/eslint to be sure (does not look at version number)
  4. User does not see any deprecation notice or anything that says that @types/eslint is obsolete now (does not go looking through old closed issues / PRs to investigate)
  5. 💥 User installs @types/eslint along with ESLint - an obsolete, unnecessary package

If @types/eslint is not stubbed (maybe it should actually be stubbed after all? if not right away now, maybe when ESLint v9 becomes end-of-life?), then it seems like it should at least have a notice showing that it is not recommended to install with the latest version of ESLint.

@sandersn
Copy link
Copy Markdown
Contributor

The bad thing that happens at (5) is not a crash, it's an extra 253 KB in node_module that the compiler ignores, plus an unnecessary entry in package.json. It is bad that the JS ecosystem continues to accrue cruft.

Also, deprecating stub packages got even less useful recently with npm/npm-pick-manifest#33; npm now never resolves to a deprecated package when any un-deprecated one exists. So npm i @types/eslint would always give 9.6, not the 9.10 stub. Maybe what we could do is publish a final patch release, 9.6.2, that's a copy of 9.6.1 with an updated README that adds "if you're using a version of eslint 9.10 or newer, you don't need these types." That would stop your scenario at (3).

However, I don't think most people will npm i @types/[email protected] or check the types README, so neither will reach the majority of people.

@kachkaev
Copy link
Copy Markdown
Contributor

kachkaev commented Oct 28, 2024

How about releasing a stub @types/[email protected] package? Version 9.6.1 (or 9.6.2) will be the last un-deprecated package with actual typings in place.

@sandersn
Copy link
Copy Markdown
Contributor

#70735 (comment). Briefly, types packages depend on each other with *, so they'll get the stub instead of working types -- at least on old versions of npm. Newer versions of npm will resolve to a working version. But...so will people when they npm i @types/eslint.

@jakebailey
Copy link
Copy Markdown
Member

The flip side is that without the stub, all packages on DT will only ever test the DT package, because they'll never know to download eslint instead. That's basically what happened when this PR was merged, so I'm not sure that's a good result either... This hole didn't exist before we switched to a real pnpm monorepo, because DT would not have been able to pull older types from npm without interaction. Things could be very broken right now with people using eslint directly and we'd have no idea.

@jakebailey
Copy link
Copy Markdown
Member

I recently merged in support for peer deps; given eslint packages are extensions of eslint and therefore would be peer deps, perhaps we should fix all of those to be peer deps on @types/eslint and then publish the stub? That way, a user can fairly easily install the "right" types?

(But, doing so will forcibly install @types/eslint even when it's not needed due to it being eslint v9, so, it's all terrible. That's not different than today, though.)

AllenSH12 added a commit to AllenSH12/type-fest that referenced this pull request Jun 11, 2025
AllenSH12 added a commit to AllenSH12/type-fest that referenced this pull request Jun 11, 2025
AllenSH12 added a commit to AllenSH12/type-fest that referenced this pull request Jun 11, 2025
andersk added a commit to andersk/formatjs that referenced this pull request Jan 12, 2026
eslint@9 comes with its own types.  @types/eslint is unmaintained, no
longer compatible with current eslint, and causes spurious type errors
when installed.

DefinitelyTyped/DefinitelyTyped#70735

Signed-off-by: Anders Kaseorg <[email protected]>
longlho pushed a commit to formatjs/formatjs that referenced this pull request Jan 14, 2026
eslint@9 comes with its own types. @types/eslint is unmaintained, no
longer compatible with current eslint, and causes spurious type errors
when installed.

- DefinitelyTyped/DefinitelyTyped#70735

---

Minimal reproduction:

**`eslint.config.mjs`**

```js
// @ts-check
import { FlatCompat } from "@eslint/eslintrc";
import { defineConfig } from "eslint/config";
const compat = new FlatCompat({ baseDirectory: "." });
export default defineConfig(compat.config({}));
```

```console
$ pnpm i @eslint/eslintrc eslint eslint-plugin-formatjs typescript
$ pnpm exec tsc --allowJs --module nodenext --noEmit eslint.config.mjs 
eslint.config.mjs:5:29 - error TS2345: Argument of type 'Config<RulesRecord>[]' is not assignable to parameter of type 'InfiniteArray<ConfigWithExtends>'.
  Type 'Config<RulesRecord>[]' is not assignable to type 'InfiniteArray<ConfigWithExtends>[]'.
    Type 'Config<RulesRecord>' is not assignable to type 'InfiniteArray<ConfigWithExtends>'.
      Type 'Config<RulesRecord>' is not assignable to type 'ConfigWithExtends'.
        Types of property 'languageOptions' are incompatible.
          Type 'import("/tmp/u/node_modules/.pnpm/@types[email protected]/node_modules/@types/eslint/index").Linter.LanguageOptions' is not assignable to type 'import("/tmp/u/node_modules/.pnpm/@eslint[email protected]/node_modules/@eslint/core/dist/cjs/types").LanguageOptions'.
            Index signature for type 'string' is missing in type 'LanguageOptions'.

5 export default defineConfig(compat.config({}));
                              ~~~~~~~~~~~~~~~~~


Found 1 error in eslint.config.mjs:5
```

Signed-off-by: Anders Kaseorg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Check Config Changes a module config files Critical package Huge Change Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants