Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/eslint-plugin-react/lib/rules/jsx-sort-props.js
rd565449 r0c6b92a 13 13 const jsxUtil = require('../util/jsx'); 14 14 const report = require('../util/report'); 15 const propTypesSortUtil = require('../util/propTypesSort'); 15 16 const eslintUtil = require('../util/eslint'); 16 17 … … 21 22 // Rule Definition 22 23 // ------------------------------------------------------------------------------ 23 24 function isCallbackPropName(name) {25 return /^on[A-Z]/.test(name);26 }27 24 28 25 function isMultilineProp(node) { … … 86 83 87 84 if (options.callbacksLast) { 88 const aIsCallback = isCallbackPropName(aProp);89 const bIsCallback = isCallbackPropName(bProp);85 const aIsCallback = propTypesSortUtil.isCallbackPropName(aProp); 86 const bIsCallback = propTypesSortUtil.isCallbackPropName(bProp); 90 87 if (aIsCallback && !bIsCallback) { 91 88 return 1; … … 280 277 * Checks if the `reservedFirst` option is valid 281 278 * @param {Object} context The context of the rule 282 * @param { Boolean|Array<String>} reservedFirst The `reservedFirst` option283 * @return {Function |undefined} If an error is detected, a function to generate the error message, otherwise, `undefined`279 * @param {boolean | string[]} reservedFirst The `reservedFirst` option 280 * @return {Function | undefined} If an error is detected, a function to generate the error message, otherwise, `undefined` 284 281 */ 285 282 // eslint-disable-next-line consistent-return … … 426 423 const previousValue = memo.value; 427 424 const currentValue = decl.value; 428 const previousIsCallback = isCallbackPropName(previousPropName);429 const currentIsCallback = isCallbackPropName(currentPropName);425 const previousIsCallback = propTypesSortUtil.isCallbackPropName(previousPropName); 426 const currentIsCallback = propTypesSortUtil.isCallbackPropName(currentPropName); 430 427 431 428 if (ignoreCase) {
Note:
See TracChangeset
for help on using the changeset viewer.