Skip to content

Commit 31b2212

Browse files
committed
[patch] no-autofocus: don't report error if autoFocus is set to false
This change adjusts the error condition for `no-autofocus` to allow for manually disabling `autoFocus`. Now, any usage of `autoFocus="false"` or `autoFocus={false}` will not report.
1 parent a878036 commit 31b2212

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/rules/no-autofocus.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ export default {
4848

4949
// Fail if autoFocus is used and the value is anything other than false (either via an expression or string literal).
5050
if (propName(attribute) === 'autoFocus' && getPropValue(attribute) !== 'false') {
51+
// eslint-disable-next-line no-console
52+
console.log(`attribute: ${attribute}`);
53+
// eslint-disable-next-line no-console
54+
console.log(`attribute value: ${getPropValue(attribute)}`);
5155
context.report({
5256
node: attribute,
5357
message: errorMessage,

0 commit comments

Comments
 (0)