Skip to content

Commit c2e15c2

Browse files
Fix incorrect no-shadow warnings for TS enums (#315)
* fix: bad no-shadow warnings for TS enums * chore: add changeset
1 parent eade664 commit c2e15c2

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

.changeset/witty-guests-laugh.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"eslint-config-godaddy-react-typescript": patch
3+
"eslint-config-godaddy-typescript": patch
4+
---
5+
6+
Fix incorrect no-shadow warnings for TS enums

packages/eslint-config-godaddy-react-typescript/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ module.exports = {
2121
args: 'after-used',
2222
ignoreRestSiblings: false
2323
}
24-
]
24+
],
25+
// Disable the base rule and enable TypeScript version to avoid incorrect reports
26+
// See https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-shadow.md
27+
'no-shadow': 'off',
28+
'@typescript-eslint/no-shadow': 'warn'
2529
}
2630
},
2731
{

packages/eslint-config-godaddy-typescript/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ module.exports = {
2020
args: 'after-used',
2121
ignoreRestSiblings: false
2222
}
23-
]
23+
],
24+
// Disable the base rule and enable TypeScript version to avoid incorrect reports
25+
// See https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-shadow.md
26+
'no-shadow': 'off',
27+
'@typescript-eslint/no-shadow': 'warn'
2428
}
2529
}
2630
]

0 commit comments

Comments
 (0)