From c5b405280409698d14b62cbf3c87b7cf6cf71391 Mon Sep 17 00:00:00 2001 From: Teddy Katz Date: Sat, 17 Jun 2017 22:44:54 -0700 Subject: [PATCH] Chore: enable computed-property-spacing on ESLint codebase (#8760) --- lib/cli-engine.js | 2 +- lib/code-path-analysis/code-path-state.js | 2 +- lib/config.js | 2 +- packages/eslint-config-eslint/default.yml | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/cli-engine.js b/lib/cli-engine.js index f53c2e76a89..ebca4cb819a 100644 --- a/lib/cli-engine.js +++ b/lib/cli-engine.js @@ -318,7 +318,7 @@ function getCacheFile(cacheFile, cwd) { cacheFile = path.normalize(cacheFile); const resolvedCacheFile = path.resolve(cwd, cacheFile); - const looksLikeADirectory = cacheFile[cacheFile.length - 1 ] === path.sep; + const looksLikeADirectory = cacheFile[cacheFile.length - 1] === path.sep; /** * return the name for the cache file in case the provided parameter is a directory diff --git a/lib/code-path-analysis/code-path-state.js b/lib/code-path-analysis/code-path-state.js index a5adb554ff9..7c8abb2071c 100644 --- a/lib/code-path-analysis/code-path-state.js +++ b/lib/code-path-analysis/code-path-state.js @@ -240,7 +240,7 @@ class CodePathState { this.breakContext = null; this.currentSegments = []; - this.initialSegment = this.forkContext.head[ 0 ]; + this.initialSegment = this.forkContext.head[0]; // returnedSegments and thrownSegments push elements into finalSegments also. const final = this.finalSegments = []; diff --git a/lib/config.js b/lib/config.js index 5407134d6f2..5c04ee4e152 100644 --- a/lib/config.js +++ b/lib/config.js @@ -198,7 +198,7 @@ class Config { this.useEslintrc = (options.useEslintrc !== false); this.env = (options.envs || []).reduce((envs, name) => { - envs[ name ] = true; + envs[name] = true; return envs; }, {}); diff --git a/packages/eslint-config-eslint/default.yml b/packages/eslint-config-eslint/default.yml index 9180f7525bf..634fd46243c 100644 --- a/packages/eslint-config-eslint/default.yml +++ b/packages/eslint-config-eslint/default.yml @@ -16,6 +16,7 @@ rules: comma-dangle: "error" comma-spacing: "error" comma-style: ["error", "last"] + computed-property-spacing: "error" consistent-return: "error" curly: ["error", "all"] default-case: "error"