ewolfe/prlint

View on GitHub

Showing 20 of 27 total issues

Function updateShaStatus has 144 lines of code (exceeds 25 allowed). Consider refactoring.
Open

async function updateShaStatus(body, res) {
  const accessToken = accessTokens[`${body.installation.id}`].token;
  const pullRequestFlattened = flatten(body.pull_request);

  try {
Severity: Major
Found in src/app.js - About 5 hrs to fix

    Function exports has 59 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = async (req, res) => {
      if (req.url === '/favicon.ico') {
        res.writeHead(200, { 'Content-Type': 'image/x-icon' });
        res.end();
      }
    Severity: Major
    Found in src/app.js - About 2 hrs to fix

      Function updateShaStatus has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

      async function updateShaStatus(body, res) {
        const accessToken = accessTokens[`${body.installation.id}`].token;
        const pullRequestFlattened = flatten(body.pull_request);
      
        try {
      Severity: Minor
      Found in src/app.js - About 2 hrs 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 exports has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = async (req, res) => {
        if (req.url === '/favicon.ico') {
          res.writeHead(200, { 'Content-Type': 'image/x-icon' });
          res.end();
        }
      Severity: Minor
      Found in src/app.js - About 1 hr 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

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

        const prlintDotJson = nock('https://api.github.com')
          .get(`/repos/${
            payloadNormal.repository.full_name
          }/contents/.github/prlint.json?ref=${
            payloadNormal.pull_request.head.ref
      Severity: Major
      Found in test/test.js and 2 other locations - About 1 hr to fix
      test/test.js on lines 204..208
      test/test.js on lines 265..271

      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

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

        const statuses = nock('https://api.github.com')
          .post(`/repos/${payloadFailure.repository.full_name}/statuses/${
            payloadFailure.pull_request.head.sha
          }`)
          .reply(200);
      Severity: Major
      Found in test/test.js and 2 other locations - About 1 hr to fix
      test/test.js on lines 265..271
      test/test.js on lines 304..310

      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

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

        const prlintDotJson = nock('https://api.github.com')
          .get(`/repos/${
            payloadNormal.repository.full_name
          }/contents/.github/prlint.json?ref=${
            payloadNormal.pull_request.head.ref
      Severity: Major
      Found in test/test.js and 2 other locations - About 1 hr to fix
      test/test.js on lines 204..208
      test/test.js on lines 304..310

      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

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

        const statuses1 = nock('https://api.github.com')
          .post(`/repos/${payloadNormal.repository.full_name}/statuses/${
            payloadNormal.pull_request.head.sha
          }`)
          .reply(200);
      Severity: Major
      Found in test/test.js and 1 other location - About 1 hr to fix
      test/test.js on lines 95..99

      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 62.

      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

        const statuses = nock('https://api.github.com')
          .post(`/repos/${payloadNormal.repository.full_name}/statuses/${
            payloadNormal.pull_request.head.sha
          }`)
          .reply(500);
      Severity: Major
      Found in test/test.js and 1 other location - About 1 hr to fix
      test/test.js on lines 139..143

      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 62.

      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 3 locations. Consider refactoring.
      Open

        const accessTokens = nock('https://api.github.com')
          .post(`/installations/${payloadNormal.installation.id}/access_tokens`)
          .reply(200, {
            expires_at: date,
            token: 'token',
      Severity: Major
      Found in test/test.js and 2 other locations - About 1 hr to fix
      test/test.js on lines 119..124
      test/test.js on lines 184..189

      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 56.

      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 3 locations. Consider refactoring.
      Open

        const accessToken = nock('https://api.github.com')
          .post(`/installations/${payloadFailure.installation.id}/access_tokens`)
          .reply(200, {
            expires_at: date,
            token: 'token',
      Severity: Major
      Found in test/test.js and 2 other locations - About 1 hr to fix
      test/test.js on lines 86..91
      test/test.js on lines 119..124

      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 56.

      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 3 locations. Consider refactoring.
      Open

        const accessTokens1 = nock('https://api.github.com')
          .post(`/installations/${payloadNormal.installation.id}/access_tokens`)
          .reply(200, {
            expires_at: date,
            token: 'token',
      Severity: Major
      Found in test/test.js and 2 other locations - About 1 hr to fix
      test/test.js on lines 86..91
      test/test.js on lines 184..189

      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 56.

      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 2 locations. Consider refactoring.
      Open

        nock('https://api.github.com')
          .post(`/installations/${payloadNormal.installation.id}/access_tokens`)
          .reply(200, {
            expires_at: date,
            token: 'token',
      Severity: Minor
      Found in test/test.js and 1 other location - About 55 mins to fix
      test/test.js on lines 296..301

      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 54.

      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 2 locations. Consider refactoring.
      Open

        nock('https://api.github.com')
          .post(`/installations/${payloadNormal.installation.id}/access_tokens`)
          .reply(200, {
            expires_at: date,
            token: 'token',
      Severity: Minor
      Found in test/test.js and 1 other location - About 55 mins to fix
      test/test.js on lines 257..262

      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 54.

      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 2 locations. Consider refactoring.
      Open

        const response = await request.post(`${url}/webhook`, {
          // https://github.com/request/request-promise
          json: payloadNormal,
          resolveWithFullResponse: true, // give us access to response.statusCode
          simple: false, // don't throw when non 2xx
      Severity: Minor
      Found in test/test.js and 1 other location - About 40 mins to fix
      test/test.js on lines 71..76

      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 49.

      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 2 locations. Consider refactoring.
      Open

        const response = await request.post(`${url}/webhook`, {
          // https://github.com/request/request-promise
          json: payloadNormal,
          resolveWithFullResponse: true, // give us access to response.statusCode
          simple: false, // don't throw when non 2xx
      Severity: Minor
      Found in test/test.js and 1 other location - About 40 mins to fix
      test/test.js on lines 104..109

      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 49.

      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

      Unexpected newline after '('.
      Open

            prlintDotJson = JSON.parse(
      Severity: Minor
      Found in src/app.js by eslint

      enforce consistent line breaks inside function parentheses (function-paren-newline)

      Many style guides require or disallow newlines inside of function parentheses.

      Rule Details

      This rule enforces consistent line breaks inside parentheses of function parameters or arguments.

      Options

      This rule has a single option, which can either be a string or an object.

      • "always" requires line breaks inside all function parentheses.
      • "never" disallows line breaks inside all function parentheses.
      • "multiline" (default) requires linebreaks inside function parentheses if any of the parameters/arguments have a line break between them. Otherwise, it disallows linebreaks.
      • "consistent" requires consistent usage of linebreaks for each pair of parentheses. It reports an error if one parenthesis in the pair has a linebreak inside it and the other parenthesis does not.
      • { "minItems": value } requires linebreaks inside function parentheses if the number of parameters/arguments is at least value. Otherwise, it disallows linebreaks.

      Example configurations:

      {
        "rules": {
          "function-paren-newline": ["error", "never"]
        }
      }
      {
        "rules": {
          "function-paren-newline": ["error", { "minItems": 3 }]
        }
      }

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

      /* eslint function-paren-newline: ["error", "always"] */
      
      function foo(bar, baz) {}
      
      var foo = function(bar, baz) {};
      
      var foo = (bar, baz) => {};
      
      foo(bar, baz);

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

      /* eslint function-paren-newline: ["error", "always"] */
      
      function foo(
        bar,
        baz
      ) {}
      
      var foo = function(
        bar, baz
      ) {};
      
      var foo = (
        bar,
        baz
      ) => {};
      
      foo(
        bar,
        baz
      );

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

      /* eslint function-paren-newline: ["error", "never"] */
      
      function foo(
        bar,
        baz
      ) {}
      
      var foo = function(
        bar, baz
      ) {};
      
      var foo = (
        bar,
        baz
      ) => {};
      
      foo(
        bar,
        baz
      );

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

      /* eslint function-paren-newline: ["error", "never"] */
      
      function foo(bar, baz) {}
      
      function foo(bar,
                   baz) {}
      
      var foo = function(bar, baz) {};
      
      var foo = (bar, baz) => {};
      
      foo(bar, baz);
      
      foo(bar,
        baz);

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

      /* eslint function-paren-newline: ["error", "multiline"] */
      
      function foo(bar,
        baz
      ) {}
      
      var foo = function(
        bar, baz
      ) {};
      
      var foo = (
        bar,
        baz) => {};
      
      foo(bar,
        baz);
      
      foo(
        function() {
          return baz;
        }
      );

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

      /* eslint function-paren-newline: ["error", "multiline"] */
      
      function foo(bar, baz) {}
      
      var foo = function(
        bar,
        baz
      ) {};
      
      var foo = (bar, baz) => {};
      
      foo(bar, baz, qux);
      
      foo(
        bar,
        baz,
        qux
      );
      
      foo(function() {
        return baz;
      });

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

      /* eslint function-paren-newline: ["error", "consistent"] */
      
      function foo(bar,
        baz
      ) {}
      
      var foo = function(bar,
        baz
      ) {};
      
      var foo = (
        bar,
        baz) => {};
      
      foo(
        bar,
        baz);
      
      foo(
        function() {
          return baz;
        });

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

      /* eslint function-paren-newline: ["error", "consistent"] */
      
      function foo(bar,
        baz) {}
      
      var foo = function(bar, baz) {};
      
      var foo = (
        bar,
        baz
      ) => {};
      
      foo(
        bar, baz
      );
      
      foo(
        function() {
          return baz;
        }
      );

      Examples of incorrect code for this rule with the { "minItems": 3 } option:

      /* eslint function-paren-newline: ["error", { "minItems": 3 }] */
      
      function foo(
        bar,
        baz
      ) {}
      
      function foo(bar, baz, qux) {}
      
      var foo = function(
        bar, baz
      ) {};
      
      var foo = (bar,
        baz) => {};
      
      foo(bar,
        baz);

      Examples of correct code for this rule with the { "minItems": 3 } option:

      /* eslint function-paren-newline: ["error", { "minItems": 3 }] */
      
      function foo(bar, baz) {}
      
      var foo = function(
        bar,
        baz,
        qux
      ) {};
      
      var foo = (
        bar, baz, qux
      ) => {};
      
      foo(bar, baz);
      
      foo(
        bar, baz, qux
      );

      When Not To Use It

      If don't want to enforce consistent linebreaks inside function parentheses, do not turn on this rule. Source: http://eslint.org/docs/rules/

      Unexpected newline before ')'.
      Open

                )}`,
      Severity: Minor
      Found in src/app.js by eslint

      enforce consistent line breaks inside function parentheses (function-paren-newline)

      Many style guides require or disallow newlines inside of function parentheses.

      Rule Details

      This rule enforces consistent line breaks inside parentheses of function parameters or arguments.

      Options

      This rule has a single option, which can either be a string or an object.

      • "always" requires line breaks inside all function parentheses.
      • "never" disallows line breaks inside all function parentheses.
      • "multiline" (default) requires linebreaks inside function parentheses if any of the parameters/arguments have a line break between them. Otherwise, it disallows linebreaks.
      • "consistent" requires consistent usage of linebreaks for each pair of parentheses. It reports an error if one parenthesis in the pair has a linebreak inside it and the other parenthesis does not.
      • { "minItems": value } requires linebreaks inside function parentheses if the number of parameters/arguments is at least value. Otherwise, it disallows linebreaks.

      Example configurations:

      {
        "rules": {
          "function-paren-newline": ["error", "never"]
        }
      }
      {
        "rules": {
          "function-paren-newline": ["error", { "minItems": 3 }]
        }
      }

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

      /* eslint function-paren-newline: ["error", "always"] */
      
      function foo(bar, baz) {}
      
      var foo = function(bar, baz) {};
      
      var foo = (bar, baz) => {};
      
      foo(bar, baz);

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

      /* eslint function-paren-newline: ["error", "always"] */
      
      function foo(
        bar,
        baz
      ) {}
      
      var foo = function(
        bar, baz
      ) {};
      
      var foo = (
        bar,
        baz
      ) => {};
      
      foo(
        bar,
        baz
      );

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

      /* eslint function-paren-newline: ["error", "never"] */
      
      function foo(
        bar,
        baz
      ) {}
      
      var foo = function(
        bar, baz
      ) {};
      
      var foo = (
        bar,
        baz
      ) => {};
      
      foo(
        bar,
        baz
      );

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

      /* eslint function-paren-newline: ["error", "never"] */
      
      function foo(bar, baz) {}
      
      function foo(bar,
                   baz) {}
      
      var foo = function(bar, baz) {};
      
      var foo = (bar, baz) => {};
      
      foo(bar, baz);
      
      foo(bar,
        baz);

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

      /* eslint function-paren-newline: ["error", "multiline"] */
      
      function foo(bar,
        baz
      ) {}
      
      var foo = function(
        bar, baz
      ) {};
      
      var foo = (
        bar,
        baz) => {};
      
      foo(bar,
        baz);
      
      foo(
        function() {
          return baz;
        }
      );

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

      /* eslint function-paren-newline: ["error", "multiline"] */
      
      function foo(bar, baz) {}
      
      var foo = function(
        bar,
        baz
      ) {};
      
      var foo = (bar, baz) => {};
      
      foo(bar, baz, qux);
      
      foo(
        bar,
        baz,
        qux
      );
      
      foo(function() {
        return baz;
      });

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

      /* eslint function-paren-newline: ["error", "consistent"] */
      
      function foo(bar,
        baz
      ) {}
      
      var foo = function(bar,
        baz
      ) {};
      
      var foo = (
        bar,
        baz) => {};
      
      foo(
        bar,
        baz);
      
      foo(
        function() {
          return baz;
        });

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

      /* eslint function-paren-newline: ["error", "consistent"] */
      
      function foo(bar,
        baz) {}
      
      var foo = function(bar, baz) {};
      
      var foo = (
        bar,
        baz
      ) => {};
      
      foo(
        bar, baz
      );
      
      foo(
        function() {
          return baz;
        }
      );

      Examples of incorrect code for this rule with the { "minItems": 3 } option:

      /* eslint function-paren-newline: ["error", { "minItems": 3 }] */
      
      function foo(
        bar,
        baz
      ) {}
      
      function foo(bar, baz, qux) {}
      
      var foo = function(
        bar, baz
      ) {};
      
      var foo = (bar,
        baz) => {};
      
      foo(bar,
        baz);

      Examples of correct code for this rule with the { "minItems": 3 } option:

      /* eslint function-paren-newline: ["error", { "minItems": 3 }] */
      
      function foo(bar, baz) {}
      
      var foo = function(
        bar,
        baz,
        qux
      ) {};
      
      var foo = (
        bar, baz, qux
      ) => {};
      
      foo(bar, baz);
      
      foo(
        bar, baz, qux
      );

      When Not To Use It

      If don't want to enforce consistent linebreaks inside function parentheses, do not turn on this rule. Source: http://eslint.org/docs/rules/

      Unexpected newline after '('.
      Open

                target_url: `https://github.com/ewolfe/prlint/issues/new?title=Exception Report&body=${encodeURIComponent(
      Severity: Minor
      Found in src/app.js by eslint

      enforce consistent line breaks inside function parentheses (function-paren-newline)

      Many style guides require or disallow newlines inside of function parentheses.

      Rule Details

      This rule enforces consistent line breaks inside parentheses of function parameters or arguments.

      Options

      This rule has a single option, which can either be a string or an object.

      • "always" requires line breaks inside all function parentheses.
      • "never" disallows line breaks inside all function parentheses.
      • "multiline" (default) requires linebreaks inside function parentheses if any of the parameters/arguments have a line break between them. Otherwise, it disallows linebreaks.
      • "consistent" requires consistent usage of linebreaks for each pair of parentheses. It reports an error if one parenthesis in the pair has a linebreak inside it and the other parenthesis does not.
      • { "minItems": value } requires linebreaks inside function parentheses if the number of parameters/arguments is at least value. Otherwise, it disallows linebreaks.

      Example configurations:

      {
        "rules": {
          "function-paren-newline": ["error", "never"]
        }
      }
      {
        "rules": {
          "function-paren-newline": ["error", { "minItems": 3 }]
        }
      }

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

      /* eslint function-paren-newline: ["error", "always"] */
      
      function foo(bar, baz) {}
      
      var foo = function(bar, baz) {};
      
      var foo = (bar, baz) => {};
      
      foo(bar, baz);

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

      /* eslint function-paren-newline: ["error", "always"] */
      
      function foo(
        bar,
        baz
      ) {}
      
      var foo = function(
        bar, baz
      ) {};
      
      var foo = (
        bar,
        baz
      ) => {};
      
      foo(
        bar,
        baz
      );

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

      /* eslint function-paren-newline: ["error", "never"] */
      
      function foo(
        bar,
        baz
      ) {}
      
      var foo = function(
        bar, baz
      ) {};
      
      var foo = (
        bar,
        baz
      ) => {};
      
      foo(
        bar,
        baz
      );

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

      /* eslint function-paren-newline: ["error", "never"] */
      
      function foo(bar, baz) {}
      
      function foo(bar,
                   baz) {}
      
      var foo = function(bar, baz) {};
      
      var foo = (bar, baz) => {};
      
      foo(bar, baz);
      
      foo(bar,
        baz);

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

      /* eslint function-paren-newline: ["error", "multiline"] */
      
      function foo(bar,
        baz
      ) {}
      
      var foo = function(
        bar, baz
      ) {};
      
      var foo = (
        bar,
        baz) => {};
      
      foo(bar,
        baz);
      
      foo(
        function() {
          return baz;
        }
      );

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

      /* eslint function-paren-newline: ["error", "multiline"] */
      
      function foo(bar, baz) {}
      
      var foo = function(
        bar,
        baz
      ) {};
      
      var foo = (bar, baz) => {};
      
      foo(bar, baz, qux);
      
      foo(
        bar,
        baz,
        qux
      );
      
      foo(function() {
        return baz;
      });

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

      /* eslint function-paren-newline: ["error", "consistent"] */
      
      function foo(bar,
        baz
      ) {}
      
      var foo = function(bar,
        baz
      ) {};
      
      var foo = (
        bar,
        baz) => {};
      
      foo(
        bar,
        baz);
      
      foo(
        function() {
          return baz;
        });

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

      /* eslint function-paren-newline: ["error", "consistent"] */
      
      function foo(bar,
        baz) {}
      
      var foo = function(bar, baz) {};
      
      var foo = (
        bar,
        baz
      ) => {};
      
      foo(
        bar, baz
      );
      
      foo(
        function() {
          return baz;
        }
      );

      Examples of incorrect code for this rule with the { "minItems": 3 } option:

      /* eslint function-paren-newline: ["error", { "minItems": 3 }] */
      
      function foo(
        bar,
        baz
      ) {}
      
      function foo(bar, baz, qux) {}
      
      var foo = function(
        bar, baz
      ) {};
      
      var foo = (bar,
        baz) => {};
      
      foo(bar,
        baz);

      Examples of correct code for this rule with the { "minItems": 3 } option:

      /* eslint function-paren-newline: ["error", { "minItems": 3 }] */
      
      function foo(bar, baz) {}
      
      var foo = function(
        bar,
        baz,
        qux
      ) {};
      
      var foo = (
        bar, baz, qux
      ) => {};
      
      foo(bar, baz);
      
      foo(
        bar, baz, qux
      );

      When Not To Use It

      If don't want to enforce consistent linebreaks inside function parentheses, do not turn on this rule. Source: http://eslint.org/docs/rules/

      Unexpected newline before ')'.
      Open

            );
      Severity: Minor
      Found in src/app.js by eslint

      enforce consistent line breaks inside function parentheses (function-paren-newline)

      Many style guides require or disallow newlines inside of function parentheses.

      Rule Details

      This rule enforces consistent line breaks inside parentheses of function parameters or arguments.

      Options

      This rule has a single option, which can either be a string or an object.

      • "always" requires line breaks inside all function parentheses.
      • "never" disallows line breaks inside all function parentheses.
      • "multiline" (default) requires linebreaks inside function parentheses if any of the parameters/arguments have a line break between them. Otherwise, it disallows linebreaks.
      • "consistent" requires consistent usage of linebreaks for each pair of parentheses. It reports an error if one parenthesis in the pair has a linebreak inside it and the other parenthesis does not.
      • { "minItems": value } requires linebreaks inside function parentheses if the number of parameters/arguments is at least value. Otherwise, it disallows linebreaks.

      Example configurations:

      {
        "rules": {
          "function-paren-newline": ["error", "never"]
        }
      }
      {
        "rules": {
          "function-paren-newline": ["error", { "minItems": 3 }]
        }
      }

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

      /* eslint function-paren-newline: ["error", "always"] */
      
      function foo(bar, baz) {}
      
      var foo = function(bar, baz) {};
      
      var foo = (bar, baz) => {};
      
      foo(bar, baz);

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

      /* eslint function-paren-newline: ["error", "always"] */
      
      function foo(
        bar,
        baz
      ) {}
      
      var foo = function(
        bar, baz
      ) {};
      
      var foo = (
        bar,
        baz
      ) => {};
      
      foo(
        bar,
        baz
      );

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

      /* eslint function-paren-newline: ["error", "never"] */
      
      function foo(
        bar,
        baz
      ) {}
      
      var foo = function(
        bar, baz
      ) {};
      
      var foo = (
        bar,
        baz
      ) => {};
      
      foo(
        bar,
        baz
      );

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

      /* eslint function-paren-newline: ["error", "never"] */
      
      function foo(bar, baz) {}
      
      function foo(bar,
                   baz) {}
      
      var foo = function(bar, baz) {};
      
      var foo = (bar, baz) => {};
      
      foo(bar, baz);
      
      foo(bar,
        baz);

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

      /* eslint function-paren-newline: ["error", "multiline"] */
      
      function foo(bar,
        baz
      ) {}
      
      var foo = function(
        bar, baz
      ) {};
      
      var foo = (
        bar,
        baz) => {};
      
      foo(bar,
        baz);
      
      foo(
        function() {
          return baz;
        }
      );

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

      /* eslint function-paren-newline: ["error", "multiline"] */
      
      function foo(bar, baz) {}
      
      var foo = function(
        bar,
        baz
      ) {};
      
      var foo = (bar, baz) => {};
      
      foo(bar, baz, qux);
      
      foo(
        bar,
        baz,
        qux
      );
      
      foo(function() {
        return baz;
      });

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

      /* eslint function-paren-newline: ["error", "consistent"] */
      
      function foo(bar,
        baz
      ) {}
      
      var foo = function(bar,
        baz
      ) {};
      
      var foo = (
        bar,
        baz) => {};
      
      foo(
        bar,
        baz);
      
      foo(
        function() {
          return baz;
        });

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

      /* eslint function-paren-newline: ["error", "consistent"] */
      
      function foo(bar,
        baz) {}
      
      var foo = function(bar, baz) {};
      
      var foo = (
        bar,
        baz
      ) => {};
      
      foo(
        bar, baz
      );
      
      foo(
        function() {
          return baz;
        }
      );

      Examples of incorrect code for this rule with the { "minItems": 3 } option:

      /* eslint function-paren-newline: ["error", { "minItems": 3 }] */
      
      function foo(
        bar,
        baz
      ) {}
      
      function foo(bar, baz, qux) {}
      
      var foo = function(
        bar, baz
      ) {};
      
      var foo = (bar,
        baz) => {};
      
      foo(bar,
        baz);

      Examples of correct code for this rule with the { "minItems": 3 } option:

      /* eslint function-paren-newline: ["error", { "minItems": 3 }] */
      
      function foo(bar, baz) {}
      
      var foo = function(
        bar,
        baz,
        qux
      ) {};
      
      var foo = (
        bar, baz, qux
      ) => {};
      
      foo(bar, baz);
      
      foo(
        bar, baz, qux
      );

      When Not To Use It

      If don't want to enforce consistent linebreaks inside function parentheses, do not turn on this rule. Source: http://eslint.org/docs/rules/

      Severity
      Category
      Status
      Source
      Language