From 6f476aa046a503ee75e697d0c5bcc99dbecf1b01 Mon Sep 17 00:00:00 2001 From: Mike Hardy Date: Sun, 28 Nov 2021 15:34:04 -0500 Subject: [PATCH] fix(lint): typescript requires special no-shadow 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 - https://github.com/typescript-eslint/typescript-eslint/issues/2552#issuecomment-691694839 --- template/_eslintrc.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/template/_eslintrc.js b/template/_eslintrc.js index 40c6dcd0..7b39f297 100644 --- a/template/_eslintrc.js +++ b/template/_eslintrc.js @@ -1,4 +1,8 @@ module.exports = { root: true, extends: '@react-native-community', + rules: { + "no-shadow": "off", + "@typescript-eslint/no-shadow": ["error"], + }, };