kalidea/kaligraphi

View on GitHub

Showing 148 of 148 total issues

Expected property shorthand in object literal ('{exports}').
Open

  exports: exports,

Rule: object-literal-shorthand

Enforces/disallows use of ES6 object literal shorthand.

Notes
  • Has Fix

Config

"always" assumed to be default option, thus with no options provided the rule enforces object literal methods and properties shorthands. With "never" option provided, any shorthand object literal syntax causes an error.

The rule can be configured in a more granular way. With {"property": "never"} provided (which is equivalent to {"property": "never", "method": "always"}), the rule only flags property shorthand assignments, and respectively with {"method": "never"} (equivalent to {"property": "always", "method": "never"}), the rule fails only on method shorthands.

Examples
"object-literal-shorthand": true
"object-literal-shorthand": true,never
"object-literal-shorthand": true,[object Object]
Schema
{
  "oneOf": [
    {
      "type": "string",
      "enum": [
        "never"
      ]
    },
    {
      "type": "object",
      "properties": {
        "property": {
          "type": "string",
          "enum": [
            "never"
          ]
        },
        "method": {
          "type": "string",
          "enum": [
            "never"
          ]
        }
      },
      "minProperties": 1,
      "maxProperties": 2
    }
  ]
}

For more information see this page.

comment must start with a space
Open

    //select options that were not already selected

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.

asterisks in jsdoc must be aligned
Open

   **/

Rule: jsdoc-format

Enforces basic format rules for JSDoc comments.

The following rules are enforced for JSDoc comments (comments starting with /**):

  • each line contains an asterisk and asterisks must be aligned
  • each asterisk must be followed by either a space or a newline (except for the first and the last)
  • the only characters before the asterisk on each line must be whitespace characters
  • one line comments must start with /** and end with */
  • multiline comments don't allow text after /** in the first line (with option "check-multiline-start")
Rationale

Helps maintain a consistent, readable style for JSDoc comments.

Config

You can optionally specify the option "check-multiline-start" to enforce the first line of a multiline JSDoc comment to be empty.

Examples
"jsdoc-format": true
"jsdoc-format": true,check-multiline-start
Schema
{
  "type": "array",
  "minItems": 0,
  "maxItems": 1,
  "items": {
    "type": "string",
    "enum": [
      "check-multiline-start"
    ]
  }
}

For more information see this page.

Expected property shorthand in object literal ('{exports}').
Open

  exports: exports,

Rule: object-literal-shorthand

Enforces/disallows use of ES6 object literal shorthand.

Notes
  • Has Fix

Config

"always" assumed to be default option, thus with no options provided the rule enforces object literal methods and properties shorthands. With "never" option provided, any shorthand object literal syntax causes an error.

The rule can be configured in a more granular way. With {"property": "never"} provided (which is equivalent to {"property": "never", "method": "always"}), the rule only flags property shorthand assignments, and respectively with {"method": "never"} (equivalent to {"property": "always", "method": "never"}), the rule fails only on method shorthands.

Examples
"object-literal-shorthand": true
"object-literal-shorthand": true,never
"object-literal-shorthand": true,[object Object]
Schema
{
  "oneOf": [
    {
      "type": "string",
      "enum": [
        "never"
      ]
    },
    {
      "type": "object",
      "properties": {
        "property": {
          "type": "string",
          "enum": [
            "never"
          ]
        },
        "method": {
          "type": "string",
          "enum": [
            "never"
          ]
        }
      },
      "minProperties": 1,
      "maxProperties": 2
    }
  ]
}

For more information see this page.

Type assertion using the '<>' syntax is forbidden. Use the 'as' syntax instead.
Open

    const viewRef = <EmbeddedViewRef<CarouselContext<T>>>this.viewContainerRef.get(positionFrom);

Rule: no-angle-bracket-type-assertion

Requires the use of as Type for type assertions instead of <Type>.

Rationale

Both formats of type assertions have the same effect, but only as type assertions work in .tsx files. This rule ensures that you have a consistent type assertion style across your codebase.

Notes
  • TypeScript Only
  • Has Fix

Config

Not configurable.

Examples
"no-angle-bracket-type-assertion": true

For more information see this page.

jsdoc is not formatted correctly on this line
Open

/** IE9, IE10 and IE11 requires all of the following polyfills. **/
Severity: Minor
Found in src/polyfills.ts by tslint

Rule: jsdoc-format

Enforces basic format rules for JSDoc comments.

The following rules are enforced for JSDoc comments (comments starting with /**):

  • each line contains an asterisk and asterisks must be aligned
  • each asterisk must be followed by either a space or a newline (except for the first and the last)
  • the only characters before the asterisk on each line must be whitespace characters
  • one line comments must start with /** and end with */
  • multiline comments don't allow text after /** in the first line (with option "check-multiline-start")
Rationale

Helps maintain a consistent, readable style for JSDoc comments.

Config

You can optionally specify the option "check-multiline-start" to enforce the first line of a multiline JSDoc comment to be empty.

Examples
"jsdoc-format": true
"jsdoc-format": true,check-multiline-start
Schema
{
  "type": "array",
  "minItems": 0,
  "maxItems": 1,
  "items": {
    "type": "string",
    "enum": [
      "check-multiline-start"
    ]
  }
}

For more information see this page.

A maximum of 1 class per file is allowed.
Open

@Component({
  selector: 'kal-stepper',
  templateUrl: './kal-stepper.component.html',
  styleUrls: ['./kal-stepper.sass'],
  encapsulation: ViewEncapsulation.None,

Rule: max-classes-per-file

A file may not contain more than the specified number of classes

Rationale

Ensures that files have a single responsibility so that that classes each exist in their own files

Config

The one required argument is an integer indicating the maximum number of classes that can appear in a file. An optional argument "exclude-class-expressions" can be provided to exclude class expressions from the overall class count.

Examples
"max-classes-per-file": true,1
"max-classes-per-file": true,5,exclude-class-expressions
Schema
{
  "type": "array",
  "items": [
    {
      "type": "number",
      "minimum": 1
    },
    {
      "type": "string",
      "enum": [
        "exclude-class-expressions"
      ]
    }
  ],
  "additionalItems": false,
  "minLength": 1,
  "maxLength": 2
}

For more information see this page.

Expected property shorthand in object literal ('{exports}').
Open

  exports: exports,

Rule: object-literal-shorthand

Enforces/disallows use of ES6 object literal shorthand.

Notes
  • Has Fix

Config

"always" assumed to be default option, thus with no options provided the rule enforces object literal methods and properties shorthands. With "never" option provided, any shorthand object literal syntax causes an error.

The rule can be configured in a more granular way. With {"property": "never"} provided (which is equivalent to {"property": "never", "method": "always"}), the rule only flags property shorthand assignments, and respectively with {"method": "never"} (equivalent to {"property": "always", "method": "never"}), the rule fails only on method shorthands.

Examples
"object-literal-shorthand": true
"object-literal-shorthand": true,never
"object-literal-shorthand": true,[object Object]
Schema
{
  "oneOf": [
    {
      "type": "string",
      "enum": [
        "never"
      ]
    },
    {
      "type": "object",
      "properties": {
        "property": {
          "type": "string",
          "enum": [
            "never"
          ]
        },
        "method": {
          "type": "string",
          "enum": [
            "never"
          ]
        }
      },
      "minProperties": 1,
      "maxProperties": 2
    }
  ]
}

For more information see this page.

Severity
Category
Status
Source
Language