andreujuanc/CherryDb

View on GitHub

Showing 183 of 183 total issues

Forbidden 'var' keyword, use 'let' or 'const' instead
Open

            var myIndex = store.index('id');

Rule: no-var-keyword

Disallows usage of the var keyword.

Use let or const instead.

Rationale

Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

Notes
  • Has Fix

Config

Not configurable.

Examples
"no-var-keyword": true

For more information see this page.

Identifier 'request' is never reassigned; use 'const' instead of 'let'.
Open

            let request = store.getKey(id);

Rule: prefer-const

Requires that variable declarations use const instead of let and var if possible.

If a variable is only assigned to once when it is declared, it should be declared using 'const'

Notes
  • Has Fix

Config

An optional object containing the property "destructuring" with two possible values:

  • "any" (default) - If any variable in destructuring can be const, this rule warns for those variables.
  • "all" - Only warns if all variables in destructuring can be const.
Examples
"prefer-const": true
"prefer-const": true,[object Object]
Schema
{
  "type": "object",
  "properties": {
    "destructuring": {
      "type": "string",
      "enum": [
        "all",
        "any"
      ]
    }
  }
}

For more information see this page.

" should be '
Open

import IRequest from "./IRequest";
Severity: Minor
Found in client/src/endpoint/FetchRequest.ts by tslint

Rule: quotemark

Enforces quote character for string literals.

Notes
  • Has Fix

Config

Five arguments may be optionally provided:

  • "single" enforces single quotes.
  • "double" enforces double quotes.
  • "backtick" enforces backticks.
  • "jsx-single" enforces single quotes for JSX attributes.
  • "jsx-double" enforces double quotes for JSX attributes.
  • "avoid-template" forbids single-line untagged template strings that do not contain string interpolations. Note that backticks may still be used if "avoid-escape" is enabled and both single and double quotes are present in the string (the latter option takes precedence).
  • "avoid-escape" allows you to use the "other" quotemark in cases where escaping would normally be required. For example, [true, "double", "avoid-escape"] would not report a failure on the string literal 'Hello "World"'.
Examples
"quotemark": true,single,avoid-escape,avoid-template
"quotemark": true,single,jsx-double
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "single",
      "double",
      "backtick",
      "jsx-single",
      "jsx-double",
      "avoid-escape",
      "avoid-template"
    ]
  },
  "minLength": 0,
  "maxLength": 5
}

For more information see this page.

comment must start with a space
Open

                //console.log('response', response.ok)
Severity: Minor
Found in client/src/endpoint/Remote.ts by tslint

Rule: comment-format

Enforces formatting rules for single-line comments.

Rationale

Helps maintain a consistent, readable style in your codebase.

Notes
  • Has Fix

Config

Four arguments may be optionally provided:

  • "check-space" requires that all single-line comments must begin with a space, as in // comment
    • note that for comments starting with multiple slashes, e.g. ///, leading slashes are ignored
    • TypeScript reference comments are ignored completely
  • "check-lowercase" requires that the first non-whitespace character of a comment must be lowercase, if applicable.
  • "check-uppercase" requires that the first non-whitespace character of a comment must be uppercase, if applicable.
  • "allow-trailing-lowercase" allows that only the first comment of a series of comments needs to be uppercase.
    • requires "check-uppercase"
    • comments must start at the same position

Exceptions to "check-lowercase" or "check-uppercase" can be managed with object that may be passed as last argument.

One of two options can be provided in this object:

  • "ignore-words" - array of strings - words that will be ignored at the beginning of the comment.
  • "ignore-pattern" - string - RegExp pattern that will be ignored at the beginning of the comment.
Examples
"comment-format": true,check-space,check-uppercase,allow-trailing-lowercase
"comment-format": true,check-lowercase,[object Object]
"comment-format": true,check-lowercase,[object Object]
Schema
{
  "type": "array",
  "items": {
    "anyOf": [
      {
        "type": "string",
        "enum": [
          "check-space",
          "check-lowercase",
          "check-uppercase",
          "allow-trailing-lowercase"
        ]
      },
      {
        "type": "object",
        "properties": {
          "ignore-words": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "ignore-pattern": {
            "type": "string"
          }
        },
        "minProperties": 1,
        "maxProperties": 1
      }
    ]
  },
  "minLength": 1,
  "maxLength": 5
}

For more information see this page.

comment must start with a space
Open

                //console.log(x);
Severity: Minor
Found in client/src/endpoint/Remote.ts by tslint

Rule: comment-format

Enforces formatting rules for single-line comments.

Rationale

Helps maintain a consistent, readable style in your codebase.

Notes
  • Has Fix

Config

Four arguments may be optionally provided:

  • "check-space" requires that all single-line comments must begin with a space, as in // comment
    • note that for comments starting with multiple slashes, e.g. ///, leading slashes are ignored
    • TypeScript reference comments are ignored completely
  • "check-lowercase" requires that the first non-whitespace character of a comment must be lowercase, if applicable.
  • "check-uppercase" requires that the first non-whitespace character of a comment must be uppercase, if applicable.
  • "allow-trailing-lowercase" allows that only the first comment of a series of comments needs to be uppercase.
    • requires "check-uppercase"
    • comments must start at the same position

Exceptions to "check-lowercase" or "check-uppercase" can be managed with object that may be passed as last argument.

One of two options can be provided in this object:

  • "ignore-words" - array of strings - words that will be ignored at the beginning of the comment.
  • "ignore-pattern" - string - RegExp pattern that will be ignored at the beginning of the comment.
Examples
"comment-format": true,check-space,check-uppercase,allow-trailing-lowercase
"comment-format": true,check-lowercase,[object Object]
"comment-format": true,check-lowercase,[object Object]
Schema
{
  "type": "array",
  "items": {
    "anyOf": [
      {
        "type": "string",
        "enum": [
          "check-space",
          "check-lowercase",
          "check-uppercase",
          "allow-trailing-lowercase"
        ]
      },
      {
        "type": "object",
        "properties": {
          "ignore-words": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "ignore-pattern": {
            "type": "string"
          }
        },
        "minProperties": 1,
        "maxProperties": 1
      }
    ]
  },
  "minLength": 1,
  "maxLength": 5
}

For more information see this page.

" should be '
Open

import IRequest from "./IRequest";
Severity: Minor
Found in client/src/endpoint/Remote.ts by tslint

Rule: quotemark

Enforces quote character for string literals.

Notes
  • Has Fix

Config

Five arguments may be optionally provided:

  • "single" enforces single quotes.
  • "double" enforces double quotes.
  • "backtick" enforces backticks.
  • "jsx-single" enforces single quotes for JSX attributes.
  • "jsx-double" enforces double quotes for JSX attributes.
  • "avoid-template" forbids single-line untagged template strings that do not contain string interpolations. Note that backticks may still be used if "avoid-escape" is enabled and both single and double quotes are present in the string (the latter option takes precedence).
  • "avoid-escape" allows you to use the "other" quotemark in cases where escaping would normally be required. For example, [true, "double", "avoid-escape"] would not report a failure on the string literal 'Hello "World"'.
Examples
"quotemark": true,single,avoid-escape,avoid-template
"quotemark": true,single,jsx-double
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "single",
      "double",
      "backtick",
      "jsx-single",
      "jsx-double",
      "avoid-escape",
      "avoid-template"
    ]
  },
  "minLength": 0,
  "maxLength": 5
}

For more information see this page.

Don't use 'Function' as a type. Avoid using the Function type. Prefer a specific function type, like () => void.
Open

    Start(onchangeCallback: Function) {
Severity: Minor
Found in client/src/main.ts by tslint

Rule: ban-types

Bans specific types from being used. Does not ban the corresponding runtime objects from being used.

Notes
  • TypeScript Only

Config

A list of ["regex", "optional explanation here"], which bans types that match regex

Examples
"ban-types": true,Object,Use {} instead.,String
Schema
{
  "type": "list",
  "listType": {
    "type": "array",
    "items": {
      "type": "string"
    },
    "minLength": 1,
    "maxLength": 2
  }
}

For more information see this page.

file should end with a newline
Open

}
Severity: Minor
Found in client/src/data/IRecord.ts by tslint

Rule: eofline

Ensures the file ends with a newline.

Fix for single-line files is not supported.

Rationale

It is a standard convention to end files with a newline.

Notes
  • Has Fix

Config

Not configurable.

Examples
"eofline": true

For more information see this page.

Don't use 'Function' as a type. Avoid using the Function type. Prefer a specific function type, like () => void.
Open

    OnPushDataChanged: Function;
Severity: Minor
Found in client/src/data/IStore.ts by tslint

Rule: ban-types

Bans specific types from being used. Does not ban the corresponding runtime objects from being used.

Notes
  • TypeScript Only

Config

A list of ["regex", "optional explanation here"], which bans types that match regex

Examples
"ban-types": true,Object,Use {} instead.,String
Schema
{
  "type": "list",
  "listType": {
    "type": "array",
    "items": {
      "type": "string"
    },
    "minLength": 1,
    "maxLength": 2
  }
}

For more information see this page.

" should be '
Open

import IRecord from "./IRecord";
Severity: Minor
Found in client/src/data/IStore.ts by tslint

Rule: quotemark

Enforces quote character for string literals.

Notes
  • Has Fix

Config

Five arguments may be optionally provided:

  • "single" enforces single quotes.
  • "double" enforces double quotes.
  • "backtick" enforces backticks.
  • "jsx-single" enforces single quotes for JSX attributes.
  • "jsx-double" enforces double quotes for JSX attributes.
  • "avoid-template" forbids single-line untagged template strings that do not contain string interpolations. Note that backticks may still be used if "avoid-escape" is enabled and both single and double quotes are present in the string (the latter option takes precedence).
  • "avoid-escape" allows you to use the "other" quotemark in cases where escaping would normally be required. For example, [true, "double", "avoid-escape"] would not report a failure on the string literal 'Hello "World"'.
Examples
"quotemark": true,single,avoid-escape,avoid-template
"quotemark": true,single,jsx-double
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "single",
      "double",
      "backtick",
      "jsx-single",
      "jsx-double",
      "avoid-escape",
      "avoid-template"
    ]
  },
  "minLength": 0,
  "maxLength": 5
}

For more information see this page.

Identifier 'store' is never reassigned; use 'const' instead of 'let'.
Open

    let store = new IndexDbStore('testdb');

Rule: prefer-const

Requires that variable declarations use const instead of let and var if possible.

If a variable is only assigned to once when it is declared, it should be declared using 'const'

Notes
  • Has Fix

Config

An optional object containing the property "destructuring" with two possible values:

  • "any" (default) - If any variable in destructuring can be const, this rule warns for those variables.
  • "all" - Only warns if all variables in destructuring can be const.
Examples
"prefer-const": true
"prefer-const": true,[object Object]
Schema
{
  "type": "object",
  "properties": {
    "destructuring": {
      "type": "string",
      "enum": [
        "all",
        "any"
      ]
    }
  }
}

For more information see this page.

Missing semicolon
Open

})

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.

comment must start with a space
Open

            //this.db.createObjectStore(this._dbName)

Rule: comment-format

Enforces formatting rules for single-line comments.

Rationale

Helps maintain a consistent, readable style in your codebase.

Notes
  • Has Fix

Config

Four arguments may be optionally provided:

  • "check-space" requires that all single-line comments must begin with a space, as in // comment
    • note that for comments starting with multiple slashes, e.g. ///, leading slashes are ignored
    • TypeScript reference comments are ignored completely
  • "check-lowercase" requires that the first non-whitespace character of a comment must be lowercase, if applicable.
  • "check-uppercase" requires that the first non-whitespace character of a comment must be uppercase, if applicable.
  • "allow-trailing-lowercase" allows that only the first comment of a series of comments needs to be uppercase.
    • requires "check-uppercase"
    • comments must start at the same position

Exceptions to "check-lowercase" or "check-uppercase" can be managed with object that may be passed as last argument.

One of two options can be provided in this object:

  • "ignore-words" - array of strings - words that will be ignored at the beginning of the comment.
  • "ignore-pattern" - string - RegExp pattern that will be ignored at the beginning of the comment.
Examples
"comment-format": true,check-space,check-uppercase,allow-trailing-lowercase
"comment-format": true,check-lowercase,[object Object]
"comment-format": true,check-lowercase,[object Object]
Schema
{
  "type": "array",
  "items": {
    "anyOf": [
      {
        "type": "string",
        "enum": [
          "check-space",
          "check-lowercase",
          "check-uppercase",
          "allow-trailing-lowercase"
        ]
      },
      {
        "type": "object",
        "properties": {
          "ignore-words": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "ignore-pattern": {
            "type": "string"
          }
        },
        "minProperties": 1,
        "maxProperties": 1
      }
    ]
  },
  "minLength": 1,
  "maxLength": 5
}

For more information see this page.

Don't use 'Function' as a type. Avoid using the Function type. Prefer a specific function type, like () => void.
Open

    OnPushDataChanged: Function;

Rule: ban-types

Bans specific types from being used. Does not ban the corresponding runtime objects from being used.

Notes
  • TypeScript Only

Config

A list of ["regex", "optional explanation here"], which bans types that match regex

Examples
"ban-types": true,Object,Use {} instead.,String
Schema
{
  "type": "list",
  "listType": {
    "type": "array",
    "items": {
      "type": "string"
    },
    "minLength": 1,
    "maxLength": 2
  }
}

For more information see this page.

!= should be !==
Open

    private mainDataFilter = (item: IRecord) => item.deleted != true;

Rule: triple-equals

Requires === and !== in place of == and !=.

Config

Two arguments may be optionally provided:

  • "allow-null-check" allows == and != when comparing to null.
  • "allow-undefined-check" allows == and != when comparing to undefined.
Examples
"triple-equals": true
"triple-equals": true,allow-null-check
"triple-equals": true,allow-undefined-check
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "allow-null-check",
      "allow-undefined-check"
    ]
  },
  "minLength": 0,
  "maxLength": 2
}

For more information see this page.

" should be '
Open

import IStore from "../IStore";

Rule: quotemark

Enforces quote character for string literals.

Notes
  • Has Fix

Config

Five arguments may be optionally provided:

  • "single" enforces single quotes.
  • "double" enforces double quotes.
  • "backtick" enforces backticks.
  • "jsx-single" enforces single quotes for JSX attributes.
  • "jsx-double" enforces double quotes for JSX attributes.
  • "avoid-template" forbids single-line untagged template strings that do not contain string interpolations. Note that backticks may still be used if "avoid-escape" is enabled and both single and double quotes are present in the string (the latter option takes precedence).
  • "avoid-escape" allows you to use the "other" quotemark in cases where escaping would normally be required. For example, [true, "double", "avoid-escape"] would not report a failure on the string literal 'Hello "World"'.
Examples
"quotemark": true,single,avoid-escape,avoid-template
"quotemark": true,single,jsx-double
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "single",
      "double",
      "backtick",
      "jsx-single",
      "jsx-double",
      "avoid-escape",
      "avoid-template"
    ]
  },
  "minLength": 0,
  "maxLength": 5
}

For more information see this page.

non-arrow functions are forbidden
Open

        return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
Severity: Minor
Found in client/src/data/stores/StoreBase.ts by tslint

Rule: only-arrow-functions

Disallows traditional (non-arrow) function expressions.

Note that non-arrow functions are allowed if 'this' appears somewhere in its body (as such functions cannot be converted to arrow functions).

Rationale

Traditional functions don't bind lexical scope, which can lead to unexpected behavior when accessing 'this'.

Config

Two arguments may be optionally provided:

  • "allow-declarations" allows standalone function declarations.
  • "allow-named-functions" allows the expression function foo() {} but not function() {}.
Examples
"only-arrow-functions": true
"only-arrow-functions": true,allow-declarations,allow-named-functions
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "allow-declarations",
      "allow-named-functions"
    ]
  },
  "minLength": 0,
  "maxLength": 1
}

For more information see this page.

Identifier 'remote' is never reassigned; use 'const' instead of 'let'.
Open

    let remote = new Remote(endpointURL, request);
Severity: Minor
Found in client/src/endpoint/Remote.test.ts by tslint

Rule: prefer-const

Requires that variable declarations use const instead of let and var if possible.

If a variable is only assigned to once when it is declared, it should be declared using 'const'

Notes
  • Has Fix

Config

An optional object containing the property "destructuring" with two possible values:

  • "any" (default) - If any variable in destructuring can be const, this rule warns for those variables.
  • "all" - Only warns if all variables in destructuring can be const.
Examples
"prefer-const": true
"prefer-const": true,[object Object]
Schema
{
  "type": "object",
  "properties": {
    "destructuring": {
      "type": "string",
      "enum": [
        "all",
        "any"
      ]
    }
  }
}

For more information see this page.

file should end with a newline
Open

})
Severity: Minor
Found in client/src/main.test.ts by tslint

Rule: eofline

Ensures the file ends with a newline.

Fix for single-line files is not supported.

Rationale

It is a standard convention to end files with a newline.

Notes
  • Has Fix

Config

Not configurable.

Examples
"eofline": true

For more information see this page.

file should end with a newline
Open

}
Severity: Minor
Found in client/src/data/Record.ts by tslint

Rule: eofline

Ensures the file ends with a newline.

Fix for single-line files is not supported.

Rationale

It is a standard convention to end files with a newline.

Notes
  • Has Fix

Config

Not configurable.

Examples
"eofline": true

For more information see this page.

Severity
Category
Status
Source
Language