Skip to content

Commit a67375c

Browse files
authored
fix(lint): typescript requires special no-shadow (#238)
In pure javascript eslint config from `@react-native-community`, the no-shadow rule is on, which is good, but for typescript it generates false-positives and needs a specific configuration change to use a typescript-specific rule Reference: - https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-shadow.md - typescript-eslint/typescript-eslint#2552 (comment)
1 parent 1d836de commit a67375c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

template/_eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
module.exports = {
22
root: true,
33
extends: '@react-native-community',
4+
rules: {
5+
"no-shadow": "off",
6+
"@typescript-eslint/no-shadow": ["error"],
7+
},
48
};

0 commit comments

Comments
 (0)