diff --git a/.changeset/wicked-hairs-tell.md b/.changeset/wicked-hairs-tell.md new file mode 100644 index 00000000000..edfb0d34c55 --- /dev/null +++ b/.changeset/wicked-hairs-tell.md @@ -0,0 +1,5 @@ +--- +"@remix-run/eslint-config": minor +--- + +add deprecation warning to `@remix-run/eslint-config/jest` ESLint config diff --git a/packages/remix-eslint-config/jest.js b/packages/remix-eslint-config/jest.js index f69586b6fac..dac2ee8da83 100644 --- a/packages/remix-eslint-config/jest.js +++ b/packages/remix-eslint-config/jest.js @@ -6,6 +6,23 @@ const jestRules = require("./rules/jest"); */ require("@rushstack/eslint-patch/modern-module-resolution"); +const alreadyWarned = {}; +const warnOnce = (condition, message) => { + if (!condition && !alreadyWarned[message]) { + alreadyWarned[message] = true; + console.warn(message); + } +}; + +warnOnce( + false, + "⚠️ DEPRECATED: The `@remix-run/eslint-config/jest` ESLint config " + + "has been deprecated in favor of " + + "`@remix-run/eslint-config/jest-testing-library` and will be removed in " + + "Remix v2. Please update your code to use " + + "`@remix-run/eslint-config/jest-testing-library` instead." +); + /** * @deprecated Use `@remix-run/eslint-config/jest-testing-library` instead. */