yannickcr/eslint-plugin-react

View on GitHub

Showing 502 of 700 total issues

Function JSXElement has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    JSXElement(node) {
      const elementName = node.openingElement.name.name;

      if (!isVoidDOMElement(elementName)) {
        // e.g. <div />
Severity: Minor
Found in lib/rules/void-dom-elements-no-children.js - About 1 hr to fix

    Function reportUnusedPropType has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function reportUnusedPropType(component, props) {
          // Skip props that check instances
          if (props === true) {
            return;
          }
    Severity: Minor
    Found in lib/rules/no-unused-prop-types.js - About 1 hr to fix

      Function create has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        create(context) {
          const option = context.options[0] || 'always';
          return {
            'ClassProperty, PropertyDefinition'(node) {
              if (
      Severity: Minor
      Found in lib/rules/state-in-constructor.js - About 1 hr to fix

        Function create has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          create(context) {
            const configuration = context.options[0] || {};
            const forbid = new Map((configuration.forbid || DEFAULTS).map((value) => {
              const propName = typeof value === 'string' ? value : value.propName;
              return [propName, {
        Severity: Minor
        Found in lib/rules/forbid-dom-props.js - About 1 hr to fix

          Function handleClosingElement has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function handleClosingElement(node) {
                if (!node.parent) {
                  return;
                }
          
          
          Severity: Minor
          Found in lib/rules/jsx-closing-tag-location.js - About 1 hr to fix

            Function refersToReactFragment has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function refersToReactFragment(node, name) {
                  const variableInit = variableUtil.findVariableByName(context, node, name);
                  if (!variableInit) {
                    return false;
                  }
            Severity: Minor
            Found in lib/rules/jsx-fragments.js - About 1 hr to fix

              Function MemberExpression has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  MemberExpression(node) {
                    const isDefaultProp = propsUtil.isDefaultPropsDeclaration(node);
              
                    if (!isDefaultProp) {
                      return;
              Severity: Minor
              Found in lib/util/defaultProps.js - About 1 hr to fix

                Function getPropertyName has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function getPropertyName(context, node, utils, checkAsyncSafeLifeCycles) {
                  const property = node.property;
                  if (property) {
                    switch (property.type) {
                      case 'Identifier':
                Severity: Minor
                Found in lib/util/usedPropTypes.js - About 1 hr to fix

                  Function CallExpression has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        CallExpression(node) {
                          const callee = node.callee;
                          const parent = node.parent;
                          if (callee.type !== 'MemberExpression') {
                            return;
                  Severity: Minor
                  Found in lib/rules/no-render-return-value.js - About 1 hr to fix

                    Function findAllTypeAnnotations has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function findAllTypeAnnotations(identifier, node) {
                          if (node.type === 'TSTypeLiteral' || node.type === 'ObjectTypeAnnotation' || node.type === 'TSInterfaceBody') {
                            const currentNode = [].concat(
                              objectTypeAnnotations.get(identifier.name) || [],
                              node
                    Severity: Minor
                    Found in lib/rules/boolean-prop-naming.js - About 1 hr to fix

                      Function create has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        create(context) {
                          const configuration = context.options[0] || {};
                          const ignoreCase = configuration.ignoreCase || false;
                      
                          return {
                      Severity: Minor
                      Found in lib/rules/jsx-no-duplicate-props.js - About 1 hr to fix

                        Function handleOpeningElement has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function handleOpeningElement(node) {
                              const sourceCode = getSourceCode(context);
                              let prevToken = sourceCode.getTokenBefore(node);
                              if (!prevToken) {
                                return;
                        Severity: Minor
                        Found in lib/rules/jsx-indent.js - About 1 hr to fix

                          Function reportErrorIfLifecycleMethodCasingTypo has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function reportErrorIfLifecycleMethodCasingTypo(node) {
                                const key = node.key;
                                let nodeKeyName = key.name;
                                if (key.type === 'Literal') {
                                  nodeKeyName = key.value;
                          Severity: Minor
                          Found in lib/rules/no-typos.js - About 1 hr to fix

                            Function Program:exit has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  'Program:exit'() {
                                    const list = components.list();
                            
                                    values(list).filter((component) => {
                                      if (functions === 'ignore' && astUtil.isFunctionLike(component.node)) {
                            Severity: Minor
                            Found in lib/rules/require-default-props.js - About 1 hr to fix

                              Consider simplifying this complex logical expression.
                              Open

                                          if (
                                            (ancestor.type !== 'Property' && ancestor.type !== 'MethodDefinition' && ancestor.type !== 'ClassProperty' && ancestor.type !== 'PropertyDefinition')
                                            || !nameMatches(ancestor.key.name)
                                            || (mode !== 'disallow-in-func' && depth > 1)
                                          ) {
                              Severity: Major
                              Found in lib/util/makeNoMethodSetStateRule.js - About 1 hr to fix

                                Consider simplifying this complex logical expression.
                                Open

                                    if (
                                      value
                                      && value.type === 'CallExpression'
                                      && value.callee
                                      && value.callee.property
                                Severity: Major
                                Found in lib/util/propTypes.js - About 1 hr to fix

                                  Function fixPropTypesSort has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                    context,
                                    fixer,
                                    declarations,
                                    ignoreCase,
                                    requiredFirst,
                                  Severity: Major
                                  Found in lib/util/propTypesSort.js - About 1 hr to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                            if (
                                              !node.value
                                              || !node.value.expression
                                              || (!checkInlineFunction && isInlineHandler(node))
                                              || (
                                    Severity: Major
                                    Found in lib/rules/jsx-handler-names.js - About 1 hr to fix

                                      Consider simplifying this complex logical expression.
                                      Open

                                            if (
                                              parent.type && parent.type === 'JSXAttribute'
                                              && (node.expression && node.expression.type
                                                && node.expression.type !== 'Literal'
                                                && node.expression.type !== 'StringLiteral'
                                      Severity: Major
                                      Found in lib/rules/jsx-curly-brace-presence.js - About 1 hr to fix

                                        Consider simplifying this complex logical expression.
                                        Open

                                              if (node.type === 'CallExpression'
                                                  && node.callee
                                                  && node.callee.type === 'Identifier'
                                                  && node.callee.name === 'String'
                                                  && Array.isArray(node.arguments)
                                        Severity: Major
                                        Found in lib/rules/no-array-index-key.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language