toggle-corp/react-rest-request

View on GitHub

Showing 27 of 27 total issues

Function createRequestClient has 249 lines of code (exceeds 100 allowed). Consider refactoring.
Open

export function createRequestClient<Props extends object, Params>(requests: { [key: string]: ClientAttributes<Props, Params>} = {}, consume?: string[]) {
    return (WrappedComponent: React.ComponentType<NewProps<Props, Params>>) => {
        const requestKeys = Object.keys(requests);
        const requestsOnMount = requestKeys.filter(key => requests[key].onMount);
        const requestsNonPersistent = requestKeys.filter(key => !requests[key].isPersistent);
Severity: Major
Found in src/RequestClient.tsx - About 6 hrs to fix

    Function createRequestCoordinator has 206 lines of code (exceeds 100 allowed). Consider refactoring.
    Open

    export const createRequestCoordinator = <Props, NewProps>(attributes: Attributes<Props, NewProps>) => (WrappedComponent: React.ComponentType<NewProps>) => {
        const {
            transformParams,
            transformResponse,
            transformErrors,
    Severity: Major
    Found in src/RequestCoordinator.tsx - About 5 hrs to fix

      Avoid too many return statements within this function.
      Open

                  return;
      Severity: Major
      Found in src/RestRequest.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return;
        Severity: Major
        Found in src/RestRequest.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return;
          Severity: Major
          Found in src/RestRequest.ts - About 30 mins to fix

            Sorry, description could not be provided due to the internal error: Error: rule named object-shorthand-properties-first is not found in the metadata. at IssueConverter.contentBody (/usr/src/app/dist/issueConverter.js:48:19) at IssueConverter.convert (/usr/src/app/dist/issueConverter.js:34:28) at MapSubscriber._next (/usr/src/app/node_modules/rxjs/internal/operators/map.js:49:35) at MapSubscriber.Subscriber.next (/usr/src/app/node_modules/rxjs/internal/Subscriber.js:66:18) at Observable._subscribe (/usr/src/app/node_modules/rxjs/internal/util/subscribeToArray.js:5:20) at Observable._trySubscribe (/usr/src/app/node_modules/rxjs/internal/Observable.js:44:25) at Observable.subscribe (/usr/src/app/node_modules/rxjs/internal/Observable.js:30:22) at MapOperator.call (/usr/src/app/node_modules/rxjs/internal/operators/map.js:32:23) at Observable.subscribe (/usr/src/app/node_modules/rxjs/internal/Observable.js:25:31) at CatchOperator.call (/usr/src/app/node_modules/rxjs/internal/operators/catchError.js:32:23)
            Open

            }
            Severity: Minor
            Found in src/RequestClient.tsx by tslint

            Don't assign members of this to local variables.
            Open

                        const { state } = this;
            Severity: Minor
            Found in src/RequestCoordinator.tsx by tslint

            Rule: no-this-assignment

            Disallows unnecessary references to this.

            Rationale

            Assigning a variable to this instead of properly using arrow lambdas may be a symptom of pre-ES6 practices or not managing scope well.

            Instead of storing a reference to this and using it inside a function () {:

            const self = this;
            
            setTimeout(function () {
                self.doWork();
            });

            Use () => arrow lambdas, as they preserve this scope for you:

            setTimeout(() => {
                this.doWork();
            });

            Config

            Two options may be provided on an object:

            • allow-destructuring allows using destructuring to access members of this (e.g. { foo, bar } = this;).
            • allowed-names may be specified as a list of regular expressions to match allowed variable names.
            Examples
            "no-this-assignment": true
            "no-this-assignment": true,[object Object]
            Schema
            {
              "additionalProperties": false,
              "properties": {
                "allow-destructuring": {
                  "type": "boolean"
                },
                "allowed-names": {
                  "listType": "string",
                  "type": "list"
                }
              },
              "type": "object"
            }

            For more information see this page.

            Missing trailing comma
            Open

                            `Max retries exceeded: ${urlValue}`, parameters
            Severity: Minor
            Found in src/RestRequest.ts by tslint

            Rule: trailing-comma

            Requires or disallows trailing commas in array and object literals, destructuring assignments, function typings, named imports and exports and function parameters.

            Notes
            • Has Fix

            Config

            One argument which is an object with the keys multiline and singleline. Both can be set to a string ("always" or "never") or an object.

            The object can contain any of the following keys: "arrays", "objects", "functions", "imports", "exports", and "typeLiterals"; each key can have one of the following values: "always", "never", and "ignore". Any missing keys will default to "ignore".

            • "multiline" checks multi-line object literals.
            • "singleline" checks single-line object literals.

            An array is considered "multiline" if its closing bracket is on a line after the last array element. The same general logic is followed for object literals, function typings, named import statements and function parameters.

            To align this rule with the ECMAScript specification that is implemented in modern JavaScript VMs, there is a third option esSpecCompliant. Set this option to true to disallow trailing comma on object and array rest and rest parameters.

            Examples
            "trailing-comma": true,[object Object]
            "trailing-comma": true,[object Object]
            Schema
            {
              "type": "object",
              "properties": {
                "multiline": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "always",
                        "never"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "arrays": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "exports": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "functions": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "imports": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "objects": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "typeLiterals": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        }
                      }
                    }
                  ]
                },
                "singleline": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "always",
                        "never"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "arrays": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "exports": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "functions": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "imports": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "objects": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "typeLiterals": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        }
                      }
                    }
                  ]
                },
                "esSpecCompliant": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            }

            For more information see this page.

            Missing trailing comma
            Open

                            `No success callback defined: ${urlValue}`, parameters
            Severity: Minor
            Found in src/RestRequest.ts by tslint

            Rule: trailing-comma

            Requires or disallows trailing commas in array and object literals, destructuring assignments, function typings, named imports and exports and function parameters.

            Notes
            • Has Fix

            Config

            One argument which is an object with the keys multiline and singleline. Both can be set to a string ("always" or "never") or an object.

            The object can contain any of the following keys: "arrays", "objects", "functions", "imports", "exports", and "typeLiterals"; each key can have one of the following values: "always", "never", and "ignore". Any missing keys will default to "ignore".

            • "multiline" checks multi-line object literals.
            • "singleline" checks single-line object literals.

            An array is considered "multiline" if its closing bracket is on a line after the last array element. The same general logic is followed for object literals, function typings, named import statements and function parameters.

            To align this rule with the ECMAScript specification that is implemented in modern JavaScript VMs, there is a third option esSpecCompliant. Set this option to true to disallow trailing comma on object and array rest and rest parameters.

            Examples
            "trailing-comma": true,[object Object]
            "trailing-comma": true,[object Object]
            Schema
            {
              "type": "object",
              "properties": {
                "multiline": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "always",
                        "never"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "arrays": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "exports": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "functions": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "imports": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "objects": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "typeLiterals": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        }
                      }
                    }
                  ]
                },
                "singleline": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "always",
                        "never"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "arrays": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "exports": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "functions": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "imports": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "objects": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "typeLiterals": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        }
                      }
                    }
                  ]
                },
                "esSpecCompliant": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            }

            For more information see this page.

            Missing semicolon
            Open

                        ])
            Severity: Minor
            Found in src/RestRequest.ts by tslint

            Rule: semicolon

            Enforces consistent semicolon usage at the end of every statement.

            Notes
            • Has Fix

            Config

            One of the following arguments must be provided:

            • "always" enforces semicolons at the end of every statement.
            • "never" disallows semicolons at the end of every statement except for when they are necessary.

            The following arguments may be optionally provided:

            • "ignore-interfaces" skips checking semicolons at the end of interface members.
            • "ignore-bound-class-methods" skips checking semicolons at the end of bound class methods.
            • "strict-bound-class-methods" disables any special handling of bound class methods and treats them as any other assignment. This option overrides "ignore-bound-class-methods".
            Examples
            "semicolon": true,always
            "semicolon": true,never
            "semicolon": true,always,ignore-interfaces
            "semicolon": true,always,ignore-bound-class-methods
            Schema
            {
              "type": "array",
              "items": [
                {
                  "type": "string",
                  "enum": [
                    "always",
                    "never"
                  ]
                },
                {
                  "type": "string",
                  "enum": [
                    "ignore-interfaces"
                  ]
                }
              ],
              "additionalItems": false
            }

            For more information see this page.

            Don't assign members of this to local variables.
            Open

                        const { state } = this;
            Severity: Minor
            Found in src/RequestCoordinator.tsx by tslint

            Rule: no-this-assignment

            Disallows unnecessary references to this.

            Rationale

            Assigning a variable to this instead of properly using arrow lambdas may be a symptom of pre-ES6 practices or not managing scope well.

            Instead of storing a reference to this and using it inside a function () {:

            const self = this;
            
            setTimeout(function () {
                self.doWork();
            });

            Use () => arrow lambdas, as they preserve this scope for you:

            setTimeout(() => {
                this.doWork();
            });

            Config

            Two options may be provided on an object:

            • allow-destructuring allows using destructuring to access members of this (e.g. { foo, bar } = this;).
            • allowed-names may be specified as a list of regular expressions to match allowed variable names.
            Examples
            "no-this-assignment": true
            "no-this-assignment": true,[object Object]
            Schema
            {
              "additionalProperties": false,
              "properties": {
                "allow-destructuring": {
                  "type": "boolean"
                },
                "allowed-names": {
                  "listType": "string",
                  "type": "list"
                }
              },
              "type": "object"
            }

            For more information see this page.

            Missing semicolon
            Open

                captureStackTrace(thisArg: any, func: any): void
            Severity: Minor
            Found in node.d.ts by tslint

            Rule: semicolon

            Enforces consistent semicolon usage at the end of every statement.

            Notes
            • Has Fix

            Config

            One of the following arguments must be provided:

            • "always" enforces semicolons at the end of every statement.
            • "never" disallows semicolons at the end of every statement except for when they are necessary.

            The following arguments may be optionally provided:

            • "ignore-interfaces" skips checking semicolons at the end of interface members.
            • "ignore-bound-class-methods" skips checking semicolons at the end of bound class methods.
            • "strict-bound-class-methods" disables any special handling of bound class methods and treats them as any other assignment. This option overrides "ignore-bound-class-methods".
            Examples
            "semicolon": true,always
            "semicolon": true,never
            "semicolon": true,always,ignore-interfaces
            "semicolon": true,always,ignore-bound-class-methods
            Schema
            {
              "type": "array",
              "items": [
                {
                  "type": "string",
                  "enum": [
                    "always",
                    "never"
                  ]
                },
                {
                  "type": "string",
                  "enum": [
                    "ignore-interfaces"
                  ]
                }
              ],
              "additionalItems": false
            }

            For more information see this page.

            Missing trailing comma
            Open

                            `No failure callback defined: ${urlValue}`, parameters
            Severity: Minor
            Found in src/RestRequest.ts by tslint

            Rule: trailing-comma

            Requires or disallows trailing commas in array and object literals, destructuring assignments, function typings, named imports and exports and function parameters.

            Notes
            • Has Fix

            Config

            One argument which is an object with the keys multiline and singleline. Both can be set to a string ("always" or "never") or an object.

            The object can contain any of the following keys: "arrays", "objects", "functions", "imports", "exports", and "typeLiterals"; each key can have one of the following values: "always", "never", and "ignore". Any missing keys will default to "ignore".

            • "multiline" checks multi-line object literals.
            • "singleline" checks single-line object literals.

            An array is considered "multiline" if its closing bracket is on a line after the last array element. The same general logic is followed for object literals, function typings, named import statements and function parameters.

            To align this rule with the ECMAScript specification that is implemented in modern JavaScript VMs, there is a third option esSpecCompliant. Set this option to true to disallow trailing comma on object and array rest and rest parameters.

            Examples
            "trailing-comma": true,[object Object]
            "trailing-comma": true,[object Object]
            Schema
            {
              "type": "object",
              "properties": {
                "multiline": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "always",
                        "never"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "arrays": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "exports": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "functions": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "imports": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "objects": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "typeLiterals": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        }
                      }
                    }
                  ]
                },
                "singleline": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "always",
                        "never"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "arrays": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "exports": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "functions": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "imports": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "objects": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "typeLiterals": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        }
                      }
                    }
                  ]
                },
                "esSpecCompliant": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            }

            For more information see this page.

            Missing trailing comma
            Open

                            `No fatal callback defined: ${urlValue}`, parameters
            Severity: Minor
            Found in src/RestRequest.ts by tslint

            Rule: trailing-comma

            Requires or disallows trailing commas in array and object literals, destructuring assignments, function typings, named imports and exports and function parameters.

            Notes
            • Has Fix

            Config

            One argument which is an object with the keys multiline and singleline. Both can be set to a string ("always" or "never") or an object.

            The object can contain any of the following keys: "arrays", "objects", "functions", "imports", "exports", and "typeLiterals"; each key can have one of the following values: "always", "never", and "ignore". Any missing keys will default to "ignore".

            • "multiline" checks multi-line object literals.
            • "singleline" checks single-line object literals.

            An array is considered "multiline" if its closing bracket is on a line after the last array element. The same general logic is followed for object literals, function typings, named import statements and function parameters.

            To align this rule with the ECMAScript specification that is implemented in modern JavaScript VMs, there is a third option esSpecCompliant. Set this option to true to disallow trailing comma on object and array rest and rest parameters.

            Examples
            "trailing-comma": true,[object Object]
            "trailing-comma": true,[object Object]
            Schema
            {
              "type": "object",
              "properties": {
                "multiline": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "always",
                        "never"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "arrays": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "exports": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "functions": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "imports": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "objects": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "typeLiterals": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        }
                      }
                    }
                  ]
                },
                "singleline": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "always",
                        "never"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "arrays": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "exports": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "functions": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "imports": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "objects": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        },
                        "typeLiterals": {
                          "type": "string",
                          "enum": [
                            "always",
                            "never",
                            "ignore"
                          ]
                        }
                      }
                    }
                  ]
                },
                "esSpecCompliant": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            }

            For more information see this page.

            Missing semicolon
            Open

                        ])
            Severity: Minor
            Found in src/RestRequest.ts by tslint

            Rule: semicolon

            Enforces consistent semicolon usage at the end of every statement.

            Notes
            • Has Fix

            Config

            One of the following arguments must be provided:

            • "always" enforces semicolons at the end of every statement.
            • "never" disallows semicolons at the end of every statement except for when they are necessary.

            The following arguments may be optionally provided:

            • "ignore-interfaces" skips checking semicolons at the end of interface members.
            • "ignore-bound-class-methods" skips checking semicolons at the end of bound class methods.
            • "strict-bound-class-methods" disables any special handling of bound class methods and treats them as any other assignment. This option overrides "ignore-bound-class-methods".
            Examples
            "semicolon": true,always
            "semicolon": true,never
            "semicolon": true,always,ignore-interfaces
            "semicolon": true,always,ignore-bound-class-methods
            Schema
            {
              "type": "array",
              "items": [
                {
                  "type": "string",
                  "enum": [
                    "always",
                    "never"
                  ]
                },
                {
                  "type": "string",
                  "enum": [
                    "ignore-interfaces"
                  ]
                }
              ],
              "additionalItems": false
            }

            For more information see this page.

            Missing semicolon
            Open

                    })
            Severity: Minor
            Found in src/RestRequest.ts by tslint

            Rule: semicolon

            Enforces consistent semicolon usage at the end of every statement.

            Notes
            • Has Fix

            Config

            One of the following arguments must be provided:

            • "always" enforces semicolons at the end of every statement.
            • "never" disallows semicolons at the end of every statement except for when they are necessary.

            The following arguments may be optionally provided:

            • "ignore-interfaces" skips checking semicolons at the end of interface members.
            • "ignore-bound-class-methods" skips checking semicolons at the end of bound class methods.
            • "strict-bound-class-methods" disables any special handling of bound class methods and treats them as any other assignment. This option overrides "ignore-bound-class-methods".
            Examples
            "semicolon": true,always
            "semicolon": true,never
            "semicolon": true,always,ignore-interfaces
            "semicolon": true,always,ignore-bound-class-methods
            Schema
            {
              "type": "array",
              "items": [
                {
                  "type": "string",
                  "enum": [
                    "always",
                    "never"
                  ]
                },
                {
                  "type": "string",
                  "enum": [
                    "ignore-interfaces"
                  ]
                }
              ],
              "additionalItems": false
            }

            For more information see this page.

            variable name must be in lowerCamelCase or UPPER_CASE
            Open

            export const createRequestCoordinator = <Props, NewProps>(attributes: Attributes<Props, NewProps>) => (WrappedComponent: React.ComponentType<NewProps>) => {
            Severity: Minor
            Found in src/RequestCoordinator.tsx by tslint

            Rule: variable-name

            Checks variable names for various errors.

            Config

            Several arguments may be optionally provided:

            • "check-format" enbables enforcement of a certain naming format. By default, the rule only allows only lowerCamelCased or UPPER_CASED variable names.
              • These additional options make the check stricter:
              • "require-const-for-all-caps": enforces that all variables with UPPER_CASED names should be const.
              • These additional options make the check more permissive:
              • "allow-leading-underscore" allows underscores at the beginning (only has an effect if "check-format" specified)
              • "allow-pascal-case" allows PascalCase in addition to lowerCamelCase.
              • "allow-snake-case" allows snake_case in addition to lowerCamelCase.
              • "allow-trailing-underscore" allows underscores at the end. (only has an effect if "check-format" specified)
            • "ban-keywords": disallows the use of certain TypeScript keywords as variable or parameter names.
              • These are: any, Number, number, String, string, Boolean, boolean, Undefined, undefined
            Examples
            "variable-name": [object Object]
            Schema
            {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "check-format",
                  "allow-leading-underscore",
                  "allow-pascal-case",
                  "allow-snake-case",
                  "allow-trailing-underscore",
                  "require-const-for-all-caps",
                  "ban-keywords"
                ]
              },
              "minLength": 0,
              "maxLength": 6
            }

            For more information see this page.

            Exceeds maximum line length of 100
            Open

            export const createRequestCoordinator = <Props, NewProps>(attributes: Attributes<Props, NewProps>) => (WrappedComponent: React.ComponentType<NewProps>) => {
            Severity: Minor
            Found in src/RequestCoordinator.tsx by tslint

            Rule: max-line-length

            Requires lines to be under a certain max length.

            Rationale

            Limiting the length of a line of code improves code readability. It also makes comparing code side-by-side easier and improves compatibility with various editors, IDEs, and diff viewers.

            Config

            It can take one argument, which can be any of the following: * integer indicating maximum length of lines. * object with keys: * limit - number greater than 0 defining the max line length * ignore-pattern - string defining ignore pattern for this rule, being parsed by new RegExp(). For example: * // pattern will ignore all in-line comments. * ^import pattern will ignore all import statements. * ^export {(.*?)} pattern will ignore all multiple export statements. * class [a-zA-Z]+ implements pattern will ignore all class declarations implementing interfaces. * ^import |^export {(.*?)}|class [a-zA-Z]+ implements |// pattern will ignore all the cases listed above. * check-strings - determines if strings should be checked, false by default. * check-regex - determines if regular expressions should be checked, false by default.

            Examples
            "max-line-length": true,120
            "max-line-length": true,[object Object]
            Schema
            {
              "type": "array",
              "items": {
                "oneOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "limit": {
                        "type": "number"
                      },
                      "ignore-pattern": {
                        "type": "string"
                      },
                      "check-strings": {
                        "type": "boolean"
                      },
                      "check-regex": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  }
                ]
              },
              "minLength": 1,
              "maxLength": 2
            }

            For more information see this page.

            Don't assign members of this to local variables.
            Open

                        const { state } = this;
            Severity: Minor
            Found in src/RequestCoordinator.tsx by tslint

            Rule: no-this-assignment

            Disallows unnecessary references to this.

            Rationale

            Assigning a variable to this instead of properly using arrow lambdas may be a symptom of pre-ES6 practices or not managing scope well.

            Instead of storing a reference to this and using it inside a function () {:

            const self = this;
            
            setTimeout(function () {
                self.doWork();
            });

            Use () => arrow lambdas, as they preserve this scope for you:

            setTimeout(() => {
                this.doWork();
            });

            Config

            Two options may be provided on an object:

            • allow-destructuring allows using destructuring to access members of this (e.g. { foo, bar } = this;).
            • allowed-names may be specified as a list of regular expressions to match allowed variable names.
            Examples
            "no-this-assignment": true
            "no-this-assignment": true,[object Object]
            Schema
            {
              "additionalProperties": false,
              "properties": {
                "allow-destructuring": {
                  "type": "boolean"
                },
                "allowed-names": {
                  "listType": "string",
                  "type": "list"
                }
              },
              "type": "object"
            }

            For more information see this page.

            variable name must be in lowerCamelCase or UPPER_CASE
            Open

            export const RequestContext = React.createContext<Context>(
            Severity: Minor
            Found in src/RequestContext.ts by tslint

            Rule: variable-name

            Checks variable names for various errors.

            Config

            Several arguments may be optionally provided:

            • "check-format" enbables enforcement of a certain naming format. By default, the rule only allows only lowerCamelCased or UPPER_CASED variable names.
              • These additional options make the check stricter:
              • "require-const-for-all-caps": enforces that all variables with UPPER_CASED names should be const.
              • These additional options make the check more permissive:
              • "allow-leading-underscore" allows underscores at the beginning (only has an effect if "check-format" specified)
              • "allow-pascal-case" allows PascalCase in addition to lowerCamelCase.
              • "allow-snake-case" allows snake_case in addition to lowerCamelCase.
              • "allow-trailing-underscore" allows underscores at the end. (only has an effect if "check-format" specified)
            • "ban-keywords": disallows the use of certain TypeScript keywords as variable or parameter names.
              • These are: any, Number, number, String, string, Boolean, boolean, Undefined, undefined
            Examples
            "variable-name": [object Object]
            Schema
            {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "check-format",
                  "allow-leading-underscore",
                  "allow-pascal-case",
                  "allow-snake-case",
                  "allow-trailing-underscore",
                  "require-const-for-all-caps",
                  "ban-keywords"
                ]
              },
              "minLength": 0,
              "maxLength": 6
            }

            For more information see this page.

            Severity
            Category
            Status
            Source
            Language