elcharitas/waxe

View on GitHub

Showing 70 of 70 total issues

missing whitespace
Open

        value: { ...parent.prototype, ...((constraint as WaxPresenter).prototype||constraint) }
Severity: Minor
Found in src/debug/index.ts by tslint

Rule: whitespace

Enforces whitespace style conventions.

Rationale

Helps maintain a readable, consistent style in your codebase.

Notes
  • Has Fix

Config

Several arguments may be optionally provided:

  • "check-branch" checks branching statements (if/else/for/while) are followed by whitespace.
  • "check-decl"checks that variable declarations have whitespace around the equals token.
  • "check-operator" checks for whitespace around operator tokens.
  • "check-module" checks for whitespace in import & export statements.
  • "check-separator" checks for whitespace after separator tokens (,/;).
  • "check-rest-spread" checks that there is no whitespace after rest/spread operator (...).
  • "check-type" checks for whitespace before a variable type specification.
  • "check-typecast" checks for whitespace between a typecast and its target.
  • "check-type-operator" checks for whitespace between type operators | and &.
  • "check-preblock" checks for whitespace before the opening brace of a block.
  • "check-postbrace" checks for whitespace after an opening brace.
Examples
"whitespace": true,check-branch,check-operator,check-typecast
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "check-branch",
      "check-decl",
      "check-operator",
      "check-module",
      "check-separator",
      "check-rest-spread",
      "check-type",
      "check-typecast",
      "check-type-operator",
      "check-preblock",
      "check-postbrace"
    ]
  },
  "minLength": 0,
  "maxLength": 11
}

For more information see this page.

" should be '
Open

    while(/\/\.\.\//.test(path = path.replace(/[^/]*\/+\.\.\//g,"")));
Severity: Minor
Found in src/compiler/index.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

            //handle template extending specially
Severity: Minor
Found in src/compiler/walker.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.

missing whitespace
Open

        return `if(${literal.text()||literal.length==0}){continue}`;
Severity: Minor
Found in src/plugins/core.ts by tslint

Rule: whitespace

Enforces whitespace style conventions.

Rationale

Helps maintain a readable, consistent style in your codebase.

Notes
  • Has Fix

Config

Several arguments may be optionally provided:

  • "check-branch" checks branching statements (if/else/for/while) are followed by whitespace.
  • "check-decl"checks that variable declarations have whitespace around the equals token.
  • "check-operator" checks for whitespace around operator tokens.
  • "check-module" checks for whitespace in import & export statements.
  • "check-separator" checks for whitespace after separator tokens (,/;).
  • "check-rest-spread" checks that there is no whitespace after rest/spread operator (...).
  • "check-type" checks for whitespace before a variable type specification.
  • "check-typecast" checks for whitespace between a typecast and its target.
  • "check-type-operator" checks for whitespace between type operators | and &.
  • "check-preblock" checks for whitespace before the opening brace of a block.
  • "check-postbrace" checks for whitespace after an opening brace.
Examples
"whitespace": true,check-branch,check-operator,check-typecast
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "check-branch",
      "check-decl",
      "check-operator",
      "check-module",
      "check-separator",
      "check-rest-spread",
      "check-type",
      "check-typecast",
      "check-type-operator",
      "check-preblock",
      "check-postbrace"
    ]
  },
  "minLength": 0,
  "maxLength": 11
}

For more information see this page.

file should end with a newline
Open

parse(path ? readFileSync(path).toString(): '');
Severity: Minor
Found in src/cli.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.

Multiple variable declarations in the same statement are forbidden
Open

    const { argList, blockSyntax, tagName, endPrefix } = delimiter,
        text: string = strfy(source),
        directives: RegExpMatchArray = text.match(new RegExp(blockSyntax, 'g'));
Severity: Minor
Found in src/compiler/parser.ts by tslint

Rule: one-variable-per-declaration

Disallows multiple variable definitions in the same declaration statement.

Config

One argument may be optionally provided:

  • ignore-for-loop allows multiple variable definitions in a for loop declaration.
Examples
"one-variable-per-declaration": true
"one-variable-per-declaration": true,ignore-for-loop
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "ignore-for-loop"
    ]
  },
  "minLength": 0,
  "maxLength": 1
}

For more information see this page.

Do not use the Function constructor to create functions.
Open

    return new Function('call,tpl', 'return tpl['+strfy(name)+']=function(){return call(this,arguments)}')(
Severity: Minor
Found in src/compiler/parser.ts by tslint

Rule: function-constructor

Prevents using the built-in Function constructor.

Rationale

Calling the constructor directly is similar to eval, which is a symptom of design issues. String inputs don't receive type checking and can cause performance issues, particularly when dynamically created.

If you need to dynamically create functions, use "factory" functions that themselves return functions.

Config

Not configurable.

Examples
"function-constructor": true

For more information see this page.

Forbidden constructor, use a literal or simple function call instead
Open

        const argLiteral: WaxLiteral = new String(list);
Severity: Minor
Found in src/compiler/walker.ts by tslint

Rule: no-construct

Disallows access to the constructors of String, Number, and Boolean.

Disallows constructor use such as new Number(foo) but does not disallow Number(foo).

Rationale

There is little reason to use String, Number, or Boolean as constructors. In almost all cases, the regular function-call version is more appropriate. More details are available on StackOverflow.

Config

Not configurable.

Examples
"no-construct": true

For more information see this page.

" should be '
Open

            if(tag === "extends" && position === 0){
Severity: Minor
Found in src/compiler/walker.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.

missing whitespace
Open

                element.innerHTML = (element as HTMLInputElement).value = Wax.template(element.id, (element as HTMLInputElement).value||element.innerHTML)(context);
Severity: Minor
Found in src/waxe.ts by tslint

Rule: whitespace

Enforces whitespace style conventions.

Rationale

Helps maintain a readable, consistent style in your codebase.

Notes
  • Has Fix

Config

Several arguments may be optionally provided:

  • "check-branch" checks branching statements (if/else/for/while) are followed by whitespace.
  • "check-decl"checks that variable declarations have whitespace around the equals token.
  • "check-operator" checks for whitespace around operator tokens.
  • "check-module" checks for whitespace in import & export statements.
  • "check-separator" checks for whitespace after separator tokens (,/;).
  • "check-rest-spread" checks that there is no whitespace after rest/spread operator (...).
  • "check-type" checks for whitespace before a variable type specification.
  • "check-typecast" checks for whitespace between a typecast and its target.
  • "check-type-operator" checks for whitespace between type operators | and &.
  • "check-preblock" checks for whitespace before the opening brace of a block.
  • "check-postbrace" checks for whitespace after an opening brace.
Examples
"whitespace": true,check-branch,check-operator,check-typecast
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "check-branch",
      "check-decl",
      "check-operator",
      "check-module",
      "check-separator",
      "check-rest-spread",
      "check-type",
      "check-typecast",
      "check-type-operator",
      "check-preblock",
      "check-postbrace"
    ]
  },
  "minLength": 0,
  "maxLength": 11
}

For more information see this page.

Severity
Category
Status
Source
Language