ckr/url-shortener

View on GitHub

Showing 8 of 12 total issues

unused expression, expected an assignment or function call
Open

        new CertificateManager(this, 'CertificateManager', config);
Severity: Minor
Found in lib/url-shortner-cert-stack.ts by tslint

Rule: no-unused-expression

Disallows unused expression statements.

Unused expressions are expression statements which are not assignments or function calls (and thus usually no-ops).

Rationale

Detects potential errors where an assignment or function call was intended.

Config

Three arguments may be optionally provided:

  • allow-fast-null-checks allows to use logical operators to perform fast null checks and perform method or function calls for side effects (e.g. e && e.preventDefault()).
  • allow-new allows 'new' expressions for side effects (e.g. new ModifyGlobalState();.
  • allow-tagged-template allows tagged templates for side effects (e.g. this.add\foo`;`.
Examples
"no-unused-expression": true
"no-unused-expression": true,allow-fast-null-checks
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "allow-fast-null-checks",
      "allow-new",
      "allow-tagged-template"
    ]
  },
  "minLength": 0,
  "maxLength": 3
}

For more information see this page.

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

            distribution: distribution,
Severity: Minor
Found in lib/url-shortener-stack.ts by tslint

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.

unused expression, expected an assignment or function call
Open

        new BucketDeployment(this, `DeployPLinks-${file}`, {
            sources: [
                Source.asset('./assets/p', {
                    exclude: ['**', `!${file}`]
                })
Severity: Minor
Found in lib/url-shortener-stack.ts by tslint

Rule: no-unused-expression

Disallows unused expression statements.

Unused expressions are expression statements which are not assignments or function calls (and thus usually no-ops).

Rationale

Detects potential errors where an assignment or function call was intended.

Config

Three arguments may be optionally provided:

  • allow-fast-null-checks allows to use logical operators to perform fast null checks and perform method or function calls for side effects (e.g. e && e.preventDefault()).
  • allow-new allows 'new' expressions for side effects (e.g. new ModifyGlobalState();.
  • allow-tagged-template allows tagged templates for side effects (e.g. this.add\foo`;`.
Examples
"no-unused-expression": true
"no-unused-expression": true,allow-fast-null-checks
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "allow-fast-null-checks",
      "allow-new",
      "allow-tagged-template"
    ]
  },
  "minLength": 0,
  "maxLength": 3
}

For more information see this page.

file should end with a newline
Open

}
Severity: Minor
Found in lib/config.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.

unused expression, expected an assignment or function call
Open

        new UrlShortener(this, 'UrlShortener', config);
Severity: Minor
Found in lib/url-shortener-stack.ts by tslint

Rule: no-unused-expression

Disallows unused expression statements.

Unused expressions are expression statements which are not assignments or function calls (and thus usually no-ops).

Rationale

Detects potential errors where an assignment or function call was intended.

Config

Three arguments may be optionally provided:

  • allow-fast-null-checks allows to use logical operators to perform fast null checks and perform method or function calls for side effects (e.g. e && e.preventDefault()).
  • allow-new allows 'new' expressions for side effects (e.g. new ModifyGlobalState();.
  • allow-tagged-template allows tagged templates for side effects (e.g. this.add\foo`;`.
Examples
"no-unused-expression": true
"no-unused-expression": true,allow-fast-null-checks
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "allow-fast-null-checks",
      "allow-new",
      "allow-tagged-template"
    ]
  },
  "minLength": 0,
  "maxLength": 3
}

For more information see this page.

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

            bucketName: bucketName,
Severity: Minor
Found in lib/url-shortener-stack.ts by tslint

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

                        //TODO: This is a hack find a way to fix
Severity: Minor
Found in lib/url-shortener-stack.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.

unused expression, expected an assignment or function call
Open

        new CfnOutput(this, 'ShortUrlDns', { value: `https://${record.domainName}` });
Severity: Minor
Found in lib/url-shortener-stack.ts by tslint

Rule: no-unused-expression

Disallows unused expression statements.

Unused expressions are expression statements which are not assignments or function calls (and thus usually no-ops).

Rationale

Detects potential errors where an assignment or function call was intended.

Config

Three arguments may be optionally provided:

  • allow-fast-null-checks allows to use logical operators to perform fast null checks and perform method or function calls for side effects (e.g. e && e.preventDefault()).
  • allow-new allows 'new' expressions for side effects (e.g. new ModifyGlobalState();.
  • allow-tagged-template allows tagged templates for side effects (e.g. this.add\foo`;`.
Examples
"no-unused-expression": true
"no-unused-expression": true,allow-fast-null-checks
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "allow-fast-null-checks",
      "allow-new",
      "allow-tagged-template"
    ]
  },
  "minLength": 0,
  "maxLength": 3
}

For more information see this page.

Severity
Category
Status
Source
Language