Ignore:
Timestamp:
12/12/24 17:06:06 (5 weeks ago)
Author:
stefan toskovski <stefantoska84@…>
Branches:
main
Parents:
d565449
Message:

Pred finalna verzija

File:
1 edited

Legend:

Unmodified
Added
Removed
  • imaps-frontend/node_modules/eslint-plugin-react/lib/rules/jsx-sort-props.js

    rd565449 r0c6b92a  
    1313const jsxUtil = require('../util/jsx');
    1414const report = require('../util/report');
     15const propTypesSortUtil = require('../util/propTypesSort');
    1516const eslintUtil = require('../util/eslint');
    1617
     
    2122// Rule Definition
    2223// ------------------------------------------------------------------------------
    23 
    24 function isCallbackPropName(name) {
    25   return /^on[A-Z]/.test(name);
    26 }
    2724
    2825function isMultilineProp(node) {
     
    8683
    8784  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);
    9087    if (aIsCallback && !bIsCallback) {
    9188      return 1;
     
    280277 * Checks if the `reservedFirst` option is valid
    281278 * @param {Object} context The context of the rule
    282  * @param {Boolean|Array<String>} reservedFirst The `reservedFirst` option
    283  * @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`
    284281 */
    285282// eslint-disable-next-line consistent-return
     
    426423          const previousValue = memo.value;
    427424          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);
    430427
    431428          if (ignoreCase) {
Note: See TracChangeset for help on using the changeset viewer.