Skip to content

Commit

Permalink
feat(remix-eslint-config): add deprecation warning to `@remix-run/esl…
Browse files Browse the repository at this point in the history
…int-config/jest` ESLint config
  • Loading branch information
MichaelDeBoey committed Mar 7, 2023
1 parent b33d098 commit 64dda4b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/wicked-hairs-tell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/eslint-config": minor
---

add deprecation warning to `@remix-run/eslint-config/jest` ESLint config
17 changes: 17 additions & 0 deletions packages/remix-eslint-config/jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down

0 comments on commit 64dda4b

Please sign in to comment.