martinandert/babel-plugin-css-in-js

View on GitHub
src/transformSpecificationIntoCSS.js

Summary

Maintainability
B
4 hrs
Test Coverage

Function processMediaQuery has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

function processMediaQuery(css, name, query, content, level, parent, options) {
Severity: Major
Found in src/transformSpecificationIntoCSS.js - About 50 mins to fix

    Function processRules has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function processRules(css, name, rules, level, parent, options) {
    Severity: Minor
    Found in src/transformSpecificationIntoCSS.js - About 45 mins to fix

      Function processMediaQueries has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function processMediaQueries(css, name, mediaQueries, level, parent, options) {
      Severity: Minor
      Found in src/transformSpecificationIntoCSS.js - About 45 mins to fix

        Function processSelectors has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function processSelectors(css, name, selectors, level, parent, options) {
        Severity: Minor
        Found in src/transformSpecificationIntoCSS.js - About 45 mins to fix

          Function processStyle has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function processStyle(css, name, spec, level, parent, options) {
          Severity: Minor
          Found in src/transformSpecificationIntoCSS.js - About 45 mins to fix

            Function processParents has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function processParents(css, name, parents, level, options) {
            Severity: Minor
            Found in src/transformSpecificationIntoCSS.js - About 35 mins to fix

              Unexpected string concatenation.
              Open

                  css.push(indent(level) + '@' + generateMediaQueryName(query, options) + ' {');
              Severity: Minor
              Found in src/transformSpecificationIntoCSS.js by eslint

              Suggest using template literals instead of string concatenation. (prefer-template)

              In ES2015 (ES6), we can use template literals instead of string concatenation.

              var str = "Hello, " + name + "!";
              /*eslint-env es6*/
              
              var str = `Hello, ${name}!`;

              Rule Details

              This rule is aimed to flag usage of + operators with strings.

              Examples

              Examples of incorrect code for this rule:

              /*eslint prefer-template: "error"*/
              
              var str = "Hello, " + name + "!";
              var str = "Time: " + (12 * 60 * 60 * 1000);

              Examples of correct code for this rule:

              /*eslint prefer-template: "error"*/
              /*eslint-env es6*/
              
              var str = "Hello World!";
              var str = `Hello, ${name}!`;
              var str = `Time: ${12 * 60 * 60 * 1000}`;
              
              // This is reported by `no-useless-concat`.
              var str = "Hello, " + "World!";

              When Not To Use It

              This rule should not be used in ES3/5 environments.

              In ES2015 (ES6) or later, if you don't want to be notified about string concatenation, you can safely disable this rule.

              Related Rules

              Unexpected string concatenation.
              Open

                css.push(indent(level) + '}');
              Severity: Minor
              Found in src/transformSpecificationIntoCSS.js by eslint

              Suggest using template literals instead of string concatenation. (prefer-template)

              In ES2015 (ES6), we can use template literals instead of string concatenation.

              var str = "Hello, " + name + "!";
              /*eslint-env es6*/
              
              var str = `Hello, ${name}!`;

              Rule Details

              This rule is aimed to flag usage of + operators with strings.

              Examples

              Examples of incorrect code for this rule:

              /*eslint prefer-template: "error"*/
              
              var str = "Hello, " + name + "!";
              var str = "Time: " + (12 * 60 * 60 * 1000);

              Examples of correct code for this rule:

              /*eslint prefer-template: "error"*/
              /*eslint-env es6*/
              
              var str = "Hello World!";
              var str = `Hello, ${name}!`;
              var str = `Time: ${12 * 60 * 60 * 1000}`;
              
              // This is reported by `no-useless-concat`.
              var str = "Hello, " + "World!";

              When Not To Use It

              This rule should not be used in ES3/5 environments.

              In ES2015 (ES6) or later, if you don't want to be notified about string concatenation, you can safely disable this rule.

              Related Rules

              Unexpected string concatenation.
              Open

                  css.push(indent(level) + '}');
              Severity: Minor
              Found in src/transformSpecificationIntoCSS.js by eslint

              Suggest using template literals instead of string concatenation. (prefer-template)

              In ES2015 (ES6), we can use template literals instead of string concatenation.

              var str = "Hello, " + name + "!";
              /*eslint-env es6*/
              
              var str = `Hello, ${name}!`;

              Rule Details

              This rule is aimed to flag usage of + operators with strings.

              Examples

              Examples of incorrect code for this rule:

              /*eslint prefer-template: "error"*/
              
              var str = "Hello, " + name + "!";
              var str = "Time: " + (12 * 60 * 60 * 1000);

              Examples of correct code for this rule:

              /*eslint prefer-template: "error"*/
              /*eslint-env es6*/
              
              var str = "Hello World!";
              var str = `Hello, ${name}!`;
              var str = `Time: ${12 * 60 * 60 * 1000}`;
              
              // This is reported by `no-useless-concat`.
              var str = "Hello, " + "World!";

              When Not To Use It

              This rule should not be used in ES3/5 environments.

              In ES2015 (ES6) or later, if you don't want to be notified about string concatenation, you can safely disable this rule.

              Related Rules

              Unexpected string concatenation.
              Open

                  selector += '.' + generateClassName(name, options);
              Severity: Minor
              Found in src/transformSpecificationIntoCSS.js by eslint

              Suggest using template literals instead of string concatenation. (prefer-template)

              In ES2015 (ES6), we can use template literals instead of string concatenation.

              var str = "Hello, " + name + "!";
              /*eslint-env es6*/
              
              var str = `Hello, ${name}!`;

              Rule Details

              This rule is aimed to flag usage of + operators with strings.

              Examples

              Examples of incorrect code for this rule:

              /*eslint prefer-template: "error"*/
              
              var str = "Hello, " + name + "!";
              var str = "Time: " + (12 * 60 * 60 * 1000);

              Examples of correct code for this rule:

              /*eslint prefer-template: "error"*/
              /*eslint-env es6*/
              
              var str = "Hello World!";
              var str = `Hello, ${name}!`;
              var str = `Time: ${12 * 60 * 60 * 1000}`;
              
              // This is reported by `no-useless-concat`.
              var str = "Hello, " + "World!";

              When Not To Use It

              This rule should not be used in ES3/5 environments.

              In ES2015 (ES6) or later, if you don't want to be notified about string concatenation, you can safely disable this rule.

              Related Rules

              Unexpected string concatenation.
              Open

                css.push(indent(level) + selector + ' {');
              Severity: Minor
              Found in src/transformSpecificationIntoCSS.js by eslint

              Suggest using template literals instead of string concatenation. (prefer-template)

              In ES2015 (ES6), we can use template literals instead of string concatenation.

              var str = "Hello, " + name + "!";
              /*eslint-env es6*/
              
              var str = `Hello, ${name}!`;

              Rule Details

              This rule is aimed to flag usage of + operators with strings.

              Examples

              Examples of incorrect code for this rule:

              /*eslint prefer-template: "error"*/
              
              var str = "Hello, " + name + "!";
              var str = "Time: " + (12 * 60 * 60 * 1000);

              Examples of correct code for this rule:

              /*eslint prefer-template: "error"*/
              /*eslint-env es6*/
              
              var str = "Hello World!";
              var str = `Hello, ${name}!`;
              var str = `Time: ${12 * 60 * 60 * 1000}`;
              
              // This is reported by `no-useless-concat`.
              var str = "Hello, " + "World!";

              When Not To Use It

              This rule should not be used in ES3/5 environments.

              In ES2015 (ES6) or later, if you don't want to be notified about string concatenation, you can safely disable this rule.

              Related Rules

              Unary operator '++' used.
              Open

                for (let i = 0; i < level; i++) {
              Severity: Minor
              Found in src/transformSpecificationIntoCSS.js by eslint

              disallow the unary operators ++ and -- (no-plusplus)

              Because the unary ++ and -- operators are subject to automatic semicolon insertion, differences in whitespace can change semantics of source code.

              var i = 10;
              var j = 20;
              
              i ++
              j
              // i = 11, j = 20
              var i = 10;
              var j = 20;
              
              i
              ++
              j
              // i = 10, j = 21

              Rule Details

              This rule disallows the unary operators ++ and --.

              Examples of incorrect code for this rule:

              /*eslint no-plusplus: "error"*/
              
              var foo = 0;
              foo++;
              
              var bar = 42;
              bar--;
              
              for (i = 0; i < l; i++) {
                  return;
              }

              Examples of correct code for this rule:

              /*eslint no-plusplus: "error"*/
              
              var foo = 0;
              foo += 1;
              
              var bar = 42;
              bar -= 1;
              
              for (i = 0; i < l; i += 1) {
                  return;
              }

              Options

              This rule has an object option.

              • "allowForLoopAfterthoughts": true allows unary operators ++ and -- in the afterthought (final expression) of a for loop.

              allowForLoopAfterthoughts

              Examples of correct code for this rule with the { "allowForLoopAfterthoughts": true } option:

              /*eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }]*/
              
              for (i = 0; i < l; i++) {
                  return;
              }
              
              for (i = 0; i < l; i--) {
                  return;
              }

              Source: http://eslint.org/docs/rules/

              There are no issues that match your filters.

              Category
              Status