From 85d9acbcac395ac3f5778df904b8c39f9bda08b9 Mon Sep 17 00:00:00 2001 From: zanminkian Date: Sat, 23 Nov 2024 09:20:08 +0000 Subject: [PATCH] refactor(eslint-config): replace `eslint-plugin-deprecation` with `@typescript-eslint/no-deprecated` --- .changeset/light-dodos-repair.md | 5 +++++ packages/eslint-config/package.json | 1 - packages/eslint-config/src/config/typescript.ts | 5 +---- 3 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 .changeset/light-dodos-repair.md diff --git a/.changeset/light-dodos-repair.md b/.changeset/light-dodos-repair.md new file mode 100644 index 00000000..edc2d1ff --- /dev/null +++ b/.changeset/light-dodos-repair.md @@ -0,0 +1,5 @@ +--- +"@fenge/eslint-config": patch +--- + +refactor(eslint-config): replace `eslint-plugin-deprecation` with `@typescript-eslint/no-deprecated` diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index 460172ba..8e47c6e5 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -32,7 +32,6 @@ "@typescript-eslint/eslint-plugin": "8.15.0", "@typescript-eslint/parser": "8.15.0", "confusing-browser-globals": "1.0.11", - "eslint-plugin-deprecation": "3.0.0", "eslint-plugin-es-x": "8.4.1", "eslint-plugin-esm": "workspace:*", "eslint-plugin-fp": "2.3.0", diff --git a/packages/eslint-config/src/config/typescript.ts b/packages/eslint-config/src/config/typescript.ts index 5c41f08a..c0e68858 100644 --- a/packages/eslint-config/src/config/typescript.ts +++ b/packages/eslint-config/src/config/typescript.ts @@ -1,7 +1,6 @@ import process from "node:process"; import * as fengeTsPlugin from "@fenge/eslint-plugin-ts"; import tsParser from "@typescript-eslint/parser"; -import deprecationPlugin from "eslint-plugin-deprecation"; // TODO: Remove this plugin and use `@typescript-eslint/no-deprecated` when eslint upgraded to 9. import { javascript } from "./javascript.js"; export function typescript(project?: string) { @@ -89,15 +88,12 @@ export function typescript(project?: string) { }, plugins: { ...jsConfig.plugins, - deprecation: deprecationPlugin, "@fenge-ts": fengeTsPlugin, }, rules: { ...jsConfig.rules, ...getTsExtensionRules(), - // deprecation - "deprecation/deprecation": "error", // fenge "@fenge-ts/exact-map-set-type": "error", "@fenge-ts/no-const-enum": "error", @@ -160,6 +156,7 @@ export function typescript(project?: string) { { ignoredTypeNames: [] }, ], "@typescript-eslint/no-confusing-non-null-assertion": "error", + "@typescript-eslint/no-deprecated": "error", "@typescript-eslint/no-duplicate-enum-values": "error", "@typescript-eslint/no-duplicate-type-constituents": "error", "@typescript-eslint/no-empty-object-type": "error",