Skip to content
This repository was archived by the owner on Sep 1, 2024. It is now read-only.

Commit 51282ab

Browse files
KonstHardyljharb
authored andcommitted
[eslint] enable some rules
Additional ESLint rules: "no-multi-spaces": ["error"], "key-spacing": ["error"] "no-multi-spaces" - Disallow multiple spaces; "key-spacing" - Enforce consistent spacing between keys and values in object literal properties;
1 parent 8291c36 commit 51282ab

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
prop-types.min.js

.eslintrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
},
1010
"rules": {
1111
"no-console": "off",
12+
"no-multi-spaces": ["error"],
13+
"key-spacing": ["error"],
1214
},
1315
"overrides": [
1416
{

factoryWithTypeCheckers.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
196196
) {
197197
printWarning(
198198
'You are manually calling a React.PropTypes validation ' +
199-
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
199+
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
200200
'and will throw in the standalone `prop-types` package. ' +
201201
'You may be seeing this warning due to a third-party PropTypes ' +
202202
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
@@ -445,8 +445,7 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
445445
if (propType !== 'object') {
446446
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
447447
}
448-
// We need to check all keys in case some are required but missing from
449-
// props.
448+
// We need to check all keys in case some are required but missing from props.
450449
var allKeys = assign({}, props[propName], shapeTypes);
451450
for (var key in allKeys) {
452451
var checker = shapeTypes[key];
@@ -457,7 +456,7 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
457456
return new PropTypeError(
458457
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
459458
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
460-
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
459+
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
461460
);
462461
}
463462
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);

0 commit comments

Comments
 (0)