]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/lib/rules/function-paren-newline.js
import 8.4.0 source
[pve-eslint.git] / eslint / lib / rules / function-paren-newline.js
index 894c8e331a716815c2e5d460205074cdc4c5658e..ed94fad460cefa524c5603223b5bfeb593a72775 100644 (file)
@@ -14,13 +14,13 @@ const astUtils = require("./utils/ast-utils");
 // Rule Definition
 //------------------------------------------------------------------------------
 
+/** @type {import('../shared/types').Rule} */
 module.exports = {
     meta: {
         type: "layout",
 
         docs: {
             description: "enforce consistent line breaks inside function parentheses",
-            category: "Stylistic Issues",
             recommended: false,
             url: "https://eslint.org/docs/rules/function-paren-newline"
         },
@@ -183,6 +183,7 @@ module.exports = {
         /**
          * Gets the left paren and right paren tokens of a node.
          * @param {ASTNode} node The node with parens
+         * @throws {TypeError} Unexecpted node type.
          * @returns {Object} An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token.
          * Can also return `null` if an expression has no parens (e.g. a NewExpression with no arguments, or an ArrowFunctionExpression
          * with a single parameter)
@@ -218,7 +219,7 @@ module.exports = {
                 }
 
                 case "ArrowFunctionExpression": {
-                    const firstToken = sourceCode.getFirstToken(node);
+                    const firstToken = sourceCode.getFirstToken(node, { skip: (node.async ? 1 : 0) });
 
                     if (!astUtils.isOpeningParenToken(firstToken)) {