Skip to content

Commit 183c316

Browse files
elicwhitefacebook-github-bot
authored andcommitted
Strengthen React Native eslint rules
Reviewed By: sahrens Differential Revision: D6670469 fbshipit-source-id: f4f86fd0921eab3697c10caaba00934ba8adc2f6
1 parent 6b95c4f commit 183c316

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Diff for: .eslintrc

+4-4
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"no-constant-condition": 0, // disallow use of constant expressions in conditions
8282
"no-control-regex": 1, // disallow control characters in regular expressions
8383
"no-debugger": 1, // disallow use of debugger
84-
"no-dupe-keys": 1, // disallow duplicate keys when creating object literals
84+
"no-dupe-keys": 2, // disallow duplicate keys when creating object literals
8585
"no-empty": 0, // disallow empty statements
8686
"no-ex-assign": 1, // disallow assigning to the exception in a catch block
8787
"no-extra-boolean-cast": 1, // disallow double-negation boolean casts in a boolean context
@@ -95,7 +95,7 @@
9595
"no-regex-spaces": 1, // disallow multiple spaces in a regular expression literal
9696
"no-reserved-keys": 0, // disallow reserved words being used as object literal keys (off by default)
9797
"no-sparse-arrays": 1, // disallow sparse arrays
98-
"no-unreachable": 1, // disallow unreachable statements after a return, throw, continue, or break statement
98+
"no-unreachable": 2, // disallow unreachable statements after a return, throw, continue, or break statement
9999
"use-isnan": 1, // disallow comparisons with the value NaN
100100
"valid-jsdoc": 0, // Ensure JSDoc comments are valid (off by default)
101101
"valid-typeof": 1, // Ensure that the results of typeof are compared against a valid string
@@ -116,7 +116,7 @@
116116
"no-div-regex": 1, // disallow division operators explicitly at beginning of regular expression (off by default)
117117
"no-else-return": 0, // disallow else after a return in an if (off by default)
118118
"no-eq-null": 0, // disallow comparisons to null without a type-checking operator (off by default)
119-
"no-eval": 1, // disallow use of eval()
119+
"no-eval": 2, // disallow use of eval()
120120
"no-extend-native": 1, // disallow adding to native types
121121
"no-extra-bind": 1, // disallow unnecessary function binding
122122
"no-fallthrough": 1, // disallow fallthrough of case statements
@@ -129,7 +129,7 @@
129129
"no-multi-str": 0, // disallow use of multiline strings
130130
"no-native-reassign": 0, // disallow reassignments of native objects
131131
"no-new": 1, // disallow use of new operator when not part of the assignment or comparison
132-
"no-new-func": 1, // disallow use of new operator for Function object
132+
"no-new-func": 2, // disallow use of new operator for Function object
133133
"no-new-wrappers": 1, // disallows creating new instances of String,Number, and Boolean
134134
"no-octal": 1, // disallow use of octal literals
135135
"no-octal-escape": 1, // disallow use of octal escape sequences in string literals, such as var foo = "Copyright \251";

Diff for: Libraries/Utilities/HMRClient.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Error: ${e.message}`
107107
// evaluating code) but on Chrome we can simply use eval
108108
const injectFunction = typeof global.nativeInjectHMRUpdate === 'function'
109109
? global.nativeInjectHMRUpdate
110-
: eval;
110+
: eval; // eslint-disable-line no-eval
111111

112112
injectFunction(code, sourceURLs[i]);
113113
});

0 commit comments

Comments
 (0)