You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[prefer-checked](https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-checked.md)|👍 | 🔧 |prefer toBeChecked over checking attributes |
104
-
|[prefer-empty](https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-empty.md)|👍 | 🔧 |Prefer toBeEmpty over checking innerHTML |
105
-
|[prefer-enabled-disabled](https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-enabled-disabled.md)|👍 | 🔧 |prefer toBeDisabled or toBeEnabled over checking attributes |
106
-
|[prefer-focus](https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-focus.md)|👍 | 🔧 |prefer toHaveFocus over checking document.activeElement |
107
-
|[prefer-in-document](https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-in-document.md)|👍 | 🔧 |Prefer .toBeInTheDocument() for asserting the existence of a DOM node |
108
-
|[prefer-required](https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-required.md)|👍 | 🔧 |prefer toBeRequired over checking properties |
109
-
|[prefer-to-have-attribute](https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-to-have-attribute.md)|👍 | 🔧 |prefer toHaveAttribute over checking getAttribute/hasAttribute |
110
-
|[prefer-to-have-class](https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-to-have-class.md)|👍 | 🔧 |prefer toHaveClass over checking element className |
111
-
|[prefer-to-have-style](https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-to-have-style.md)|👍 | 🔧 |prefer toHaveStyle over checking element style |
112
-
|[prefer-to-have-text-content](https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-to-have-text-content.md)|👍 | 🔧 |Prefer toHaveTextContent over checking element.textContent |
113
-
|[prefer-to-have-value](https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-to-have-value.md)|👍 | 🔧 |prefer toHaveValue over checking element.value |
114
-
115
-
<!--__END AUTOGENERATED TABLE__-->
95
+
<!-- begin auto-generated rules list -->
96
+
97
+
💼 Configurations enabled in.\
98
+
✅ Set in the `recommended` configuration.\
99
+
🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).
Copy file name to clipboardExpand all lines: docs/rules/prefer-to-have-class.md
+7-1
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,10 @@
1
-
# prefer toHaveClass over checking element.class (prefer-to-have-class)
1
+
# Prefer toHaveClass over checking element className (`jest-dom/prefer-to-have-class`)
2
+
3
+
💼 This rule is enabled in the ✅ `recommended` config.
4
+
5
+
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
6
+
7
+
<!-- end auto-generated rule header -->
2
8
3
9
This rule is an autofixable rule that reports usages of checking element className or classList in expect statements in preference of using the jest-dom
0 commit comments