rooey/chromeos-filesystem-onedrive

View on GitHub
src/scripts/metadata_cache.js

Summary

Maintainability
A
1 hr
Test Coverage

Function get has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    MetadataCache.prototype.get = function(entryPath) {
        if (entryPath === "/") {
            return {
                needFetch: true,
                exists: true
Severity: Minor
Found in src/scripts/metadata_cache.js - About 1 hr to fix
  • Create a ticket

    Strings must use singlequote.
    Open

            var lastDelimiterPos = entryPath.lastIndexOf("/");
    Severity: Minor
    Found in src/scripts/metadata_cache.js by eslint

    enforce the consistent use of either backticks, double, or single quotes (quotes)

    JavaScript allows you to define strings in one of three ways: double quotes, single quotes, and backticks (as of ECMAScript 6). For example:

    /*eslint-env es6*/
    
    var double = "double";
    var single = 'single';
    var backtick = `backtick`;    // ES6 only

    Each of these lines creates a string and, in some cases, can be used interchangeably. The choice of how to define strings in a codebase is a stylistic one outside of template literals (which allow embedded of expressions to be interpreted).

    Many codebases require strings to be defined in a consistent manner.

    Rule Details

    This rule enforces the consistent use of either backticks, double, or single quotes.

    Options

    This rule has two options, a string option and an object option.

    String option:

    • "double" (default) requires the use of double quotes wherever possible
    • "single" requires the use of single quotes wherever possible
    • "backtick" requires the use of backticks wherever possible

    Object option:

    • "avoidEscape": true allows strings to use single-quotes or double-quotes so long as the string contains a quote that would have to be escaped otherwise
    • "allowTemplateLiterals": true allows strings to use backticks

    Deprecated: The object property avoid-escape is deprecated; please use the object property avoidEscape instead.

    double

    Examples of incorrect code for this rule with the default "double" option:

    /*eslint quotes: ["error", "double"]*/
    
    var single = 'single';
    var unescaped = 'a string containing "double" quotes';

    Examples of correct code for this rule with the default "double" option:

    /*eslint quotes: ["error", "double"]*/
    /*eslint-env es6*/
    
    var double = "double";
    var backtick = `back\ntick`;  // backticks are allowed due to newline
    var backtick = tag`backtick`; // backticks are allowed due to tag

    single

    Examples of incorrect code for this rule with the "single" option:

    /*eslint quotes: ["error", "single"]*/
    
    var double = "double";
    var unescaped = "a string containing 'single' quotes";

    Examples of correct code for this rule with the "single" option:

    /*eslint quotes: ["error", "single"]*/
    /*eslint-env es6*/
    
    var single = 'single';
    var backtick = `back${x}tick`; // backticks are allowed due to substitution

    backticks

    Examples of incorrect code for this rule with the "backtick" option:

    /*eslint quotes: ["error", "backtick"]*/
    
    var single = 'single';
    var double = "double";
    var unescaped = 'a string containing `backticks`';

    Examples of correct code for this rule with the "backtick" option:

    /*eslint quotes: ["error", "backtick"]*/
    /*eslint-env es6*/
    
    var backtick = `backtick`;

    avoidEscape

    Examples of additional correct code for this rule with the "double", { "avoidEscape": true } options:

    /*eslint quotes: ["error", "double", { "avoidEscape": true }]*/
    
    var single = 'a string containing "double" quotes';

    Examples of additional correct code for this rule with the "single", { "avoidEscape": true } options:

    /*eslint quotes: ["error", "single", { "avoidEscape": true }]*/
    
    var double = "a string containing 'single' quotes";

    Examples of additional correct code for this rule with the "backtick", { "avoidEscape": true } options:

    /*eslint quotes: ["error", "backtick", { "avoidEscape": true }]*/
    
    var double = "a string containing `backtick` quotes"

    allowTemplateLiterals

    Examples of additional correct code for this rule with the "double", { "allowTemplateLiterals": true } options:

    /*eslint quotes: ["error", "double", { "allowTemplateLiterals": true }]*/
    
    var double = "double";
    var double = `double`;

    Examples of additional correct code for this rule with the "single", { "allowTemplateLiterals": true } options:

    /*eslint quotes: ["error", "single", { "allowTemplateLiterals": true }]*/
    
    var single = 'single';
    var single = `single`;

    When Not To Use It

    If you do not need consistency in your string styles, you can safely disable this rule. Source: http://eslint.org/docs/rules/

    Unexpected var, use let or const instead.
    Open

            var entries = {};
    Severity: Minor
    Found in src/scripts/metadata_cache.js by eslint

    require let or const instead of var (no-var)

    ECMAScript 6 allows programmers to create variables with block scope instead of function scope using the let and const keywords. Block scope is common in many other programming languages and helps programmers avoid mistakes such as:

    var count = people.length;
    var enoughFood = count > sandwiches.length;
    
    if (enoughFood) {
        var count = sandwiches.length; // accidentally overriding the count variable
        console.log("We have " + count + " sandwiches for everyone. Plenty for all!");
    }
    
    // our count variable is no longer accurate
    console.log("We have " + count + " people and " + sandwiches.length + " sandwiches!");

    Rule Details

    This rule is aimed at discouraging the use of var and encouraging the use of const or let instead.

    Examples

    Examples of incorrect code for this rule:

    /*eslint no-var: "error"*/
    
    var x = "y";
    var CONFIG = {};

    Examples of correct code for this rule:

    /*eslint no-var: "error"*/
    /*eslint-env es6*/
    
    let x = "y";
    const CONFIG = {};

    When Not To Use It

    In addition to non-ES6 environments, existing JavaScript projects that are beginning to introduce ES6 into their codebase may not want to apply this rule if the cost of migrating from var to let is too costly. Source: http://eslint.org/docs/rules/

    Unexpected var, use let or const instead.
    Open

            for (var i = 0; i < metadataList.length; i++) {
    Severity: Minor
    Found in src/scripts/metadata_cache.js by eslint

    require let or const instead of var (no-var)

    ECMAScript 6 allows programmers to create variables with block scope instead of function scope using the let and const keywords. Block scope is common in many other programming languages and helps programmers avoid mistakes such as:

    var count = people.length;
    var enoughFood = count > sandwiches.length;
    
    if (enoughFood) {
        var count = sandwiches.length; // accidentally overriding the count variable
        console.log("We have " + count + " sandwiches for everyone. Plenty for all!");
    }
    
    // our count variable is no longer accurate
    console.log("We have " + count + " people and " + sandwiches.length + " sandwiches!");

    Rule Details

    This rule is aimed at discouraging the use of var and encouraging the use of const or let instead.

    Examples

    Examples of incorrect code for this rule:

    /*eslint no-var: "error"*/
    
    var x = "y";
    var CONFIG = {};

    Examples of correct code for this rule:

    /*eslint no-var: "error"*/
    /*eslint-env es6*/
    
    let x = "y";
    const CONFIG = {};

    When Not To Use It

    In addition to non-ES6 environments, existing JavaScript projects that are beginning to introduce ES6 into their codebase may not want to apply this rule if the cost of migrating from var to let is too costly. Source: http://eslint.org/docs/rules/

    Unexpected var, use let or const instead.
    Open

                var entries = this.directories_[directoryPath];
    Severity: Minor
    Found in src/scripts/metadata_cache.js by eslint

    require let or const instead of var (no-var)

    ECMAScript 6 allows programmers to create variables with block scope instead of function scope using the let and const keywords. Block scope is common in many other programming languages and helps programmers avoid mistakes such as:

    var count = people.length;
    var enoughFood = count > sandwiches.length;
    
    if (enoughFood) {
        var count = sandwiches.length; // accidentally overriding the count variable
        console.log("We have " + count + " sandwiches for everyone. Plenty for all!");
    }
    
    // our count variable is no longer accurate
    console.log("We have " + count + " people and " + sandwiches.length + " sandwiches!");

    Rule Details

    This rule is aimed at discouraging the use of var and encouraging the use of const or let instead.

    Examples

    Examples of incorrect code for this rule:

    /*eslint no-var: "error"*/
    
    var x = "y";
    var CONFIG = {};

    Examples of correct code for this rule:

    /*eslint no-var: "error"*/
    /*eslint-env es6*/
    
    let x = "y";
    const CONFIG = {};

    When Not To Use It

    In addition to non-ES6 environments, existing JavaScript projects that are beginning to introduce ES6 into their codebase may not want to apply this rule if the cost of migrating from var to let is too costly. Source: http://eslint.org/docs/rules/

    Unexpected var, use let or const instead.
    Open

                var lastDelimiterPos = entryPath.lastIndexOf("/");
    Severity: Minor
    Found in src/scripts/metadata_cache.js by eslint

    require let or const instead of var (no-var)

    ECMAScript 6 allows programmers to create variables with block scope instead of function scope using the let and const keywords. Block scope is common in many other programming languages and helps programmers avoid mistakes such as:

    var count = people.length;
    var enoughFood = count > sandwiches.length;
    
    if (enoughFood) {
        var count = sandwiches.length; // accidentally overriding the count variable
        console.log("We have " + count + " sandwiches for everyone. Plenty for all!");
    }
    
    // our count variable is no longer accurate
    console.log("We have " + count + " people and " + sandwiches.length + " sandwiches!");

    Rule Details

    This rule is aimed at discouraging the use of var and encouraging the use of const or let instead.

    Examples

    Examples of incorrect code for this rule:

    /*eslint no-var: "error"*/
    
    var x = "y";
    var CONFIG = {};

    Examples of correct code for this rule:

    /*eslint no-var: "error"*/
    /*eslint-env es6*/
    
    let x = "y";
    const CONFIG = {};

    When Not To Use It

    In addition to non-ES6 environments, existing JavaScript projects that are beginning to introduce ES6 into their codebase may not want to apply this rule if the cost of migrating from var to let is too costly. Source: http://eslint.org/docs/rules/

    Strings must use singlequote.
    Open

            if (entryPath === "/") {
    Severity: Minor
    Found in src/scripts/metadata_cache.js by eslint

    enforce the consistent use of either backticks, double, or single quotes (quotes)

    JavaScript allows you to define strings in one of three ways: double quotes, single quotes, and backticks (as of ECMAScript 6). For example:

    /*eslint-env es6*/
    
    var double = "double";
    var single = 'single';
    var backtick = `backtick`;    // ES6 only

    Each of these lines creates a string and, in some cases, can be used interchangeably. The choice of how to define strings in a codebase is a stylistic one outside of template literals (which allow embedded of expressions to be interpreted).

    Many codebases require strings to be defined in a consistent manner.

    Rule Details

    This rule enforces the consistent use of either backticks, double, or single quotes.

    Options

    This rule has two options, a string option and an object option.

    String option:

    • "double" (default) requires the use of double quotes wherever possible
    • "single" requires the use of single quotes wherever possible
    • "backtick" requires the use of backticks wherever possible

    Object option:

    • "avoidEscape": true allows strings to use single-quotes or double-quotes so long as the string contains a quote that would have to be escaped otherwise
    • "allowTemplateLiterals": true allows strings to use backticks

    Deprecated: The object property avoid-escape is deprecated; please use the object property avoidEscape instead.

    double

    Examples of incorrect code for this rule with the default "double" option:

    /*eslint quotes: ["error", "double"]*/
    
    var single = 'single';
    var unescaped = 'a string containing "double" quotes';

    Examples of correct code for this rule with the default "double" option:

    /*eslint quotes: ["error", "double"]*/
    /*eslint-env es6*/
    
    var double = "double";
    var backtick = `back\ntick`;  // backticks are allowed due to newline
    var backtick = tag`backtick`; // backticks are allowed due to tag

    single

    Examples of incorrect code for this rule with the "single" option:

    /*eslint quotes: ["error", "single"]*/
    
    var double = "double";
    var unescaped = "a string containing 'single' quotes";

    Examples of correct code for this rule with the "single" option:

    /*eslint quotes: ["error", "single"]*/
    /*eslint-env es6*/
    
    var single = 'single';
    var backtick = `back${x}tick`; // backticks are allowed due to substitution

    backticks

    Examples of incorrect code for this rule with the "backtick" option:

    /*eslint quotes: ["error", "backtick"]*/
    
    var single = 'single';
    var double = "double";
    var unescaped = 'a string containing `backticks`';

    Examples of correct code for this rule with the "backtick" option:

    /*eslint quotes: ["error", "backtick"]*/
    /*eslint-env es6*/
    
    var backtick = `backtick`;

    avoidEscape

    Examples of additional correct code for this rule with the "double", { "avoidEscape": true } options:

    /*eslint quotes: ["error", "double", { "avoidEscape": true }]*/
    
    var single = 'a string containing "double" quotes';

    Examples of additional correct code for this rule with the "single", { "avoidEscape": true } options:

    /*eslint quotes: ["error", "single", { "avoidEscape": true }]*/
    
    var double = "a string containing 'single' quotes";

    Examples of additional correct code for this rule with the "backtick", { "avoidEscape": true } options:

    /*eslint quotes: ["error", "backtick", { "avoidEscape": true }]*/
    
    var double = "a string containing `backtick` quotes"

    allowTemplateLiterals

    Examples of additional correct code for this rule with the "double", { "allowTemplateLiterals": true } options:

    /*eslint quotes: ["error", "double", { "allowTemplateLiterals": true }]*/
    
    var double = "double";
    var double = `double`;

    Examples of additional correct code for this rule with the "single", { "allowTemplateLiterals": true } options:

    /*eslint quotes: ["error", "single", { "allowTemplateLiterals": true }]*/
    
    var single = 'single';
    var single = `single`;

    When Not To Use It

    If you do not need consistency in your string styles, you can safely disable this rule. Source: http://eslint.org/docs/rules/

    Unexpected var, use let or const instead.
    Open

                var directoryPath;
    Severity: Minor
    Found in src/scripts/metadata_cache.js by eslint

    require let or const instead of var (no-var)

    ECMAScript 6 allows programmers to create variables with block scope instead of function scope using the let and const keywords. Block scope is common in many other programming languages and helps programmers avoid mistakes such as:

    var count = people.length;
    var enoughFood = count > sandwiches.length;
    
    if (enoughFood) {
        var count = sandwiches.length; // accidentally overriding the count variable
        console.log("We have " + count + " sandwiches for everyone. Plenty for all!");
    }
    
    // our count variable is no longer accurate
    console.log("We have " + count + " people and " + sandwiches.length + " sandwiches!");

    Rule Details

    This rule is aimed at discouraging the use of var and encouraging the use of const or let instead.

    Examples

    Examples of incorrect code for this rule:

    /*eslint no-var: "error"*/
    
    var x = "y";
    var CONFIG = {};

    Examples of correct code for this rule:

    /*eslint no-var: "error"*/
    /*eslint-env es6*/
    
    let x = "y";
    const CONFIG = {};

    When Not To Use It

    In addition to non-ES6 environments, existing JavaScript projects that are beginning to introduce ES6 into their codebase may not want to apply this rule if the cost of migrating from var to let is too costly. Source: http://eslint.org/docs/rules/

    Unexpected var, use let or const instead.
    Open

                var name;
    Severity: Minor
    Found in src/scripts/metadata_cache.js by eslint

    require let or const instead of var (no-var)

    ECMAScript 6 allows programmers to create variables with block scope instead of function scope using the let and const keywords. Block scope is common in many other programming languages and helps programmers avoid mistakes such as:

    var count = people.length;
    var enoughFood = count > sandwiches.length;
    
    if (enoughFood) {
        var count = sandwiches.length; // accidentally overriding the count variable
        console.log("We have " + count + " sandwiches for everyone. Plenty for all!");
    }
    
    // our count variable is no longer accurate
    console.log("We have " + count + " people and " + sandwiches.length + " sandwiches!");

    Rule Details

    This rule is aimed at discouraging the use of var and encouraging the use of const or let instead.

    Examples

    Examples of incorrect code for this rule:

    /*eslint no-var: "error"*/
    
    var x = "y";
    var CONFIG = {};

    Examples of correct code for this rule:

    /*eslint no-var: "error"*/
    /*eslint-env es6*/
    
    let x = "y";
    const CONFIG = {};

    When Not To Use It

    In addition to non-ES6 environments, existing JavaScript projects that are beginning to introduce ES6 into their codebase may not want to apply this rule if the cost of migrating from var to let is too costly. Source: http://eslint.org/docs/rules/

    Unexpected var, use let or const instead.
    Open

                var metadata = metadataList[i];
    Severity: Minor
    Found in src/scripts/metadata_cache.js by eslint

    require let or const instead of var (no-var)

    ECMAScript 6 allows programmers to create variables with block scope instead of function scope using the let and const keywords. Block scope is common in many other programming languages and helps programmers avoid mistakes such as:

    var count = people.length;
    var enoughFood = count > sandwiches.length;
    
    if (enoughFood) {
        var count = sandwiches.length; // accidentally overriding the count variable
        console.log("We have " + count + " sandwiches for everyone. Plenty for all!");
    }
    
    // our count variable is no longer accurate
    console.log("We have " + count + " people and " + sandwiches.length + " sandwiches!");

    Rule Details

    This rule is aimed at discouraging the use of var and encouraging the use of const or let instead.

    Examples

    Examples of incorrect code for this rule:

    /*eslint no-var: "error"*/
    
    var x = "y";
    var CONFIG = {};

    Examples of correct code for this rule:

    /*eslint no-var: "error"*/
    /*eslint-env es6*/
    
    let x = "y";
    const CONFIG = {};

    When Not To Use It

    In addition to non-ES6 environments, existing JavaScript projects that are beginning to introduce ES6 into their codebase may not want to apply this rule if the cost of migrating from var to let is too costly. Source: http://eslint.org/docs/rules/

    Strings must use singlequote.
    Open

                var lastDelimiterPos = entryPath.lastIndexOf("/");
    Severity: Minor
    Found in src/scripts/metadata_cache.js by eslint

    enforce the consistent use of either backticks, double, or single quotes (quotes)

    JavaScript allows you to define strings in one of three ways: double quotes, single quotes, and backticks (as of ECMAScript 6). For example:

    /*eslint-env es6*/
    
    var double = "double";
    var single = 'single';
    var backtick = `backtick`;    // ES6 only

    Each of these lines creates a string and, in some cases, can be used interchangeably. The choice of how to define strings in a codebase is a stylistic one outside of template literals (which allow embedded of expressions to be interpreted).

    Many codebases require strings to be defined in a consistent manner.

    Rule Details

    This rule enforces the consistent use of either backticks, double, or single quotes.

    Options

    This rule has two options, a string option and an object option.

    String option:

    • "double" (default) requires the use of double quotes wherever possible
    • "single" requires the use of single quotes wherever possible
    • "backtick" requires the use of backticks wherever possible

    Object option:

    • "avoidEscape": true allows strings to use single-quotes or double-quotes so long as the string contains a quote that would have to be escaped otherwise
    • "allowTemplateLiterals": true allows strings to use backticks

    Deprecated: The object property avoid-escape is deprecated; please use the object property avoidEscape instead.

    double

    Examples of incorrect code for this rule with the default "double" option:

    /*eslint quotes: ["error", "double"]*/
    
    var single = 'single';
    var unescaped = 'a string containing "double" quotes';

    Examples of correct code for this rule with the default "double" option:

    /*eslint quotes: ["error", "double"]*/
    /*eslint-env es6*/
    
    var double = "double";
    var backtick = `back\ntick`;  // backticks are allowed due to newline
    var backtick = tag`backtick`; // backticks are allowed due to tag

    single

    Examples of incorrect code for this rule with the "single" option:

    /*eslint quotes: ["error", "single"]*/
    
    var double = "double";
    var unescaped = "a string containing 'single' quotes";

    Examples of correct code for this rule with the "single" option:

    /*eslint quotes: ["error", "single"]*/
    /*eslint-env es6*/
    
    var single = 'single';
    var backtick = `back${x}tick`; // backticks are allowed due to substitution

    backticks

    Examples of incorrect code for this rule with the "backtick" option:

    /*eslint quotes: ["error", "backtick"]*/
    
    var single = 'single';
    var double = "double";
    var unescaped = 'a string containing `backticks`';

    Examples of correct code for this rule with the "backtick" option:

    /*eslint quotes: ["error", "backtick"]*/
    /*eslint-env es6*/
    
    var backtick = `backtick`;

    avoidEscape

    Examples of additional correct code for this rule with the "double", { "avoidEscape": true } options:

    /*eslint quotes: ["error", "double", { "avoidEscape": true }]*/
    
    var single = 'a string containing "double" quotes';

    Examples of additional correct code for this rule with the "single", { "avoidEscape": true } options:

    /*eslint quotes: ["error", "single", { "avoidEscape": true }]*/
    
    var double = "a string containing 'single' quotes";

    Examples of additional correct code for this rule with the "backtick", { "avoidEscape": true } options:

    /*eslint quotes: ["error", "backtick", { "avoidEscape": true }]*/
    
    var double = "a string containing `backtick` quotes"

    allowTemplateLiterals

    Examples of additional correct code for this rule with the "double", { "allowTemplateLiterals": true } options:

    /*eslint quotes: ["error", "double", { "allowTemplateLiterals": true }]*/
    
    var double = "double";
    var double = `double`;

    Examples of additional correct code for this rule with the "single", { "allowTemplateLiterals": true } options:

    /*eslint quotes: ["error", "single", { "allowTemplateLiterals": true }]*/
    
    var single = 'single';
    var single = `single`;

    When Not To Use It

    If you do not need consistency in your string styles, you can safely disable this rule. Source: http://eslint.org/docs/rules/

    Unexpected var, use let or const instead.
    Open

            var lastDelimiterPos = entryPath.lastIndexOf("/");
    Severity: Minor
    Found in src/scripts/metadata_cache.js by eslint

    require let or const instead of var (no-var)

    ECMAScript 6 allows programmers to create variables with block scope instead of function scope using the let and const keywords. Block scope is common in many other programming languages and helps programmers avoid mistakes such as:

    var count = people.length;
    var enoughFood = count > sandwiches.length;
    
    if (enoughFood) {
        var count = sandwiches.length; // accidentally overriding the count variable
        console.log("We have " + count + " sandwiches for everyone. Plenty for all!");
    }
    
    // our count variable is no longer accurate
    console.log("We have " + count + " people and " + sandwiches.length + " sandwiches!");

    Rule Details

    This rule is aimed at discouraging the use of var and encouraging the use of const or let instead.

    Examples

    Examples of incorrect code for this rule:

    /*eslint no-var: "error"*/
    
    var x = "y";
    var CONFIG = {};

    Examples of correct code for this rule:

    /*eslint no-var: "error"*/
    /*eslint-env es6*/
    
    let x = "y";
    const CONFIG = {};

    When Not To Use It

    In addition to non-ES6 environments, existing JavaScript projects that are beginning to introduce ES6 into their codebase may not want to apply this rule if the cost of migrating from var to let is too costly. Source: http://eslint.org/docs/rules/

    Strings must use singlequote.
    Open

    "use strict";
    Severity: Minor
    Found in src/scripts/metadata_cache.js by eslint

    enforce the consistent use of either backticks, double, or single quotes (quotes)

    JavaScript allows you to define strings in one of three ways: double quotes, single quotes, and backticks (as of ECMAScript 6). For example:

    /*eslint-env es6*/
    
    var double = "double";
    var single = 'single';
    var backtick = `backtick`;    // ES6 only

    Each of these lines creates a string and, in some cases, can be used interchangeably. The choice of how to define strings in a codebase is a stylistic one outside of template literals (which allow embedded of expressions to be interpreted).

    Many codebases require strings to be defined in a consistent manner.

    Rule Details

    This rule enforces the consistent use of either backticks, double, or single quotes.

    Options

    This rule has two options, a string option and an object option.

    String option:

    • "double" (default) requires the use of double quotes wherever possible
    • "single" requires the use of single quotes wherever possible
    • "backtick" requires the use of backticks wherever possible

    Object option:

    • "avoidEscape": true allows strings to use single-quotes or double-quotes so long as the string contains a quote that would have to be escaped otherwise
    • "allowTemplateLiterals": true allows strings to use backticks

    Deprecated: The object property avoid-escape is deprecated; please use the object property avoidEscape instead.

    double

    Examples of incorrect code for this rule with the default "double" option:

    /*eslint quotes: ["error", "double"]*/
    
    var single = 'single';
    var unescaped = 'a string containing "double" quotes';

    Examples of correct code for this rule with the default "double" option:

    /*eslint quotes: ["error", "double"]*/
    /*eslint-env es6*/
    
    var double = "double";
    var backtick = `back\ntick`;  // backticks are allowed due to newline
    var backtick = tag`backtick`; // backticks are allowed due to tag

    single

    Examples of incorrect code for this rule with the "single" option:

    /*eslint quotes: ["error", "single"]*/
    
    var double = "double";
    var unescaped = "a string containing 'single' quotes";

    Examples of correct code for this rule with the "single" option:

    /*eslint quotes: ["error", "single"]*/
    /*eslint-env es6*/
    
    var single = 'single';
    var backtick = `back${x}tick`; // backticks are allowed due to substitution

    backticks

    Examples of incorrect code for this rule with the "backtick" option:

    /*eslint quotes: ["error", "backtick"]*/
    
    var single = 'single';
    var double = "double";
    var unescaped = 'a string containing `backticks`';

    Examples of correct code for this rule with the "backtick" option:

    /*eslint quotes: ["error", "backtick"]*/
    /*eslint-env es6*/
    
    var backtick = `backtick`;

    avoidEscape

    Examples of additional correct code for this rule with the "double", { "avoidEscape": true } options:

    /*eslint quotes: ["error", "double", { "avoidEscape": true }]*/
    
    var single = 'a string containing "double" quotes';

    Examples of additional correct code for this rule with the "single", { "avoidEscape": true } options:

    /*eslint quotes: ["error", "single", { "avoidEscape": true }]*/
    
    var double = "a string containing 'single' quotes";

    Examples of additional correct code for this rule with the "backtick", { "avoidEscape": true } options:

    /*eslint quotes: ["error", "backtick", { "avoidEscape": true }]*/
    
    var double = "a string containing `backtick` quotes"

    allowTemplateLiterals

    Examples of additional correct code for this rule with the "double", { "allowTemplateLiterals": true } options:

    /*eslint quotes: ["error", "double", { "allowTemplateLiterals": true }]*/
    
    var double = "double";
    var double = `double`;

    Examples of additional correct code for this rule with the "single", { "allowTemplateLiterals": true } options:

    /*eslint quotes: ["error", "single", { "allowTemplateLiterals": true }]*/
    
    var single = 'single';
    var single = `single`;

    When Not To Use It

    If you do not need consistency in your string styles, you can safely disable this rule. Source: http://eslint.org/docs/rules/

    Unexpected var, use let or const instead.
    Open

            for (var key in this.directories_) {
    Severity: Minor
    Found in src/scripts/metadata_cache.js by eslint

    require let or const instead of var (no-var)

    ECMAScript 6 allows programmers to create variables with block scope instead of function scope using the let and const keywords. Block scope is common in many other programming languages and helps programmers avoid mistakes such as:

    var count = people.length;
    var enoughFood = count > sandwiches.length;
    
    if (enoughFood) {
        var count = sandwiches.length; // accidentally overriding the count variable
        console.log("We have " + count + " sandwiches for everyone. Plenty for all!");
    }
    
    // our count variable is no longer accurate
    console.log("We have " + count + " people and " + sandwiches.length + " sandwiches!");

    Rule Details

    This rule is aimed at discouraging the use of var and encouraging the use of const or let instead.

    Examples

    Examples of incorrect code for this rule:

    /*eslint no-var: "error"*/
    
    var x = "y";
    var CONFIG = {};

    Examples of correct code for this rule:

    /*eslint no-var: "error"*/
    /*eslint-env es6*/
    
    let x = "y";
    const CONFIG = {};

    When Not To Use It

    In addition to non-ES6 environments, existing JavaScript projects that are beginning to introduce ES6 into their codebase may not want to apply this rule if the cost of migrating from var to let is too costly. Source: http://eslint.org/docs/rules/

    Strings must use singlequote.
    Open

                    directoryPath = "/";
    Severity: Minor
    Found in src/scripts/metadata_cache.js by eslint

    enforce the consistent use of either backticks, double, or single quotes (quotes)

    JavaScript allows you to define strings in one of three ways: double quotes, single quotes, and backticks (as of ECMAScript 6). For example:

    /*eslint-env es6*/
    
    var double = "double";
    var single = 'single';
    var backtick = `backtick`;    // ES6 only

    Each of these lines creates a string and, in some cases, can be used interchangeably. The choice of how to define strings in a codebase is a stylistic one outside of template literals (which allow embedded of expressions to be interpreted).

    Many codebases require strings to be defined in a consistent manner.

    Rule Details

    This rule enforces the consistent use of either backticks, double, or single quotes.

    Options

    This rule has two options, a string option and an object option.

    String option:

    • "double" (default) requires the use of double quotes wherever possible
    • "single" requires the use of single quotes wherever possible
    • "backtick" requires the use of backticks wherever possible

    Object option:

    • "avoidEscape": true allows strings to use single-quotes or double-quotes so long as the string contains a quote that would have to be escaped otherwise
    • "allowTemplateLiterals": true allows strings to use backticks

    Deprecated: The object property avoid-escape is deprecated; please use the object property avoidEscape instead.

    double

    Examples of incorrect code for this rule with the default "double" option:

    /*eslint quotes: ["error", "double"]*/
    
    var single = 'single';
    var unescaped = 'a string containing "double" quotes';

    Examples of correct code for this rule with the default "double" option:

    /*eslint quotes: ["error", "double"]*/
    /*eslint-env es6*/
    
    var double = "double";
    var backtick = `back\ntick`;  // backticks are allowed due to newline
    var backtick = tag`backtick`; // backticks are allowed due to tag

    single

    Examples of incorrect code for this rule with the "single" option:

    /*eslint quotes: ["error", "single"]*/
    
    var double = "double";
    var unescaped = "a string containing 'single' quotes";

    Examples of correct code for this rule with the "single" option:

    /*eslint quotes: ["error", "single"]*/
    /*eslint-env es6*/
    
    var single = 'single';
    var backtick = `back${x}tick`; // backticks are allowed due to substitution

    backticks

    Examples of incorrect code for this rule with the "backtick" option:

    /*eslint quotes: ["error", "backtick"]*/
    
    var single = 'single';
    var double = "double";
    var unescaped = 'a string containing `backticks`';

    Examples of correct code for this rule with the "backtick" option:

    /*eslint quotes: ["error", "backtick"]*/
    /*eslint-env es6*/
    
    var backtick = `backtick`;

    avoidEscape

    Examples of additional correct code for this rule with the "double", { "avoidEscape": true } options:

    /*eslint quotes: ["error", "double", { "avoidEscape": true }]*/
    
    var single = 'a string containing "double" quotes';

    Examples of additional correct code for this rule with the "single", { "avoidEscape": true } options:

    /*eslint quotes: ["error", "single", { "avoidEscape": true }]*/
    
    var double = "a string containing 'single' quotes";

    Examples of additional correct code for this rule with the "backtick", { "avoidEscape": true } options:

    /*eslint quotes: ["error", "backtick", { "avoidEscape": true }]*/
    
    var double = "a string containing `backtick` quotes"

    allowTemplateLiterals

    Examples of additional correct code for this rule with the "double", { "allowTemplateLiterals": true } options:

    /*eslint quotes: ["error", "double", { "allowTemplateLiterals": true }]*/
    
    var double = "double";
    var double = `double`;

    Examples of additional correct code for this rule with the "single", { "allowTemplateLiterals": true } options:

    /*eslint quotes: ["error", "single", { "allowTemplateLiterals": true }]*/
    
    var single = 'single';
    var single = `single`;

    When Not To Use It

    If you do not need consistency in your string styles, you can safely disable this rule. Source: http://eslint.org/docs/rules/

    Unexpected var, use let or const instead.
    Open

        var MetadataCache = function() {
    Severity: Minor
    Found in src/scripts/metadata_cache.js by eslint

    require let or const instead of var (no-var)

    ECMAScript 6 allows programmers to create variables with block scope instead of function scope using the let and const keywords. Block scope is common in many other programming languages and helps programmers avoid mistakes such as:

    var count = people.length;
    var enoughFood = count > sandwiches.length;
    
    if (enoughFood) {
        var count = sandwiches.length; // accidentally overriding the count variable
        console.log("We have " + count + " sandwiches for everyone. Plenty for all!");
    }
    
    // our count variable is no longer accurate
    console.log("We have " + count + " people and " + sandwiches.length + " sandwiches!");

    Rule Details

    This rule is aimed at discouraging the use of var and encouraging the use of const or let instead.

    Examples

    Examples of incorrect code for this rule:

    /*eslint no-var: "error"*/
    
    var x = "y";
    var CONFIG = {};

    Examples of correct code for this rule:

    /*eslint no-var: "error"*/
    /*eslint-env es6*/
    
    let x = "y";
    const CONFIG = {};

    When Not To Use It

    In addition to non-ES6 environments, existing JavaScript projects that are beginning to introduce ES6 into their codebase may not want to apply this rule if the cost of migrating from var to let is too costly. Source: http://eslint.org/docs/rules/

    Unexpected var, use let or const instead.
    Open

                    var entry = entries[name];
    Severity: Minor
    Found in src/scripts/metadata_cache.js by eslint

    require let or const instead of var (no-var)

    ECMAScript 6 allows programmers to create variables with block scope instead of function scope using the let and const keywords. Block scope is common in many other programming languages and helps programmers avoid mistakes such as:

    var count = people.length;
    var enoughFood = count > sandwiches.length;
    
    if (enoughFood) {
        var count = sandwiches.length; // accidentally overriding the count variable
        console.log("We have " + count + " sandwiches for everyone. Plenty for all!");
    }
    
    // our count variable is no longer accurate
    console.log("We have " + count + " people and " + sandwiches.length + " sandwiches!");

    Rule Details

    This rule is aimed at discouraging the use of var and encouraging the use of const or let instead.

    Examples

    Examples of incorrect code for this rule:

    /*eslint no-var: "error"*/
    
    var x = "y";
    var CONFIG = {};

    Examples of correct code for this rule:

    /*eslint no-var: "error"*/
    /*eslint-env es6*/
    
    let x = "y";
    const CONFIG = {};

    When Not To Use It

    In addition to non-ES6 environments, existing JavaScript projects that are beginning to introduce ES6 into their codebase may not want to apply this rule if the cost of migrating from var to let is too costly. Source: http://eslint.org/docs/rules/

    There are no issues that match your filters.

    Category
    Status