appbaseio/mirage

View on GitHub
app/queryBlocks/singlequery/queries/geodistancerange.query.ts

Summary

Maintainability
D
2 days
Test Coverage

Function ngOnInit has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    ngOnInit() {
        try {
            if(this.appliedQuery[this.current_query][this.fieldName]['lat']) {
                this.inputs.lat.value = this.appliedQuery[this.current_query][this.fieldName]['lat'];
            }
Severity: Minor
Found in app/queryBlocks/singlequery/queries/geodistancerange.query.ts - About 55 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function ngOnChanges has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    ngOnChanges() {
        if(this.selectedField != '') {
            if(this.selectedField !== this.fieldName) {
                this.fieldName = this.selectedField;
                this.getFormat();
Severity: Minor
Found in app/queryBlocks/singlequery/queries/geodistancerange.query.ts - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Identical blocks of code found in 7 locations. Consider refactoring.
Open

    ngOnChanges() {
        if(this.selectedField != '') {
            if(this.selectedField !== this.fieldName) {
                this.fieldName = this.selectedField;
                this.getFormat();
app/queryBlocks/singlequery/queries/common.query.ts on lines 126..140
app/queryBlocks/singlequery/queries/geoboundingbox.query.ts on lines 159..173
app/queryBlocks/singlequery/queries/geodistance.query.ts on lines 150..164
app/queryBlocks/singlequery/queries/geohashcell.query.ts on lines 135..149
app/queryBlocks/singlequery/queries/geopolygon.query.ts on lines 109..123
app/queryBlocks/singlequery/queries/geoshape.query.ts on lines 119..133

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 138.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

        public informationList: any = {
        'distance_type': {
            title: 'distance_type',
            content: `<span class="description">How to compute the distance. Can either be <strong>sloppy_arc</strong> (default), <strong>arc</strong>
                        (slightly more precise but significantly slower) or <strong>plane</strong> (faster, but inaccurate on long distances and close to the poles).</span>`
app/queryBlocks/boolquery/boolquery.component.ts on lines 20..41
app/queryBlocks/singlequery/queries/fuzzy.query.ts on lines 59..76
app/queryBlocks/singlequery/queries/geodistance.query.ts on lines 77..95
app/queryBlocks/sortBlock/sortBlock.component.ts on lines 48..69

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 94.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 10 locations. Consider refactoring.
Open

            if(this.appliedQuery[this.current_query][this.fieldName]['lon']) {
                this.inputs.lon.value = this.appliedQuery[this.current_query][this.fieldName]['lon'];
            }
app/queryBlocks/singlequery/queries/geodistance.query.ts on lines 127..129
app/queryBlocks/singlequery/queries/geodistance.query.ts on lines 130..132
app/queryBlocks/singlequery/queries/geodistance.query.ts on lines 133..135
app/queryBlocks/singlequery/queries/geodistancerange.query.ts on lines 138..140
app/queryBlocks/singlequery/queries/geodistancerange.query.ts on lines 144..146
app/queryBlocks/singlequery/queries/geodistancerange.query.ts on lines 147..149
app/queryBlocks/singlequery/queries/geohashcell.query.ts on lines 112..114
app/queryBlocks/singlequery/queries/geohashcell.query.ts on lines 115..117
app/queryBlocks/singlequery/queries/geopolygon.query.ts on lines 92..94

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 74.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 10 locations. Consider refactoring.
Open

            if(this.appliedQuery[this.current_query][this.fieldName]['from']) {
                this.inputs.from.value = this.appliedQuery[this.current_query][this.fieldName]['from'];
            }
app/queryBlocks/singlequery/queries/geodistance.query.ts on lines 127..129
app/queryBlocks/singlequery/queries/geodistance.query.ts on lines 130..132
app/queryBlocks/singlequery/queries/geodistance.query.ts on lines 133..135
app/queryBlocks/singlequery/queries/geodistancerange.query.ts on lines 138..140
app/queryBlocks/singlequery/queries/geodistancerange.query.ts on lines 141..143
app/queryBlocks/singlequery/queries/geodistancerange.query.ts on lines 147..149
app/queryBlocks/singlequery/queries/geohashcell.query.ts on lines 112..114
app/queryBlocks/singlequery/queries/geohashcell.query.ts on lines 115..117
app/queryBlocks/singlequery/queries/geopolygon.query.ts on lines 92..94

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 74.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 10 locations. Consider refactoring.
Open

            if(this.appliedQuery[this.current_query][this.fieldName]['lat']) {
                this.inputs.lat.value = this.appliedQuery[this.current_query][this.fieldName]['lat'];
            }
app/queryBlocks/singlequery/queries/geodistance.query.ts on lines 127..129
app/queryBlocks/singlequery/queries/geodistance.query.ts on lines 130..132
app/queryBlocks/singlequery/queries/geodistance.query.ts on lines 133..135
app/queryBlocks/singlequery/queries/geodistancerange.query.ts on lines 141..143
app/queryBlocks/singlequery/queries/geodistancerange.query.ts on lines 144..146
app/queryBlocks/singlequery/queries/geodistancerange.query.ts on lines 147..149
app/queryBlocks/singlequery/queries/geohashcell.query.ts on lines 112..114
app/queryBlocks/singlequery/queries/geohashcell.query.ts on lines 115..117
app/queryBlocks/singlequery/queries/geopolygon.query.ts on lines 92..94

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 74.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 10 locations. Consider refactoring.
Open

            if(this.appliedQuery[this.current_query][this.fieldName]['to']) {
                this.inputs.to.value = this.appliedQuery[this.current_query][this.fieldName]['to'];
            }
app/queryBlocks/singlequery/queries/geodistance.query.ts on lines 127..129
app/queryBlocks/singlequery/queries/geodistance.query.ts on lines 130..132
app/queryBlocks/singlequery/queries/geodistance.query.ts on lines 133..135
app/queryBlocks/singlequery/queries/geodistancerange.query.ts on lines 138..140
app/queryBlocks/singlequery/queries/geodistancerange.query.ts on lines 141..143
app/queryBlocks/singlequery/queries/geodistancerange.query.ts on lines 144..146
app/queryBlocks/singlequery/queries/geohashcell.query.ts on lines 112..114
app/queryBlocks/singlequery/queries/geohashcell.query.ts on lines 115..117
app/queryBlocks/singlequery/queries/geopolygon.query.ts on lines 92..94

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 74.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    public inputs: any = {
        lat: {
            placeholder: 'Latitude',
            value: ''
        },
app/queryBlocks/singlequery/queries/geoboundingbox.query.ts on lines 110..127

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 74.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 8 locations. Consider refactoring.
Open

    getFormat() {
        if (this.queryName === this.current_query) {
            this.queryFormat = this.setFormat();
            this.getQueryFormat.emit(this.queryFormat);
        }
app/queryBlocks/singlequery/queries/geoboundingbox.query.ts on lines 175..180
app/queryBlocks/singlequery/queries/geodistance.query.ts on lines 166..171
app/queryBlocks/singlequery/queries/geohashcell.query.ts on lines 151..156
app/queryBlocks/singlequery/queries/geopolygon.query.ts on lines 125..130
app/queryBlocks/singlequery/queries/geoshape.query.ts on lines 135..140
app/queryBlocks/singlequery/queries/span_first.query.ts on lines 137..142
app/queryBlocks/singlequery/queries/span_term.query.ts on lines 124..129

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 64.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 6 locations. Consider refactoring.
Open

                this.optionRows.forEach(function(singleRow: any) {
            queryFormat[this.queryName][singleRow.name] = singleRow.value;
        }.bind(this));
app/queryBlocks/singlequery/queries/geoboundingbox.query.ts on lines 197..199
app/queryBlocks/singlequery/queries/geodistance.query.ts on lines 182..184
app/queryBlocks/singlequery/queries/geohashcell.query.ts on lines 168..170
app/queryBlocks/singlequery/queries/geopolygon.query.ts on lines 144..146
app/queryBlocks/singlequery/queries/missing.query.ts on lines 131..133

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Don't use 'Number' as a type. Avoid using the Number type. Did you mean number?
Open

    removeOption(index: Number) {

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.

object access via string literals is disallowed
Open

                this.inputs.lon.value = this.appliedQuery[this.current_query][this.fieldName]['lon'];

Rule: no-string-literal

Forbids unnecessary string literal property access. Allows obj["prop-erty"] (can't be a regular property access). Disallows obj["property"] (should be obj.property).

Rationale

If --noImplicitAny is turned off, property access via a string literal will be 'any' if the property does not exist.

Notes
  • Has Fix

Config

Not configurable.

Examples
"no-string-literal": true

For more information see this page.

non-arrow functions are forbidden
Open

            this.optionRows.forEach(function(row) {

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 'option' is never reassigned; use 'const' instead of 'let'.
Open

            for (let option in this.appliedQuery[this.current_query][this.fieldName]) {

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

                if (option != 'lat' && option != 'lon' && option != 'from' && option != 'to') {

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.

statements are not aligned
Open

                this.optionRows.forEach(function(singleRow: any) {
            queryFormat[this.queryName][singleRow.name] = singleRow.value;
        }.bind(this));

Rule: align

Enforces vertical alignment.

Rationale

Helps maintain a readable, consistent style in your codebase.

Consistent alignment for code statements helps keep code readable and clear. Statements misaligned from the standard can be harder to read and understand.

Notes
  • Has Fix

Config

Five arguments may be optionally provided:

  • "parameters" checks alignment of function parameters.
  • "arguments" checks alignment of function call arguments.
  • "statements" checks alignment of statements.
  • "members" checks alignment of members of classes, interfaces, type literal, object literals and object destructuring.
  • "elements" checks alignment of elements of array literals, array destructuring and tuple types.
Examples
"align": true,parameters,statements
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "arguments",
      "elements",
      "members",
      "parameters",
      "statements"
    ]
  },
  "minLength": 1,
  "maxLength": 5
}

For more information see this page.

object access via string literals is disallowed
Open

            if(this.appliedQuery[this.current_query][this.fieldName]['to']) {

Rule: no-string-literal

Forbids unnecessary string literal property access. Allows obj["prop-erty"] (can't be a regular property access). Disallows obj["property"] (should be obj.property).

Rationale

If --noImplicitAny is turned off, property access via a string literal will be 'any' if the property does not exist.

Notes
  • Has Fix

Config

Not configurable.

Examples
"no-string-literal": true

For more information see this page.

object access via string literals is disallowed
Open

                this.inputs.to.value = this.appliedQuery[this.current_query][this.fieldName]['to'];

Rule: no-string-literal

Forbids unnecessary string literal property access. Allows obj["prop-erty"] (can't be a regular property access). Disallows obj["property"] (should be obj.property).

Rationale

If --noImplicitAny is turned off, property access via a string literal will be 'any' if the property does not exist.

Notes
  • Has Fix

Config

Not configurable.

Examples
"no-string-literal": true

For more information see this page.

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

            var flag = true;

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 'obj' is never reassigned; use 'const' instead of 'var'.
Open

                    var obj = {

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.

space indentation expected
Open

                '_name',

Rule: indent

Enforces indentation with tabs or spaces.

Rationale

Using only one of tabs or spaces for indentation leads to more consistent editor behavior, cleaner diffs in version control, and easier programmatic manipulation.

Notes
  • Has Fix

Config

One of the following arguments must be provided:

  • spaces enforces consistent spaces.
  • tabs enforces consistent tabs.

A second optional argument specifies indentation size:

  • 2 enforces 2 space indentation.
  • 4 enforces 4 space indentation.

Indentation size is required for auto-fixing, but not for rule checking.

NOTE: auto-fixing will only convert invalid indent whitespace to the desired type, it will not fix invalid whitespace sizes.

Examples
"indent": true,spaces
"indent": true,spaces,4
"indent": true,tabs,2
Schema
{
  "type": "array",
  "items": [
    {
      "type": "string",
      "enum": [
        "tabs",
        "spaces"
      ]
    },
    {
      "type": "number",
      "enum": [
        2,
        4
      ]
    }
  ],
  "minLength": 0,
  "maxLength": 5
}

For more information see this page.

object access via string literals is disallowed
Open

            if(this.appliedQuery[this.current_query][this.fieldName]['from']) {

Rule: no-string-literal

Forbids unnecessary string literal property access. Allows obj["prop-erty"] (can't be a regular property access). Disallows obj["property"] (should be obj.property).

Rationale

If --noImplicitAny is turned off, property access via a string literal will be 'any' if the property does not exist.

Notes
  • Has Fix

Config

Not configurable.

Examples
"no-string-literal": true

For more information see this page.

!= should be !==
Open

        if(this.selectedField != '') {

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.

statements are not aligned
Open

                                this.optionRows = [];

Rule: align

Enforces vertical alignment.

Rationale

Helps maintain a readable, consistent style in your codebase.

Consistent alignment for code statements helps keep code readable and clear. Statements misaligned from the standard can be harder to read and understand.

Notes
  • Has Fix

Config

Five arguments may be optionally provided:

  • "parameters" checks alignment of function parameters.
  • "arguments" checks alignment of function call arguments.
  • "statements" checks alignment of statements.
  • "members" checks alignment of members of classes, interfaces, type literal, object literals and object destructuring.
  • "elements" checks alignment of elements of array literals, array destructuring and tuple types.
Examples
"align": true,parameters,statements
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "arguments",
      "elements",
      "members",
      "parameters",
      "statements"
    ]
  },
  "minLength": 1,
  "maxLength": 5
}

For more information see this page.

!= should be !==
Open

                if (option != 'lat' && option != 'lon' && option != 'from' && option != 'to') {

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.

Don't bind this without arguments as a scope to a function. Use an arrow lambda instead.
Open

        setTimeout(function() {
            this.getFormat();
        }.bind(this), 300);

Rule: unnecessary-bind

Prevents unnecessary and/or misleading scope bindings on functions.

Rationale

function expressions that are immediately bound to this are equivalent to () => arrow lambdas. Additionally, there's no use in binding a scope to an arrow lambda, as it already has one.

Notes
  • Requires Type Info

Config

Not configurable.

Examples
"unnecessary-bind": true

For more information see this page.

space indentation expected
Open

                'distance_type',

Rule: indent

Enforces indentation with tabs or spaces.

Rationale

Using only one of tabs or spaces for indentation leads to more consistent editor behavior, cleaner diffs in version control, and easier programmatic manipulation.

Notes
  • Has Fix

Config

One of the following arguments must be provided:

  • spaces enforces consistent spaces.
  • tabs enforces consistent tabs.

A second optional argument specifies indentation size:

  • 2 enforces 2 space indentation.
  • 4 enforces 4 space indentation.

Indentation size is required for auto-fixing, but not for rule checking.

NOTE: auto-fixing will only convert invalid indent whitespace to the desired type, it will not fix invalid whitespace sizes.

Examples
"indent": true,spaces
"indent": true,spaces,4
"indent": true,tabs,2
Schema
{
  "type": "array",
  "items": [
    {
      "type": "string",
      "enum": [
        "tabs",
        "spaces"
      ]
    },
    {
      "type": "number",
      "enum": [
        2,
        4
      ]
    }
  ],
  "minLength": 0,
  "maxLength": 5
}

For more information see this page.

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

        var singleOption = JSON.parse(JSON.stringify(this.singleOption));

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 'singleOption' is never reassigned; use 'const' instead of 'var'.
Open

        var singleOption = JSON.parse(JSON.stringify(this.singleOption));

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.

members are not aligned
Open

        public informationList: any = {
        'distance_type': {
            title: 'distance_type',
            content: `<span class="description">How to compute the distance. Can either be <strong>sloppy_arc</strong> (default), <strong>arc</strong>
                        (slightly more precise but significantly slower) or <strong>plane</strong> (faster, but inaccurate on long distances and close to the poles).</span>`

Rule: align

Enforces vertical alignment.

Rationale

Helps maintain a readable, consistent style in your codebase.

Consistent alignment for code statements helps keep code readable and clear. Statements misaligned from the standard can be harder to read and understand.

Notes
  • Has Fix

Config

Five arguments may be optionally provided:

  • "parameters" checks alignment of function parameters.
  • "arguments" checks alignment of function call arguments.
  • "statements" checks alignment of statements.
  • "members" checks alignment of members of classes, interfaces, type literal, object literals and object destructuring.
  • "elements" checks alignment of elements of array literals, array destructuring and tuple types.
Examples
"align": true,parameters,statements
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "arguments",
      "elements",
      "members",
      "parameters",
      "statements"
    ]
  },
  "minLength": 1,
  "maxLength": 5
}

For more information see this page.

space indentation expected
Open

        ];

Rule: indent

Enforces indentation with tabs or spaces.

Rationale

Using only one of tabs or spaces for indentation leads to more consistent editor behavior, cleaner diffs in version control, and easier programmatic manipulation.

Notes
  • Has Fix

Config

One of the following arguments must be provided:

  • spaces enforces consistent spaces.
  • tabs enforces consistent tabs.

A second optional argument specifies indentation size:

  • 2 enforces 2 space indentation.
  • 4 enforces 4 space indentation.

Indentation size is required for auto-fixing, but not for rule checking.

NOTE: auto-fixing will only convert invalid indent whitespace to the desired type, it will not fix invalid whitespace sizes.

Examples
"indent": true,spaces
"indent": true,spaces,4
"indent": true,tabs,2
Schema
{
  "type": "array",
  "items": [
    {
      "type": "string",
      "enum": [
        "tabs",
        "spaces"
      ]
    },
    {
      "type": "number",
      "enum": [
        2,
        4
      ]
    }
  ],
  "minLength": 0,
  "maxLength": 5
}

For more information see this page.

space indentation expected
Open

        public options: any;

Rule: indent

Enforces indentation with tabs or spaces.

Rationale

Using only one of tabs or spaces for indentation leads to more consistent editor behavior, cleaner diffs in version control, and easier programmatic manipulation.

Notes
  • Has Fix

Config

One of the following arguments must be provided:

  • spaces enforces consistent spaces.
  • tabs enforces consistent tabs.

A second optional argument specifies indentation size:

  • 2 enforces 2 space indentation.
  • 4 enforces 4 space indentation.

Indentation size is required for auto-fixing, but not for rule checking.

NOTE: auto-fixing will only convert invalid indent whitespace to the desired type, it will not fix invalid whitespace sizes.

Examples
"indent": true,spaces
"indent": true,spaces,4
"indent": true,tabs,2
Schema
{
  "type": "array",
  "items": [
    {
      "type": "string",
      "enum": [
        "tabs",
        "spaces"
      ]
    },
    {
      "type": "number",
      "enum": [
        2,
        4
      ]
    }
  ],
  "minLength": 0,
  "maxLength": 5
}

For more information see this page.

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

                    var obj = {

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.

block is empty
Open

        } catch(e) {}

Rule: no-empty

Disallows empty blocks.

Blocks with a comment inside are not considered empty.

Rationale

Empty blocks are often indicators of missing code.

Config

If allow-empty-catch is specified, then catch blocks are allowed to be empty. If allow-empty-functions is specified, then function definitions are allowed to be empty.

Examples
"no-empty": true
"no-empty": true,allow-empty-catch
"no-empty": true,allow-empty-functions
"no-empty": true,allow-empty-catch,allow-empty-functions
Schema
{
  "type": "array",
  "items": {
    "anyOf": [
      {
        "type": "string",
        "enum": [
          "allow-empty-catch"
        ]
      },
      {
        "type": "string",
        "enum": [
          "allow-empty-functions"
        ]
      }
    ]
  }
}

For more information see this page.

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

        var queryFormat = {

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.

space indentation expected
Open

                'optimize_bbox',

Rule: indent

Enforces indentation with tabs or spaces.

Rationale

Using only one of tabs or spaces for indentation leads to more consistent editor behavior, cleaner diffs in version control, and easier programmatic manipulation.

Notes
  • Has Fix

Config

One of the following arguments must be provided:

  • spaces enforces consistent spaces.
  • tabs enforces consistent tabs.

A second optional argument specifies indentation size:

  • 2 enforces 2 space indentation.
  • 4 enforces 4 space indentation.

Indentation size is required for auto-fixing, but not for rule checking.

NOTE: auto-fixing will only convert invalid indent whitespace to the desired type, it will not fix invalid whitespace sizes.

Examples
"indent": true,spaces
"indent": true,spaces,4
"indent": true,tabs,2
Schema
{
  "type": "array",
  "items": [
    {
      "type": "string",
      "enum": [
        "tabs",
        "spaces"
      ]
    },
    {
      "type": "number",
      "enum": [
        2,
        4
      ]
    }
  ],
  "minLength": 0,
  "maxLength": 5
}

For more information see this page.

space indentation expected
Open

                this.optionRows.forEach(function(singleRow: any) {

Rule: indent

Enforces indentation with tabs or spaces.

Rationale

Using only one of tabs or spaces for indentation leads to more consistent editor behavior, cleaner diffs in version control, and easier programmatic manipulation.

Notes
  • Has Fix

Config

One of the following arguments must be provided:

  • spaces enforces consistent spaces.
  • tabs enforces consistent tabs.

A second optional argument specifies indentation size:

  • 2 enforces 2 space indentation.
  • 4 enforces 4 space indentation.

Indentation size is required for auto-fixing, but not for rule checking.

NOTE: auto-fixing will only convert invalid indent whitespace to the desired type, it will not fix invalid whitespace sizes.

Examples
"indent": true,spaces
"indent": true,spaces,4
"indent": true,tabs,2
Schema
{
  "type": "array",
  "items": [
    {
      "type": "string",
      "enum": [
        "tabs",
        "spaces"
      ]
    },
    {
      "type": "number",
      "enum": [
        2,
        4
      ]
    }
  ],
  "minLength": 0,
  "maxLength": 5
}

For more information see this page.

object access via string literals is disallowed
Open

                this.inputs.from.value = this.appliedQuery[this.current_query][this.fieldName]['from'];

Rule: no-string-literal

Forbids unnecessary string literal property access. Allows obj["prop-erty"] (can't be a regular property access). Disallows obj["property"] (should be obj.property).

Rationale

If --noImplicitAny is turned off, property access via a string literal will be 'any' if the property does not exist.

Notes
  • Has Fix

Config

Not configurable.

Examples
"no-string-literal": true

For more information see this page.

object access via string literals is disallowed
Open

            if(this.appliedQuery[this.current_query][this.fieldName]['lat']) {

Rule: no-string-literal

Forbids unnecessary string literal property access. Allows obj["prop-erty"] (can't be a regular property access). Disallows obj["property"] (should be obj.property).

Rationale

If --noImplicitAny is turned off, property access via a string literal will be 'any' if the property does not exist.

Notes
  • Has Fix

Config

Not configurable.

Examples
"no-string-literal": true

For more information see this page.

Don't bind this without arguments as a scope to a function. Use an arrow lambda instead.
Open

                this.optionRows.forEach(function(singleRow: any) {
            queryFormat[this.queryName][singleRow.name] = singleRow.value;
        }.bind(this));

Rule: unnecessary-bind

Prevents unnecessary and/or misleading scope bindings on functions.

Rationale

function expressions that are immediately bound to this are equivalent to () => arrow lambdas. Additionally, there's no use in binding a scope to an arrow lambda, as it already has one.

Notes
  • Requires Type Info

Config

Not configurable.

Examples
"unnecessary-bind": true

For more information see this page.

!= should be !==
Open

                if (option != 'lat' && option != 'lon' && option != 'from' && option != 'to') {

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.

members are not aligned
Open

        public default_options: any = [
                'distance_type',
                'optimize_bbox',
                '_name',
                'ignore_malformed'

Rule: align

Enforces vertical alignment.

Rationale

Helps maintain a readable, consistent style in your codebase.

Consistent alignment for code statements helps keep code readable and clear. Statements misaligned from the standard can be harder to read and understand.

Notes
  • Has Fix

Config

Five arguments may be optionally provided:

  • "parameters" checks alignment of function parameters.
  • "arguments" checks alignment of function call arguments.
  • "statements" checks alignment of statements.
  • "members" checks alignment of members of classes, interfaces, type literal, object literals and object destructuring.
  • "elements" checks alignment of elements of array literals, array destructuring and tuple types.
Examples
"align": true,parameters,statements
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "arguments",
      "elements",
      "members",
      "parameters",
      "statements"
    ]
  },
  "minLength": 1,
  "maxLength": 5
}

For more information see this page.

members are not aligned
Open

        public optionRows: any = [];

Rule: align

Enforces vertical alignment.

Rationale

Helps maintain a readable, consistent style in your codebase.

Consistent alignment for code statements helps keep code readable and clear. Statements misaligned from the standard can be harder to read and understand.

Notes
  • Has Fix

Config

Five arguments may be optionally provided:

  • "parameters" checks alignment of function parameters.
  • "arguments" checks alignment of function call arguments.
  • "statements" checks alignment of statements.
  • "members" checks alignment of members of classes, interfaces, type literal, object literals and object destructuring.
  • "elements" checks alignment of elements of array literals, array destructuring and tuple types.
Examples
"align": true,parameters,statements
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "arguments",
      "elements",
      "members",
      "parameters",
      "statements"
    ]
  },
  "minLength": 1,
  "maxLength": 5
}

For more information see this page.

space indentation expected
Open

        public default_options: any = [

Rule: indent

Enforces indentation with tabs or spaces.

Rationale

Using only one of tabs or spaces for indentation leads to more consistent editor behavior, cleaner diffs in version control, and easier programmatic manipulation.

Notes
  • Has Fix

Config

One of the following arguments must be provided:

  • spaces enforces consistent spaces.
  • tabs enforces consistent tabs.

A second optional argument specifies indentation size:

  • 2 enforces 2 space indentation.
  • 4 enforces 4 space indentation.

Indentation size is required for auto-fixing, but not for rule checking.

NOTE: auto-fixing will only convert invalid indent whitespace to the desired type, it will not fix invalid whitespace sizes.

Examples
"indent": true,spaces
"indent": true,spaces,4
"indent": true,tabs,2
Schema
{
  "type": "array",
  "items": [
    {
      "type": "string",
      "enum": [
        "tabs",
        "spaces"
      ]
    },
    {
      "type": "number",
      "enum": [
        2,
        4
      ]
    }
  ],
  "minLength": 0,
  "maxLength": 5
}

For more information see this page.

space indentation expected
Open

                                this.optionRows = [];

Rule: indent

Enforces indentation with tabs or spaces.

Rationale

Using only one of tabs or spaces for indentation leads to more consistent editor behavior, cleaner diffs in version control, and easier programmatic manipulation.

Notes
  • Has Fix

Config

One of the following arguments must be provided:

  • spaces enforces consistent spaces.
  • tabs enforces consistent tabs.

A second optional argument specifies indentation size:

  • 2 enforces 2 space indentation.
  • 4 enforces 4 space indentation.

Indentation size is required for auto-fixing, but not for rule checking.

NOTE: auto-fixing will only convert invalid indent whitespace to the desired type, it will not fix invalid whitespace sizes.

Examples
"indent": true,spaces
"indent": true,spaces,4
"indent": true,tabs,2
Schema
{
  "type": "array",
  "items": [
    {
      "type": "string",
      "enum": [
        "tabs",
        "spaces"
      ]
    },
    {
      "type": "number",
      "enum": [
        2,
        4
      ]
    }
  ],
  "minLength": 0,
  "maxLength": 5
}

For more information see this page.

" should be '
Open

import { Component, OnInit, OnChanges, Input, Output, EventEmitter } from "@angular/core";

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.

!= should be !==
Open

        if(this.selectedQuery != '') {

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.

object access via string literals is disallowed
Open

                this.inputs.lat.value = this.appliedQuery[this.current_query][this.fieldName]['lat'];

Rule: no-string-literal

Forbids unnecessary string literal property access. Allows obj["prop-erty"] (can't be a regular property access). Disallows obj["property"] (should be obj.property).

Rationale

If --noImplicitAny is turned off, property access via a string literal will be 'any' if the property does not exist.

Notes
  • Has Fix

Config

Not configurable.

Examples
"no-string-literal": true

For more information see this page.

!= should be !==
Open

                if (option != 'lat' && option != 'lon' && option != 'from' && option != 'to') {

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.

members are not aligned
Open

        public options: any;

Rule: align

Enforces vertical alignment.

Rationale

Helps maintain a readable, consistent style in your codebase.

Consistent alignment for code statements helps keep code readable and clear. Statements misaligned from the standard can be harder to read and understand.

Notes
  • Has Fix

Config

Five arguments may be optionally provided:

  • "parameters" checks alignment of function parameters.
  • "arguments" checks alignment of function call arguments.
  • "statements" checks alignment of statements.
  • "members" checks alignment of members of classes, interfaces, type literal, object literals and object destructuring.
  • "elements" checks alignment of elements of array literals, array destructuring and tuple types.
Examples
"align": true,parameters,statements
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "arguments",
      "elements",
      "members",
      "parameters",
      "statements"
    ]
  },
  "minLength": 1,
  "maxLength": 5
}

For more information see this page.

space indentation expected
Open

                'ignore_malformed'

Rule: indent

Enforces indentation with tabs or spaces.

Rationale

Using only one of tabs or spaces for indentation leads to more consistent editor behavior, cleaner diffs in version control, and easier programmatic manipulation.

Notes
  • Has Fix

Config

One of the following arguments must be provided:

  • spaces enforces consistent spaces.
  • tabs enforces consistent tabs.

A second optional argument specifies indentation size:

  • 2 enforces 2 space indentation.
  • 4 enforces 4 space indentation.

Indentation size is required for auto-fixing, but not for rule checking.

NOTE: auto-fixing will only convert invalid indent whitespace to the desired type, it will not fix invalid whitespace sizes.

Examples
"indent": true,spaces
"indent": true,spaces,4
"indent": true,tabs,2
Schema
{
  "type": "array",
  "items": [
    {
      "type": "string",
      "enum": [
        "tabs",
        "spaces"
      ]
    },
    {
      "type": "number",
      "enum": [
        2,
        4
      ]
    }
  ],
  "minLength": 0,
  "maxLength": 5
}

For more information see this page.

space indentation expected
Open

        public optionRows: any = [];

Rule: indent

Enforces indentation with tabs or spaces.

Rationale

Using only one of tabs or spaces for indentation leads to more consistent editor behavior, cleaner diffs in version control, and easier programmatic manipulation.

Notes
  • Has Fix

Config

One of the following arguments must be provided:

  • spaces enforces consistent spaces.
  • tabs enforces consistent tabs.

A second optional argument specifies indentation size:

  • 2 enforces 2 space indentation.
  • 4 enforces 4 space indentation.

Indentation size is required for auto-fixing, but not for rule checking.

NOTE: auto-fixing will only convert invalid indent whitespace to the desired type, it will not fix invalid whitespace sizes.

Examples
"indent": true,spaces
"indent": true,spaces,4
"indent": true,tabs,2
Schema
{
  "type": "array",
  "items": [
    {
      "type": "string",
      "enum": [
        "tabs",
        "spaces"
      ]
    },
    {
      "type": "number",
      "enum": [
        2,
        4
      ]
    }
  ],
  "minLength": 0,
  "maxLength": 5
}

For more information see this page.

Don't bind this without arguments as a scope to a function. Use an arrow lambda instead.
Open

        this.options = this.default_options.filter(function(opt) {
            var flag = true;
            this.optionRows.forEach(function(row) {
                if(row.name === opt) {
                    flag = false;

Rule: unnecessary-bind

Prevents unnecessary and/or misleading scope bindings on functions.

Rationale

function expressions that are immediately bound to this are equivalent to () => arrow lambdas. Additionally, there's no use in binding a scope to an arrow lambda, as it already has one.

Notes
  • Requires Type Info

Config

Not configurable.

Examples
"unnecessary-bind": true

For more information see this page.

object access via string literals is disallowed
Open

            if(this.appliedQuery[this.current_query][this.fieldName]['lon']) {

Rule: no-string-literal

Forbids unnecessary string literal property access. Allows obj["prop-erty"] (can't be a regular property access). Disallows obj["property"] (should be obj.property).

Rationale

If --noImplicitAny is turned off, property access via a string literal will be 'any' if the property does not exist.

Notes
  • Has Fix

Config

Not configurable.

Examples
"no-string-literal": true

For more information see this page.

Identifier 'queryFormat' is never reassigned; use 'const' instead of 'var'.
Open

        var queryFormat = {

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.

space indentation expected
Open

        public informationList: any = {

Rule: indent

Enforces indentation with tabs or spaces.

Rationale

Using only one of tabs or spaces for indentation leads to more consistent editor behavior, cleaner diffs in version control, and easier programmatic manipulation.

Notes
  • Has Fix

Config

One of the following arguments must be provided:

  • spaces enforces consistent spaces.
  • tabs enforces consistent tabs.

A second optional argument specifies indentation size:

  • 2 enforces 2 space indentation.
  • 4 enforces 4 space indentation.

Indentation size is required for auto-fixing, but not for rule checking.

NOTE: auto-fixing will only convert invalid indent whitespace to the desired type, it will not fix invalid whitespace sizes.

Examples
"indent": true,spaces
"indent": true,spaces,4
"indent": true,tabs,2
Schema
{
  "type": "array",
  "items": [
    {
      "type": "string",
      "enum": [
        "tabs",
        "spaces"
      ]
    },
    {
      "type": "number",
      "enum": [
        2,
        4
      ]
    }
  ],
  "minLength": 0,
  "maxLength": 5
}

For more information see this page.

There are no issues that match your filters.

Category
Status