From 472025f2814d0360fe8d4cddbcba049982e1cd43 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Mon, 2 Mar 2020 11:55:08 -0500 Subject: [PATCH] Chore: update space-before-function-paren in eslint-config-eslint (#12966) * Chore: update space-before-function-paren in eslint-config-eslint * Run autofixer --- packages/eslint-config-eslint/default.yml | 6 ++++- .../cascading-config-array-factory.js | 24 +++++++++---------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/packages/eslint-config-eslint/default.yml b/packages/eslint-config-eslint/default.yml index 8f3ed3125a2..2082409ffa2 100644 --- a/packages/eslint-config-eslint/default.yml +++ b/packages/eslint-config-eslint/default.yml @@ -188,7 +188,11 @@ rules: semi-spacing: ["error", {before: false, after: true}] semi-style: "error" space-before-blocks: "error" - space-before-function-paren: ["error", "never"] + space-before-function-paren: ["error", { + "anonymous": "never", + "named": "never", + "asyncArrow": "always" + }] space-in-parens: "error" space-infix-ops: "error" space-unary-ops: ["error", {words: true, nonwords: false}] diff --git a/tests/lib/cli-engine/cascading-config-array-factory.js b/tests/lib/cli-engine/cascading-config-array-factory.js index 32d094aba81..0bc49b461bf 100644 --- a/tests/lib/cli-engine/cascading-config-array-factory.js +++ b/tests/lib/cli-engine/cascading-config-array-factory.js @@ -160,7 +160,7 @@ describe("CascadingConfigArrayFactory", () => { // no warning. describe("when it lints 'subdir/exist-with-root/test.js'", () => { - beforeEach(async() => { + beforeEach(async () => { config = factory.getConfigArrayForFile("exist-with-root/test.js"); await delay(); }); @@ -179,7 +179,7 @@ describe("CascadingConfigArrayFactory", () => { // no warning. describe("when it lints 'subdir/exist/test.js'", () => { - beforeEach(async() => { + beforeEach(async () => { config = factory.getConfigArrayForFile("exist/test.js"); await delay(); }); @@ -198,7 +198,7 @@ describe("CascadingConfigArrayFactory", () => { // no warning describe("when it lints 'subdir/not-exist/test.js'", () => { - beforeEach(async() => { + beforeEach(async () => { config = factory.getConfigArrayForFile("not-exist/test.js"); await delay(); }); @@ -240,7 +240,7 @@ describe("CascadingConfigArrayFactory", () => { // Project's config file has `root:true`, then no warning. describe("when it lints 'subdir/exist-with-root/test.js'", () => { - beforeEach(async() => { + beforeEach(async () => { config = factory.getConfigArrayForFile("exist-with-root/test.js"); await delay(); }); @@ -259,7 +259,7 @@ describe("CascadingConfigArrayFactory", () => { // Project's config file doesn't have `root:true` and home is ancestor, then ESLINT_PERSONAL_CONFIG_SUPPRESS. describe("when it lints 'subdir/exist/test.js'", () => { - beforeEach(async() => { + beforeEach(async () => { config = factory.getConfigArrayForFile("exist/test.js"); await delay(); }); @@ -286,7 +286,7 @@ describe("CascadingConfigArrayFactory", () => { * In this case, ESLint will continue to use `~/.eslintrc.json` even if personal config file feature is removed. */ describe("when it lints 'subdir/not-exist/test.js'", () => { - beforeEach(async() => { + beforeEach(async () => { config = factory.getConfigArrayForFile("not-exist/test.js"); await delay(); }); @@ -328,7 +328,7 @@ describe("CascadingConfigArrayFactory", () => { // Project's config file has `root:true`, then no warning. describe("when it lints 'exist-with-root/test.js'", () => { - beforeEach(async() => { + beforeEach(async () => { config = factory.getConfigArrayForFile("exist-with-root/test.js"); await delay(); }); @@ -347,7 +347,7 @@ describe("CascadingConfigArrayFactory", () => { // Project's config file doesn't have `root:true` but home is not ancestor, then no warning. describe("when it lints 'exist/test.js'", () => { - beforeEach(async() => { + beforeEach(async () => { config = factory.getConfigArrayForFile("exist/test.js"); await delay(); }); @@ -366,7 +366,7 @@ describe("CascadingConfigArrayFactory", () => { // Project's config file doesn't exist and home is not ancestor, then ESLINT_PERSONAL_CONFIG_LOAD. describe("when it lints 'not-exist/test.js'", () => { - beforeEach(async() => { + beforeEach(async () => { config = factory.getConfigArrayForFile("not-exist/test.js"); await delay(); }); @@ -407,7 +407,7 @@ describe("CascadingConfigArrayFactory", () => { }); describe("when it lints 'subdir/exist/test.js'", () => { - beforeEach(async() => { + beforeEach(async () => { config = factory.getConfigArrayForFile("exist/test.js"); await delay(); }); @@ -436,7 +436,7 @@ describe("CascadingConfigArrayFactory", () => { }); describe("when it lints 'not-exist/test.js'", () => { - beforeEach(async() => { + beforeEach(async () => { config = factory.getConfigArrayForFile("not-exist/test.js", { ignoreNotFoundError: true }); await delay(); }); @@ -1514,7 +1514,7 @@ describe("CascadingConfigArrayFactory", () => { process.removeListener("warning", onWarning); }); - it("should emit a deprecation warning if 'ecmaFeatures' is given.", async() => { + it("should emit a deprecation warning if 'ecmaFeatures' is given.", async () => { getConfig(factory, "ecma-features/test.js"); // Wait for "warning" event.