From eca636aa2e5e9c0e0117e57aeb40ade8bc4db311 Mon Sep 17 00:00:00 2001 From: Ismail Syed Date: Tue, 24 Oct 2017 10:08:15 -0400 Subject: [PATCH] Reformat after rebase --- lib/config/mocha.js | 18 +++++++----------- lib/config/react.js | 11 +++++------ lib/config/rules/best-practices.js | 8 ++------ lib/config/rules/import.js | 12 ++++++------ lib/config/rules/stylistic-issues.js | 23 +++++++++++++++-------- 5 files changed, 35 insertions(+), 37 deletions(-) diff --git a/lib/config/mocha.js b/lib/config/mocha.js index 1cb5cbbe..e39b7ca8 100644 --- a/lib/config/mocha.js +++ b/lib/config/mocha.js @@ -7,15 +7,11 @@ module.exports = { plugins: ['mocha', 'chai-expect', 'shopify'], - rules: merge( - require('./rules/mocha'), - require('./rules/chai-expect'), - { - 'shopify/sinon-prefer-meaningful-assertions': 'error', - // Chai expect syntax produces unused expression warnings - 'no-unused-expressions': 'off', - // Chai expect syntax can have long chained calls - 'newline-per-chained-call': 'off', - } - ), + rules: merge(require('./rules/mocha'), require('./rules/chai-expect'), { + 'shopify/sinon-prefer-meaningful-assertions': 'error', + // Chai expect syntax produces unused expression warnings + 'no-unused-expressions': 'off', + // Chai expect syntax can have long chained calls + 'newline-per-chained-call': 'off', + }), }; diff --git a/lib/config/react.js b/lib/config/react.js index 19e1d92a..889146a1 100644 --- a/lib/config/react.js +++ b/lib/config/react.js @@ -19,12 +19,11 @@ module.exports = { plugins: ['react', 'jsx-a11y'], - rules: merge( - require('./rules/react'), - require('./rules/jsx-a11y'), - { - // Not using `this` is fine in some lifecycle hooks - 'class-methods-use-this': ['error', { + rules: merge(require('./rules/react'), require('./rules/jsx-a11y'), { + // Not using `this` is fine in some lifecycle hooks + 'class-methods-use-this': [ + 'error', + { exceptMethods: [ 'render', 'getChildContext', diff --git a/lib/config/rules/best-practices.js b/lib/config/rules/best-practices.js index 79eae560..766fd780 100755 --- a/lib/config/rules/best-practices.js +++ b/lib/config/rules/best-practices.js @@ -14,11 +14,7 @@ module.exports = { // Require return statements to either always or never specify values 'consistent-return': 'error', // Specify curly brace conventions for all control statements -<<<<<<< HEAD - 'curly': ['error', 'all'], -======= - curly: ['warn', 'all'], ->>>>>>> Run eslint --fix with prettier config + curly: ['error', 'all'], // Require default case in switch statements 'default-case': 'off', // Encourages use of dot notation whenever possible @@ -147,5 +143,5 @@ module.exports = { // Require immediate function invocation to be wrapped in parentheses 'wrap-iife': ['error', 'inside'], // Require or disallow Yoda conditions - 'yoda': ['error', 'never'], + yoda: ['error', 'never'], }; diff --git a/lib/config/rules/import.js b/lib/config/rules/import.js index f81991e2..dc363f14 100644 --- a/lib/config/rules/import.js +++ b/lib/config/rules/import.js @@ -61,12 +61,12 @@ module.exports = { // Ensure consistent use of file extension within the import path 'import/extensions': ['error', {js: 'never', json: 'always'}], // Enforce a convention in module import order - 'import/order': ['error', { - groups: [ - ['builtin', 'external'], - ['internal', 'parent', 'sibling'], - ], - }], + 'import/order': [ + 'error', + { + groups: [['builtin', 'external'], ['internal', 'parent', 'sibling']], + }, + ], // Enforce a newline after import statements 'import/newline-after-import': 'error', // Prefer a default export if module exports a single name diff --git a/lib/config/rules/stylistic-issues.js b/lib/config/rules/stylistic-issues.js index 1d035576..e205d80c 100755 --- a/lib/config/rules/stylistic-issues.js +++ b/lib/config/rules/stylistic-issues.js @@ -38,11 +38,14 @@ module.exports = { // Blacklist certain identifiers to prevent them being used 'id-blacklist': 'off', // This option enforces minimum and maximum identifier lengths (variable names, property names etc.) - 'id-length': ['error', { - min: 2, - properties: 'always', - exceptions: ['x', 'y', 'i', 'j', 't', '_', '$'], - }], + 'id-length': [ + 'error', + { + min: 2, + properties: 'always', + exceptions: ['x', 'y', 'i', 'j', 't', '_', '$'], + }, + ], // Require identifiers to match the provided regular expression 'id-match': 'off', // Disable eslint v4 stricter indent rules @@ -130,7 +133,11 @@ module.exports = { // Require assignment operator shorthand where possible or prohibit it entirely 'operator-assignment': ['error', 'always'], // Enforce operators to be placed before or after line breaks - 'operator-linebreak': ['error', 'after', {overrides: {'?': 'before', ':': 'before'}}], + 'operator-linebreak': [ + 'error', + 'after', + {overrides: {'?': 'before', ':': 'before'}}, + ], // Enforce padding within blocks 'padded-blocks': 'off', // require or disallow padding lines between statements @@ -142,7 +149,7 @@ module.exports = { // Require quotes around object literal property names 'quote-props': ['error', 'as-needed'], // Specify whether backticks, double or single quotes should be used - 'quotes': ['error', 'single', 'avoid-escape'], + quotes: ['error', 'single', 'avoid-escape'], // Require JSDoc comments 'require-jsdoc': 'off', // Enforce spacing before and after semicolons @@ -150,7 +157,7 @@ module.exports = { // enforce location of semicolons 'semi-style': ['error', 'last'], // Require or disallow use of semicolons instead of ASI - 'semi': ['error', 'always'], + semi: ['error', 'always'], // Requires object keys to be sorted 'sort-keys': 'off', // Sort variables within the same declaration block