Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

feat: add plugin meta and support typescript-eslint@7 #86

Merged
merged 5 commits into from
May 31, 2024

Conversation

JoshuaKGoldberg
Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg commented Apr 10, 2024

Adds @typescript-eslint/utils@7 as an allowed version, as both 6 and 7 work with this package.

Adds a meta per https://eslint.org/docs/latest/extend/plugin-migration-flat-config#adding-plugin-meta-information as a non-breaking change. Adding in the meta actually fixes #85, since this plugin doesn't expose any preset config anyway.

Also swaps from the long-inactive tsutils to its successor, ts-api-utils. That's what @typescript-eslint/* packages use.

@liquidg3
Copy link

@JoshuaKGoldberg - thanks for doing this. I'll have to disable the deprecation plugin for now, just to get the rest of our ecosystem onto eslint 9, but I'll be following this so we can bring it back once it's merged!

@JoshuaKGoldberg
Copy link
Contributor Author

👋 since it's been a month, ping @gund - any chance you'd have time to look at this?

Copy link
Owner

@gund gund left a comment

Choose a reason for hiding this comment

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

Hey! I'm so sorry it took so long to review this but I finally made some time to review it.
Thanks so much for the upgrade, it's great! Just left one small comment to resolve, otherwise looks good!

package.json Outdated Show resolved Hide resolved
@gund
Copy link
Owner

gund commented May 20, 2024

btw what about these dev dependencies, shouldn't they also be updated to v7?

    "@typescript-eslint/eslint-plugin": "^6.0.0",
    "@typescript-eslint/rule-tester": "^6.0.0",
    "@typescript-eslint/parser": "^6.0.0",

@@ -7,6 +7,7 @@
"declaration": true,
"noEmitHelpers": true,
"importHelpers": true,
"skipLibCheck": true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without this:

 $ npm run build

> [email protected] prebuild
> rimraf dist


> [email protected] build
> tsc --build tsconfig.build.json

node_modules/ts-api-utils/lib/index.d.cts:1:8 - error TS1259: Module '"/Users/josh/repos/eslint-plugin-deprecation/node_modules/typescript/lib/typescript"' can only be default-imported using the 'esModuleInterop' flag

1 import ts from 'typescript';
         ~~

  node_modules/typescript/lib/typescript.d.ts:7159:1
    7159 export = ts;
         ~~~~~~~~~~~~
    This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.


Found 1 error.

@JoshuaKGoldberg JoshuaKGoldberg requested a review from gund May 21, 2024 17:05
Copy link
Owner

@gund gund left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for the updates!

@gund
Copy link
Owner

gund commented May 27, 2024

Seems like this breaks backwards compatibility with ESlint v7...
I'm not sure if it's even worth fixing, maybe we could drop the support all together?
In which case we need to remove v7 major from the eslint versions here:

"eslint": "^7.0.0 || ^8.0.0",

And also dropping the BC test for v7 from the matrix here:
- name: 'Test with Eslint v7'
cmd: |
npm i eslint@^7 \
typescript-eslint-utils-5@npm:@typescript-eslint/utils@^5.57.0
cat package-lock.json | grep -A 1 \
-e "\"node_modules/eslint\": {" \
-e "\"node_modules/typescript-eslint-utils-5\": {" \
test: npm run test
build: npm run build

What do you think @JoshuaKGoldberg?

@JoshuaKGoldberg
Copy link
Contributor Author

I'm ok with that! ESLint v8 has been out for ... quite a while.

},
"peerDependencies": {
"eslint": "^7.0.0 || ^8.0.0",
"eslint": "^8.0.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

While we're in the area ... we could do this, I think? So swapping (v7, v8) with (v8, v9)?

Suggested change
"eslint": "^8.0.0",
"eslint": "^8.0.0 || ^9.0.0",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or, heh, I suppose that's already covered in #79.

Copy link
Owner

@gund gund left a comment

Choose a reason for hiding this comment

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

LGTM

@gund gund merged commit 1365f7f into gund:master May 31, 2024
5 checks passed
Copy link

🎉 This PR is included in version 3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@JoshuaKGoldberg JoshuaKGoldberg deleted the tseslint-7-and-ts-api-utils branch June 1, 2024 13:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ESLint Flat Config compatibility
3 participants