From a9229121a603f4d75aaac94b58ed13ac65dddfb5 Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Wed, 24 May 2017 13:53:17 -0700 Subject: [PATCH 01/39] Add in initial package.json --- package.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 package.json diff --git a/package.json b/package.json new file mode 100644 index 0000000..80ac0ee --- /dev/null +++ b/package.json @@ -0,0 +1,19 @@ +{ + "name": "eslint-config-products", + "version": "0.0.1", + "description": "Products eslint config", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/moderntribe/eslint-config-products.git" + }, + "author": "", + "license": "GPL-2.0", + "bugs": { + "url": "https://github.com/moderntribe/eslint-config-products/issues" + }, + "homepage": "https://github.com/moderntribe/eslint-config-products#readme" +} From df65dd4c2fff2337eb7941a70b32450895b05936 Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Wed, 24 May 2017 13:58:56 -0700 Subject: [PATCH 02/39] Add in gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fd4f2b0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules +.DS_Store From 596fcca8998d7b731d1a19ac0d25fb18f79905b5 Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Wed, 24 May 2017 14:09:05 -0700 Subject: [PATCH 03/39] Add in eslint wordpress config --- package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 80ac0ee..8a2e827 100644 --- a/package.json +++ b/package.json @@ -15,5 +15,8 @@ "bugs": { "url": "https://github.com/moderntribe/eslint-config-products/issues" }, - "homepage": "https://github.com/moderntribe/eslint-config-products#readme" + "homepage": "https://github.com/moderntribe/eslint-config-products#readme", + "devDependencies": { + "eslint-config-wordpress": "^1.1.0" + } } From 26ecc75fef07da9c86afb4d2dcbd62ba54c39bcf Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Wed, 24 May 2017 14:09:40 -0700 Subject: [PATCH 04/39] Add in linter defaults --- index.js | 1 + lib/defaults.js | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 index.js create mode 100644 lib/defaults.js diff --git a/index.js b/index.js new file mode 100644 index 0000000..f33398d --- /dev/null +++ b/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/defaults.js'); \ No newline at end of file diff --git a/lib/defaults.js b/lib/defaults.js new file mode 100644 index 0000000..7de19eb --- /dev/null +++ b/lib/defaults.js @@ -0,0 +1,6 @@ +module.exports = { + "extends": [ + "eslint:recommended", + "wordpress" + ] +}; From ccec19ff098f30cae7ea15bf0ee812c45ce9cf72 Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Wed, 24 May 2017 14:35:38 -0700 Subject: [PATCH 05/39] Change wordpress eslint config to dependency --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8a2e827..419d3e7 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "url": "https://github.com/moderntribe/eslint-config-products/issues" }, "homepage": "https://github.com/moderntribe/eslint-config-products#readme", - "devDependencies": { + "dependencies": { "eslint-config-wordpress": "^1.1.0" } } From 7846c3e6ea874a9bbe4c8bcb1ea1e0da4ee3341d Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Wed, 24 May 2017 15:13:09 -0700 Subject: [PATCH 06/39] Add in default rules --- lib/defaults.js | 9 ++- lib/rules/index.js | 179 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 184 insertions(+), 4 deletions(-) create mode 100644 lib/rules/index.js diff --git a/lib/defaults.js b/lib/defaults.js index 7de19eb..533b4f2 100644 --- a/lib/defaults.js +++ b/lib/defaults.js @@ -1,6 +1,7 @@ module.exports = { - "extends": [ - "eslint:recommended", - "wordpress" - ] + extends: [ + 'eslint:recommended', + 'wordpress' + ], + rules: require('./rules') }; diff --git a/lib/rules/index.js b/lib/rules/index.js new file mode 100644 index 0000000..4fff2b3 --- /dev/null +++ b/lib/rules/index.js @@ -0,0 +1,179 @@ +// From: https://gist.github.com/cletusw/e01a85e399ab563b1236 + +module.exports = { + ////////// Possible Errors ////////// + + // 'no-comma-dangle': 0, // disallow trailing commas in object literals + // 'no-cond-assign': 0, // disallow assignment in conditional expressions + 'no-console': 1, // disallow use of console (off by default in the node environment) + // 'no-constant-condition': 0, // disallow use of constant expressions in conditions + // 'no-control-regex': 0, // disallow control characters in regular expressions + 'no-debugger': 2, // disallow use of debugger + // 'no-dupe-keys': 0, // disallow duplicate keys when creating object literals + // 'no-empty': 0, // disallow empty statements + // 'no-empty-class': 0, // disallow the use of empty character classes in regular expressions + // 'no-ex-assign': 0, // disallow assigning to the exception in a catch block + // 'no-extra-boolean-cast': 0, // disallow double-negation boolean casts in a boolean context + // 'no-extra-parens': 0, // disallow unnecessary parentheses (off by default) + // 'no-extra-semi': 0, // disallow unnecessary semicolons + // 'no-func-assign': 0, // disallow overwriting functions written as function declarations + // 'no-inner-declarations': 0, // disallow function or variable declarations in nested blocks + // 'no-invalid-regexp': 0, // disallow invalid regular expression strings in the RegExp constructor + // 'no-irregular-whitespace': 0, // disallow irregular whitespace outside of strings and comments + // 'no-negated-in-lhs': 0, // disallow negation of the left operand of an in expression + // 'no-obj-calls': 0, // disallow the use of object properties of the global object (Math and JSON) as functions + // 'no-regex-spaces': 0, // disallow multiple spaces in a regular expression literal + // 'no-reserved-keys': 0, // disallow reserved words being used as object literal keys (off by default) + // 'no-sparse-arrays': 0, // disallow sparse arrays + // 'no-unreachable': 0, // disallow unreachable statements after a return, throw, continue, or break statement + // 'use-isnan': 0, // disallow comparisons with the value NaN + // 'valid-jsdoc': 0, // Ensure JSDoc comments are valid (off by default) + // 'valid-typeof': 0, // Ensure that the results of typeof are compared against a valid string + + ////////// Best Practices ////////// + + // 'block-scoped-var': 0, // treat var statements as if they were block scoped (off by default) + // complexity: 0, // specify the maximum cyclomatic complexity allowed in a program (off by default) + // 'consistent-return': 0, // require return statements to either always or never specify values + // curly: 0, // specify curly brace conventions for all control statements + // 'default-case': 0, // require default case in switch statements (off by default) + // 'dot-notation': 0, // encourages use of dot notation whenever possible + // eqeqeq: 0, // require the use of === and !== + // 'guard-for-in': 0, // make sure for-in loops have an if statement (off by default) + 'no-alert': 1, // disallow the use of alert, confirm, and prompt + // 'no-caller': 0, // disallow use of arguments.caller or arguments.callee + // 'no-div-regex': 0, // disallow division operators explicitly at beginning of regular expression (off by default) + // 'no-else-return': 0, // disallow else after a return in an if (off by default) + // 'no-empty-label': 0, // disallow use of labels for anything other then loops and switches + // 'no-eq-null': 0, // disallow comparisons to null without a type-checking operator (off by default) + // 'no-eval': 0, // disallow use of eval() + // 'no-extend-native': 0, // disallow adding to native types + // 'no-extra-bind': 0, // disallow unnecessary function binding + // 'no-fallthrough': 0, // disallow fallthrough of case statements + // 'no-floating-decimal': 0, // disallow the use of leading or trailing decimal points in numeric literals (off by default) + // 'no-implied-eval': 0, // disallow use of eval()-like methods + // 'no-iterator': 0, // disallow usage of __iterator__ property + // 'no-labels': 0, // disallow use of labeled statements + // 'no-lone-blocks': 0, // disallow unnecessary nested blocks + // 'no-loop-func': 0, // disallow creation of functions within loops + // 'no-multi-spaces': 0, // disallow use of multiple spaces + // 'no-multi-str': 0, // disallow use of multiline strings + // 'no-native-reassign': 0, // disallow reassignments of native objects + // 'no-new': 0, // disallow use of new operator when not part of the assignment or comparison + // 'no-new-func': 0, // disallow use of new operator for Function object + // 'no-new-wrappers': 0, // disallows creating new instances of String, Number, and Boolean + // 'no-octal': 0, // disallow use of octal literals + // 'no-octal-escape': 0, // disallow use of octal escape sequences in string literals, such as var foo = "Copyright \251"; + // 'no-process-env': 0, // disallow use of process.env (off by default) + // 'no-proto': 0, // disallow usage of __proto__ property + // 'no-redeclare': 0, // disallow declaring the same variable more then once + // 'no-return-assign': 0, // disallow use of assignment in return statement + // 'no-script-url': 0, // disallow use of javascript: urls. + // 'no-self-compare': 0, // disallow comparisons where both sides are exactly the same (off by default) + // 'no-sequences': 0, // disallow use of comma operator + // 'no-unused-expressions': 0, // disallow usage of expressions in statement position + // 'no-void': 0, // disallow use of void operator (off by default) + // 'no-warning-comments': 0, // disallow usage of configurable warning terms in comments, e.g. TODO or FIXME (off by default) + // 'no-with': 0, // disallow use of the with statement + // radix: 0, // require use of the second argument for parseInt() (off by default) + // 'vars-on-top': 0, // requires to declare all vars on top of their containing scope (off by default) + // 'wrap-iife': 0, // require immediate function invocation to be wrapped in parentheses (off by default) + // yoda: [ 2, 'never' ], // require or disallow Yoda conditions + + ////////// Strict Mode ////////// + + // 'global-strict': 0, // (deprecated) require or disallow the "use strict" pragma in the global scope (off by default in the node environment) + // 'no-extra-strict': 0, // (deprecated) disallow unnecessary use of "use strict"; when already in strict mode + // strict: [ 1, 'global' ], // controls location of Use Strict Directives + + ////////// Variables ////////// + + // 'no-catch-shadow': 0, // disallow the catch clause parameter name being the same as a variable in the outer scope (off by default in the node environment) + // 'no-delete-var': 0, // disallow deletion of variables + // 'no-label-var': 0, // disallow labels that share a name with a variable + 'no-shadow': 2, // disallow declaration of variables already declared in the outer scope + // 'no-shadow-restricted-names': 0, // disallow shadowing of names such as arguments + // 'no-undef': 0, // disallow use of undeclared variables unless mentioned in a /*global */ block + // 'no-undef-init': 0, // disallow use of undefined when initializing variables + // 'no-undefined': 0, // disallow use of undefined variable (off by default) + 'no-unused-vars': 2, // disallow declaration of variables that are not used in the code + 'no-use-before-define': [ + 2, 'nofunc' + ], // disallow use of variables before they are defined + + ////////// Node.js ////////// + + // 'handle-callback-err': 0, // enforces error handling in callbacks (off by default) (on by default in the node environment) + // 'no-mixed-requires': 1, // disallow mixing regular variable and require declarations (off by default) (on by default in the node environment) + // 'no-new-require': 0, // disallow use of new operator with the require function (off by default) (on by default in the node environment) + // 'no-path-concat': 0, // disallow string concatenation with __dirname and __filename (off by default) (on by default in the node environment) + // 'no-process-exit': 0, // disallow process.exit() (on by default in the node environment) + // 'no-restricted-modules': 0, // restrict usage of specified node modules (off by default) + // 'no-sync': 0, // disallow use of synchronous methods (off by default) + + ////////// Stylistic Issues ////////// + + // 'brace-style': 0, // enforce one true brace style (off by default) + camelcase: 2, // require camel case names + // 'comma-spacing': 0, // enforce spacing before and after comma + // 'comma-style': 0, // enforce one true comma style (off by default) + // 'consistent-this': 0, // enforces consistent naming when capturing the current execution context (off by default) + // 'eol-last': 0, // enforce newline at the end of file, with no multiple empty lines + // 'func-names': 0, // require function expressions to have a name (off by default) + // 'func-style': 0, // enforces use of function declarations or expressions (off by default) + // 'key-spacing': 0, // enforces spacing between keys and values in object literal properties + // 'max-nested-callbacks': 0, // specify the maximum depth callbacks can be nested (off by default) + // 'new-cap': 0, // require a capital letter for constructors + // 'new-parens': 0, // disallow the omission of parentheses when invoking a constructor with no arguments + // 'no-array-constructor': 0, // disallow use of the Array constructor + // 'no-inline-comments': 0, // disallow comments inline after code (off by default) + // 'no-lonely-if': 0, // disallow if as the only statement in an else block (off by default) + // 'no-mixed-spaces-and-tabs': 0, // disallow mixed spaces and tabs for indentation + // 'no-multiple-empty-lines': 0, // disallow multiple empty lines (off by default) + // 'no-nested-ternary': 0, // disallow nested ternary expressions (off by default) + // 'no-new-object': 0, // disallow use of the Object constructor + // 'no-space-before-semi': 0, // disallow space before semicolon + // 'no-spaced-func': 0, // disallow space between function identifier and application + // 'no-ternary': 0, // disallow the use of ternary operators (off by default) + // 'no-trailing-spaces': 0, // disallow trailing whitespace at the end of lines + // 'no-underscore-dangle': 0, // disallow dangling underscores in identifiers + // 'no-wrap-func': 0, // disallow wrapping of non-IIFE statements in parens + // 'one-var': 0, // allow just one var statement per function (off by default) + // 'operator-assignment': 0, // require assignment operator shorthand where possible or prohibit it entirely (off by default) + // 'padded-blocks': 0, // enforce padding within blocks (off by default) + // 'quote-props': 0, // require quotes around object literal property names (off by default) + quotes: [ + 2, + 'single', { + allowTemplateLiterals: true + } + ], // specify whether double or single quotes should be used + semi: [ + 2, 'always' + ], // require or disallow use of semicolons instead of ASI + // 'sort-vars': 0, // sort variables within the same declaration block (off by default) + // 'space-after-function-name': 0, // require a space after function names (off by default) + // 'space-after-keywords': 0, // require a space after certain keywords (off by default) + // 'space-before-blocks': 0, // require or disallow space before blocks (off by default) + // 'space-in-brackets': 0, // require or disallow spaces inside brackets (off by default) + // 'space-in-parens': 0, // require or disallow spaces inside parentheses (off by default) + // 'space-infix-ops': 0, // require spaces around operators + // 'space-return-throw-case': 0, // require a space after return, throw, and case + // 'space-unary-ops': 0, // Require or disallow spaces before/after unary operators (words on by default, nonwords off by default) + // 'spaced-line-comment': 0, // require or disallow a space immediately following the // in a line comment (off by default) + // 'wrap-regex': 0, // require regex literals to be wrapped in parentheses (off by default) + + ////////// ECMAScript 6 ////////// + + // 'no-var': 0, // require let or const instead of var (off by default) + // 'generator-star': 0, // enforce the position of the * in generator functions (off by default) + + ////////// Legacy ////////// + + // 'max-depth': 0, // specify the maximum depth that blocks can be nested (off by default) + // 'max-len': 0, // specify the maximum length of a line in your program (off by default) + // 'max-params': 0, // limits the number of parameters that can be used in the function declaration. (off by default) + // 'max-statements': 0, // specify the maximum number of statement allowed in a function (off by default) + // 'no-bitwise': 0, // disallow use of bitwise operators (off by default) + // 'no-plusplus': 0, // disallow use of unary operators, ++ and -- (off by default) +}; \ No newline at end of file From 36f1ca5345b2fd755d8c946c0ef7c570f5e7d297 Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Wed, 24 May 2017 16:03:17 -0700 Subject: [PATCH 07/39] Update deprecated spacing rules --- lib/rules/index.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/rules/index.js b/lib/rules/index.js index 4fff2b3..136db0d 100644 --- a/lib/rules/index.js +++ b/lib/rules/index.js @@ -152,15 +152,12 @@ module.exports = { 2, 'always' ], // require or disallow use of semicolons instead of ASI // 'sort-vars': 0, // sort variables within the same declaration block (off by default) - // 'space-after-function-name': 0, // require a space after function names (off by default) - // 'space-after-keywords': 0, // require a space after certain keywords (off by default) - // 'space-before-blocks': 0, // require or disallow space before blocks (off by default) - // 'space-in-brackets': 0, // require or disallow spaces inside brackets (off by default) - // 'space-in-parens': 0, // require or disallow spaces inside parentheses (off by default) - // 'space-infix-ops': 0, // require spaces around operators - // 'space-return-throw-case': 0, // require a space after return, throw, and case - // 'space-unary-ops': 0, // Require or disallow spaces before/after unary operators (words on by default, nonwords off by default) - // 'spaced-line-comment': 0, // require or disallow a space immediately following the // in a line comment (off by default) + // 'space-before-blocks': 2, // enforce consistent spacing before blocks + // 'space-before-function-paren': 2, // enforce consistent spacing before function definition opening parenthesis + // 'space-in-parens': 2, // enforce consistent spacing inside parentheses + // 'space-infix-ops': 0, // require spacing around infix operators + // 'space-unary-ops': 0, // enforce consistent spacing before or after unary operators + // 'spaced-comment': 0, // enforce consistent spacing after the // or /* in a comment // 'wrap-regex': 0, // require regex literals to be wrapped in parentheses (off by default) ////////// ECMAScript 6 ////////// From f62f4ea7e29eafd3570ba3db0415cc9a057d785a Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Wed, 24 May 2017 16:04:00 -0700 Subject: [PATCH 08/39] Update deprecated semicolon spacing rules --- lib/rules/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rules/index.js b/lib/rules/index.js index 136db0d..af5f559 100644 --- a/lib/rules/index.js +++ b/lib/rules/index.js @@ -132,7 +132,6 @@ module.exports = { // 'no-multiple-empty-lines': 0, // disallow multiple empty lines (off by default) // 'no-nested-ternary': 0, // disallow nested ternary expressions (off by default) // 'no-new-object': 0, // disallow use of the Object constructor - // 'no-space-before-semi': 0, // disallow space before semicolon // 'no-spaced-func': 0, // disallow space between function identifier and application // 'no-ternary': 0, // disallow the use of ternary operators (off by default) // 'no-trailing-spaces': 0, // disallow trailing whitespace at the end of lines @@ -151,6 +150,7 @@ module.exports = { semi: [ 2, 'always' ], // require or disallow use of semicolons instead of ASI + // 'semi-spacing': 0, // Enforce spacing before and after semicolons // 'sort-vars': 0, // sort variables within the same declaration block (off by default) // 'space-before-blocks': 2, // enforce consistent spacing before blocks // 'space-before-function-paren': 2, // enforce consistent spacing before function definition opening parenthesis From 6d6e9210e9c09d7b0b583741cef3c1619aa6947d Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Wed, 24 May 2017 18:56:31 -0700 Subject: [PATCH 09/39] Replace wordpress config with wpcalypso --- lib/defaults.js | 2 +- package.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/defaults.js b/lib/defaults.js index 533b4f2..712770f 100644 --- a/lib/defaults.js +++ b/lib/defaults.js @@ -1,7 +1,7 @@ module.exports = { extends: [ 'eslint:recommended', - 'wordpress' + 'wpcalypso' ], rules: require('./rules') }; diff --git a/package.json b/package.json index 419d3e7..7d20b41 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ }, "homepage": "https://github.com/moderntribe/eslint-config-products#readme", "dependencies": { - "eslint-config-wordpress": "^1.1.0" + "eslint-config-wpcalypso": "^0.8.0", + "eslint-plugin-wpcalypso": "^3.2.0" } } From 632d82cb36993036861bc06febc823c12842c0ec Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Wed, 24 May 2017 19:06:10 -0700 Subject: [PATCH 10/39] Add in react and jsx ally optional dependencies --- package.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package.json b/package.json index 7d20b41..7210cc8 100644 --- a/package.json +++ b/package.json @@ -19,5 +19,9 @@ "dependencies": { "eslint-config-wpcalypso": "^0.8.0", "eslint-plugin-wpcalypso": "^3.2.0" + }, + "optionalDependencies": { + "eslint-plugin-jsx-a11y": "^5.0.3", + "eslint-plugin-react": "^7.0.1" } } From e396102916e573e07c546c94ef453b8016fa8ed0 Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Wed, 24 May 2017 19:14:33 -0700 Subject: [PATCH 11/39] Add eslint as a peer dependency --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 7210cc8..944485a 100644 --- a/package.json +++ b/package.json @@ -23,5 +23,8 @@ "optionalDependencies": { "eslint-plugin-jsx-a11y": "^5.0.3", "eslint-plugin-react": "^7.0.1" + }, + "peerDependencies": { + "eslint": "^3.19.0" } } From 7b31ffaaeef3ca43a67a5a65506b4793e72ea6f3 Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Wed, 24 May 2017 20:32:14 -0700 Subject: [PATCH 12/39] Add in react eslint config --- react/index.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 react/index.js diff --git a/react/index.js b/react/index.js new file mode 100644 index 0000000..28af00a --- /dev/null +++ b/react/index.js @@ -0,0 +1,18 @@ +module.exports = { + env: { + node: true, + browser: true + }, + extends: [ + 'products/lib/defaults', + 'wpcalypso/react-a11y' + ], + rules: { + 'react/jsx-filename-extension': 0, + 'react/jsx-indent-props': [2, 4], + 'react/jsx-indent': [2, 4], + 'react/jsx-uses-vars': 1, + 'react/prop-types': 1, + 'react/react-in-jsx-scope': 1 + } +}; \ No newline at end of file From 5334724556d379f0f1cf46a2411286a38c77065c Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Wed, 24 May 2017 20:38:23 -0700 Subject: [PATCH 13/39] Update README --- README.md | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a7f1941..865180e 100644 --- a/README.md +++ b/README.md @@ -1 +1,41 @@ -# products-eslint-config \ No newline at end of file +# Products Eslint Config +--- + +## Dependencies + +* `eslint 3.19.0+` + +## Installation + +```sh +npm install --save-dev github:moderntribe/eslint-config-products + +# Target branch or release: +# npm install --save-dev github:moderntribe/eslint-config-products#branch-name +``` + +### Add .eslintrc file + +In the root directory, add in an `.eslintrc` file. + +```js +{ + extends: 'products' +} +``` + +## Using React eslint config + +Update `.eslintrc` to: + +```js +{ + extends: 'products/react' +} +``` + +### Add in react config dependencies + +```sh +npm install --save-dev eslint-plugin-react eslint-plugin-jsx-a11y +``` \ No newline at end of file From a53ddf07f07a2ee666c948d8bc0b7d74e094c23b Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Thu, 25 May 2017 09:36:00 -0700 Subject: [PATCH 14/39] Update react config to use latest jsx-a11y rules --- react/index.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/react/index.js b/react/index.js index 28af00a..9ba9581 100644 --- a/react/index.js +++ b/react/index.js @@ -13,6 +13,16 @@ module.exports = { 'react/jsx-indent': [2, 4], 'react/jsx-uses-vars': 1, 'react/prop-types': 1, - 'react/react-in-jsx-scope': 1 + 'react/react-in-jsx-scope': 1, + + 'jsx-a11y/alt-text': 2, + 'jsx-a11y/no-static-element-interactions': 2, + 'jsx-a11y/no-noninteractive-element-interactions': 2, + 'jsx-a11y/interactive-supports-focus': 2, + + // Removed in v5 + 'jsx-a11y/img-has-alt': 0, + 'jsx-a11y/onclick-has-focus': 0, + 'jsx-a11y/onclick-has-role': 0 } -}; \ No newline at end of file +}; From f5913d07077efdf0fce054bfaaafb6d8cd8f3173 Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Thu, 25 May 2017 09:36:14 -0700 Subject: [PATCH 15/39] Add eslintignore file --- .eslintignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .eslintignore diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..180bef0 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +node_modules/ +lib/ +react/ From 35cc912a4334730a2e301ceaf9cc11668c252c5a Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Thu, 25 May 2017 09:49:43 -0700 Subject: [PATCH 16/39] Update README to exclude react config dependencies - they're added by default --- README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.md b/README.md index 865180e..bff1915 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ # Products Eslint Config ---- ## Dependencies @@ -33,9 +32,3 @@ Update `.eslintrc` to: extends: 'products/react' } ``` - -### Add in react config dependencies - -```sh -npm install --save-dev eslint-plugin-react eslint-plugin-jsx-a11y -``` \ No newline at end of file From 6ef878d3d8a9c1f475f49c6f3db456e2c306073b Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Thu, 25 May 2017 10:30:27 -0700 Subject: [PATCH 17/39] Update jsx indents to use tabs --- react/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/react/index.js b/react/index.js index 9ba9581..9515fbd 100644 --- a/react/index.js +++ b/react/index.js @@ -9,8 +9,8 @@ module.exports = { ], rules: { 'react/jsx-filename-extension': 0, - 'react/jsx-indent-props': [2, 4], - 'react/jsx-indent': [2, 4], + 'react/jsx-indent-props': [2, 'tab'], + 'react/jsx-indent': [2, 'tab'], 'react/jsx-uses-vars': 1, 'react/prop-types': 1, 'react/react-in-jsx-scope': 1, From 62009a4dec83bf92f80d7a0dd4a434ca84d64338 Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Thu, 25 May 2017 10:38:48 -0700 Subject: [PATCH 18/39] Update README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index bff1915..e29387a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Products Eslint Config +Custom config that extends [wpcalypso](https://github.com/Automattic/eslint-config-wpcalypso). + ## Dependencies * `eslint 3.19.0+` From 98961ef5d4c0e77d9f58f73ab8faa5e0057dc294 Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Fri, 26 May 2017 11:48:25 -0700 Subject: [PATCH 19/39] Update no-empty-class to no-empty-character-class. Enable to error out --- lib/rules/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rules/index.js b/lib/rules/index.js index af5f559..2a00849 100644 --- a/lib/rules/index.js +++ b/lib/rules/index.js @@ -11,7 +11,7 @@ module.exports = { 'no-debugger': 2, // disallow use of debugger // 'no-dupe-keys': 0, // disallow duplicate keys when creating object literals // 'no-empty': 0, // disallow empty statements - // 'no-empty-class': 0, // disallow the use of empty character classes in regular expressions + 'no-empty-character-class': 2,// disallow the use of empty character classes in regular expressions // 'no-ex-assign': 0, // disallow assigning to the exception in a catch block // 'no-extra-boolean-cast': 0, // disallow double-negation boolean casts in a boolean context // 'no-extra-parens': 0, // disallow unnecessary parentheses (off by default) From df85b419db235c5e51f5ec4aee76133da80dc60a Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Fri, 26 May 2017 11:50:14 -0700 Subject: [PATCH 20/39] Update to enable no extra semicolons --- lib/rules/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rules/index.js b/lib/rules/index.js index 2a00849..96708ec 100644 --- a/lib/rules/index.js +++ b/lib/rules/index.js @@ -15,7 +15,7 @@ module.exports = { // 'no-ex-assign': 0, // disallow assigning to the exception in a catch block // 'no-extra-boolean-cast': 0, // disallow double-negation boolean casts in a boolean context // 'no-extra-parens': 0, // disallow unnecessary parentheses (off by default) - // 'no-extra-semi': 0, // disallow unnecessary semicolons + 'no-extra-semi': 2, // disallow unnecessary semicolons // 'no-func-assign': 0, // disallow overwriting functions written as function declarations // 'no-inner-declarations': 0, // disallow function or variable declarations in nested blocks // 'no-invalid-regexp': 0, // disallow invalid regular expression strings in the RegExp constructor From 0e8b71bcab8ef9ec41bf75f06e870be801746c21 Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Fri, 26 May 2017 11:51:39 -0700 Subject: [PATCH 21/39] Update to disallow function overwriting --- lib/rules/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rules/index.js b/lib/rules/index.js index 96708ec..9914695 100644 --- a/lib/rules/index.js +++ b/lib/rules/index.js @@ -16,7 +16,7 @@ module.exports = { // 'no-extra-boolean-cast': 0, // disallow double-negation boolean casts in a boolean context // 'no-extra-parens': 0, // disallow unnecessary parentheses (off by default) 'no-extra-semi': 2, // disallow unnecessary semicolons - // 'no-func-assign': 0, // disallow overwriting functions written as function declarations + 'no-func-assign': 2, // disallow overwriting functions written as function declarations // 'no-inner-declarations': 0, // disallow function or variable declarations in nested blocks // 'no-invalid-regexp': 0, // disallow invalid regular expression strings in the RegExp constructor // 'no-irregular-whitespace': 0, // disallow irregular whitespace outside of strings and comments From c08d60720649f3115269868261dfdbf0b538580b Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Fri, 26 May 2017 11:52:45 -0700 Subject: [PATCH 22/39] Update to disallow invalid regular expressions --- lib/rules/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rules/index.js b/lib/rules/index.js index 9914695..5848cf6 100644 --- a/lib/rules/index.js +++ b/lib/rules/index.js @@ -18,7 +18,7 @@ module.exports = { 'no-extra-semi': 2, // disallow unnecessary semicolons 'no-func-assign': 2, // disallow overwriting functions written as function declarations // 'no-inner-declarations': 0, // disallow function or variable declarations in nested blocks - // 'no-invalid-regexp': 0, // disallow invalid regular expression strings in the RegExp constructor + 'no-invalid-regexp': 2, // disallow invalid regular expression strings in the RegExp constructor // 'no-irregular-whitespace': 0, // disallow irregular whitespace outside of strings and comments // 'no-negated-in-lhs': 0, // disallow negation of the left operand of an in expression // 'no-obj-calls': 0, // disallow the use of object properties of the global object (Math and JSON) as functions From e3b2d00ccbf33e5b4eac71c5746c0cfab7b3aa9a Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Fri, 26 May 2017 11:53:30 -0700 Subject: [PATCH 23/39] Update to disallow sparse arrays --- lib/rules/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rules/index.js b/lib/rules/index.js index 5848cf6..9a4655c 100644 --- a/lib/rules/index.js +++ b/lib/rules/index.js @@ -24,7 +24,7 @@ module.exports = { // 'no-obj-calls': 0, // disallow the use of object properties of the global object (Math and JSON) as functions // 'no-regex-spaces': 0, // disallow multiple spaces in a regular expression literal // 'no-reserved-keys': 0, // disallow reserved words being used as object literal keys (off by default) - // 'no-sparse-arrays': 0, // disallow sparse arrays + 'no-sparse-arrays': 2, // disallow sparse arrays // 'no-unreachable': 0, // disallow unreachable statements after a return, throw, continue, or break statement // 'use-isnan': 0, // disallow comparisons with the value NaN // 'valid-jsdoc': 0, // Ensure JSDoc comments are valid (off by default) From 81e5402533fc2d709f9eef59f20b44683501c859 Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Fri, 26 May 2017 11:56:01 -0700 Subject: [PATCH 24/39] Update to disallow unnecessary escapes --- lib/rules/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/rules/index.js b/lib/rules/index.js index 9a4655c..ba92559 100644 --- a/lib/rules/index.js +++ b/lib/rules/index.js @@ -72,6 +72,7 @@ module.exports = { // 'no-self-compare': 0, // disallow comparisons where both sides are exactly the same (off by default) // 'no-sequences': 0, // disallow use of comma operator // 'no-unused-expressions': 0, // disallow usage of expressions in statement position + 'no-useless-escape': 2, // disallow unnecessary escape usage // 'no-void': 0, // disallow use of void operator (off by default) // 'no-warning-comments': 0, // disallow usage of configurable warning terms in comments, e.g. TODO or FIXME (off by default) // 'no-with': 0, // disallow use of the with statement From 841164ee64adec3785df1ceb4d9c8aefe11862aa Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Fri, 26 May 2017 12:00:40 -0700 Subject: [PATCH 25/39] Update to disallow reassignment of function parameters --- lib/rules/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/rules/index.js b/lib/rules/index.js index ba92559..76e8ff8 100644 --- a/lib/rules/index.js +++ b/lib/rules/index.js @@ -64,6 +64,10 @@ module.exports = { // 'no-new-wrappers': 0, // disallows creating new instances of String, Number, and Boolean // 'no-octal': 0, // disallow use of octal literals // 'no-octal-escape': 0, // disallow use of octal escape sequences in string literals, such as var foo = "Copyright \251"; + 'no-param-reassign': [ + 2, + {"props": false} + ], // disallow Reassignment of Function Parameters // 'no-process-env': 0, // disallow use of process.env (off by default) // 'no-proto': 0, // disallow usage of __proto__ property // 'no-redeclare': 0, // disallow declaring the same variable more then once From 612e3e64e8c22d9fe7025a4d47fd8d8688781731 Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Fri, 26 May 2017 12:02:41 -0700 Subject: [PATCH 26/39] Update to enforce unix line endings --- lib/rules/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/rules/index.js b/lib/rules/index.js index 76e8ff8..65091ca 100644 --- a/lib/rules/index.js +++ b/lib/rules/index.js @@ -127,6 +127,7 @@ module.exports = { // 'func-names': 0, // require function expressions to have a name (off by default) // 'func-style': 0, // enforces use of function declarations or expressions (off by default) // 'key-spacing': 0, // enforces spacing between keys and values in object literal properties + 'linebreak-style': [2, 'unix'] // enforce consistent linebreak style // 'max-nested-callbacks': 0, // specify the maximum depth callbacks can be nested (off by default) // 'new-cap': 0, // require a capital letter for constructors // 'new-parens': 0, // disallow the omission of parentheses when invoking a constructor with no arguments From 4991d2294ac2f2fcbc2a3eeacf3fffa8a381ef21 Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Fri, 26 May 2017 15:40:25 -0700 Subject: [PATCH 27/39] Update to enable block scoped vars --- lib/rules/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rules/index.js b/lib/rules/index.js index 65091ca..69c88d7 100644 --- a/lib/rules/index.js +++ b/lib/rules/index.js @@ -32,7 +32,7 @@ module.exports = { ////////// Best Practices ////////// - // 'block-scoped-var': 0, // treat var statements as if they were block scoped (off by default) + 'block-scoped-var': 2, // treat var statements as if they were block scoped (off by default) // complexity: 0, // specify the maximum cyclomatic complexity allowed in a program (off by default) // 'consistent-return': 0, // require return statements to either always or never specify values // curly: 0, // specify curly brace conventions for all control statements From b15a383882461b29676080e343cbecd12fd81b57 Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Fri, 26 May 2017 15:41:48 -0700 Subject: [PATCH 28/39] Update to enable strict equality --- lib/rules/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rules/index.js b/lib/rules/index.js index 69c88d7..83a2984 100644 --- a/lib/rules/index.js +++ b/lib/rules/index.js @@ -38,7 +38,7 @@ module.exports = { // curly: 0, // specify curly brace conventions for all control statements // 'default-case': 0, // require default case in switch statements (off by default) // 'dot-notation': 0, // encourages use of dot notation whenever possible - // eqeqeq: 0, // require the use of === and !== + eqeqeq: [2, 'allow-null'], // require the use of === and !== // 'guard-for-in': 0, // make sure for-in loops have an if statement (off by default) 'no-alert': 1, // disallow the use of alert, confirm, and prompt // 'no-caller': 0, // disallow use of arguments.caller or arguments.callee From 22fe2b2e8f4f68d471eb7a783860c80ded2745e9 Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Fri, 26 May 2017 15:41:56 -0700 Subject: [PATCH 29/39] Add a fancy new line --- lib/rules/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rules/index.js b/lib/rules/index.js index 83a2984..9aa0bdb 100644 --- a/lib/rules/index.js +++ b/lib/rules/index.js @@ -179,4 +179,4 @@ module.exports = { // 'max-statements': 0, // specify the maximum number of statement allowed in a function (off by default) // 'no-bitwise': 0, // disallow use of bitwise operators (off by default) // 'no-plusplus': 0, // disallow use of unary operators, ++ and -- (off by default) -}; \ No newline at end of file +}; From 8cf06b3e4d31b5799d6eca4f981f8ebf9758327a Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Fri, 26 May 2017 15:42:40 -0700 Subject: [PATCH 30/39] Update to disallow else statements --- lib/rules/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rules/index.js b/lib/rules/index.js index 9aa0bdb..a69024c 100644 --- a/lib/rules/index.js +++ b/lib/rules/index.js @@ -43,7 +43,7 @@ module.exports = { 'no-alert': 1, // disallow the use of alert, confirm, and prompt // 'no-caller': 0, // disallow use of arguments.caller or arguments.callee // 'no-div-regex': 0, // disallow division operators explicitly at beginning of regular expression (off by default) - // 'no-else-return': 0, // disallow else after a return in an if (off by default) + 'no-else-return': 2, // disallow else after a return in an if (off by default) // 'no-empty-label': 0, // disallow use of labels for anything other then loops and switches // 'no-eq-null': 0, // disallow comparisons to null without a type-checking operator (off by default) // 'no-eval': 0, // disallow use of eval() From 9ed40a4e6989dc2ba59535be8cbdac638d3b91bb Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Fri, 26 May 2017 15:44:49 -0700 Subject: [PATCH 31/39] Update to disallow multiple spaces except on variable declarations --- lib/rules/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/rules/index.js b/lib/rules/index.js index a69024c..ad863bb 100644 --- a/lib/rules/index.js +++ b/lib/rules/index.js @@ -56,7 +56,12 @@ module.exports = { // 'no-labels': 0, // disallow use of labeled statements // 'no-lone-blocks': 0, // disallow unnecessary nested blocks // 'no-loop-func': 0, // disallow creation of functions within loops - // 'no-multi-spaces': 0, // disallow use of multiple spaces + 'no-multi-spaces': [ + 2, + {"exceptions": + {"VariableDeclarator": true} + } + ], // disallow use of multiple spaces // 'no-multi-str': 0, // disallow use of multiline strings // 'no-native-reassign': 0, // disallow reassignments of native objects // 'no-new': 0, // disallow use of new operator when not part of the assignment or comparison From a785ef6b0aad2d6a369913f50451ca0fbac877f7 Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Fri, 26 May 2017 15:46:55 -0700 Subject: [PATCH 32/39] Update to only allow quoted object props when required --- lib/rules/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/rules/index.js b/lib/rules/index.js index ad863bb..bc26029 100644 --- a/lib/rules/index.js +++ b/lib/rules/index.js @@ -151,7 +151,10 @@ module.exports = { // 'one-var': 0, // allow just one var statement per function (off by default) // 'operator-assignment': 0, // require assignment operator shorthand where possible or prohibit it entirely (off by default) // 'padded-blocks': 0, // enforce padding within blocks (off by default) - // 'quote-props': 0, // require quotes around object literal property names (off by default) + 'quote-props': [ + 2, + 'consistent-as-needed' + ], // require quotes around object literal property names (off by default) quotes: [ 2, 'single', { From ce096c5a484aa139f2214006364a236ef43d17ce Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Fri, 26 May 2017 15:48:43 -0700 Subject: [PATCH 33/39] Update to always enable space before blocks --- lib/rules/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rules/index.js b/lib/rules/index.js index bc26029..a7285b1 100644 --- a/lib/rules/index.js +++ b/lib/rules/index.js @@ -166,7 +166,7 @@ module.exports = { ], // require or disallow use of semicolons instead of ASI // 'semi-spacing': 0, // Enforce spacing before and after semicolons // 'sort-vars': 0, // sort variables within the same declaration block (off by default) - // 'space-before-blocks': 2, // enforce consistent spacing before blocks + 'space-before-blocks': 'always', // enforce consistent spacing before blocks // 'space-before-function-paren': 2, // enforce consistent spacing before function definition opening parenthesis // 'space-in-parens': 2, // enforce consistent spacing inside parentheses // 'space-infix-ops': 0, // require spacing around infix operators From d18b80c68a8d4d1fbd5240a9b6a5e3701499eb63 Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Fri, 26 May 2017 15:49:56 -0700 Subject: [PATCH 34/39] Update to not allow space before functions parenthesis --- lib/rules/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rules/index.js b/lib/rules/index.js index a7285b1..ce98899 100644 --- a/lib/rules/index.js +++ b/lib/rules/index.js @@ -167,7 +167,7 @@ module.exports = { // 'semi-spacing': 0, // Enforce spacing before and after semicolons // 'sort-vars': 0, // sort variables within the same declaration block (off by default) 'space-before-blocks': 'always', // enforce consistent spacing before blocks - // 'space-before-function-paren': 2, // enforce consistent spacing before function definition opening parenthesis + 'space-before-function-paren': 'never', // enforce consistent spacing before function definition opening parenthesis // 'space-in-parens': 2, // enforce consistent spacing inside parentheses // 'space-infix-ops': 0, // require spacing around infix operators // 'space-unary-ops': 0, // enforce consistent spacing before or after unary operators From 522ca5f4f6b696ed7114f9e464118754a93f9f9d Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Fri, 26 May 2017 15:53:00 -0700 Subject: [PATCH 35/39] Update to always have spacing in parenthesis --- lib/rules/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rules/index.js b/lib/rules/index.js index ce98899..dae18fe 100644 --- a/lib/rules/index.js +++ b/lib/rules/index.js @@ -168,7 +168,7 @@ module.exports = { // 'sort-vars': 0, // sort variables within the same declaration block (off by default) 'space-before-blocks': 'always', // enforce consistent spacing before blocks 'space-before-function-paren': 'never', // enforce consistent spacing before function definition opening parenthesis - // 'space-in-parens': 2, // enforce consistent spacing inside parentheses + 'space-in-parens': 'always', // enforce consistent spacing inside parentheses // 'space-infix-ops': 0, // require spacing around infix operators // 'space-unary-ops': 0, // enforce consistent spacing before or after unary operators // 'spaced-comment': 0, // enforce consistent spacing after the // or /* in a comment From 83a96510cbd45ae378b2b0e180699a0917c610a9 Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Fri, 26 May 2017 15:55:40 -0700 Subject: [PATCH 36/39] Update to enforce spacing with infix and unary operators --- lib/rules/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/rules/index.js b/lib/rules/index.js index dae18fe..cee6d14 100644 --- a/lib/rules/index.js +++ b/lib/rules/index.js @@ -169,8 +169,14 @@ module.exports = { 'space-before-blocks': 'always', // enforce consistent spacing before blocks 'space-before-function-paren': 'never', // enforce consistent spacing before function definition opening parenthesis 'space-in-parens': 'always', // enforce consistent spacing inside parentheses - // 'space-infix-ops': 0, // require spacing around infix operators - // 'space-unary-ops': 0, // enforce consistent spacing before or after unary operators + 'space-infix-ops': 'always', // require spacing around infix operators + 'space-unary-ops': [ + 2, + { + words: true, + nonwords: false + } + ], // enforce consistent spacing before or after unary operators // 'spaced-comment': 0, // enforce consistent spacing after the // or /* in a comment // 'wrap-regex': 0, // require regex literals to be wrapped in parentheses (off by default) From d50c66a29e29ace7aa3716b919d80422aed53b89 Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Fri, 26 May 2017 16:09:36 -0700 Subject: [PATCH 37/39] Add missing comma --- lib/rules/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rules/index.js b/lib/rules/index.js index cee6d14..af5a7a1 100644 --- a/lib/rules/index.js +++ b/lib/rules/index.js @@ -132,7 +132,7 @@ module.exports = { // 'func-names': 0, // require function expressions to have a name (off by default) // 'func-style': 0, // enforces use of function declarations or expressions (off by default) // 'key-spacing': 0, // enforces spacing between keys and values in object literal properties - 'linebreak-style': [2, 'unix'] // enforce consistent linebreak style + 'linebreak-style': [2, 'unix'], // enforce consistent linebreak style // 'max-nested-callbacks': 0, // specify the maximum depth callbacks can be nested (off by default) // 'new-cap': 0, // require a capital letter for constructors // 'new-parens': 0, // disallow the omission of parentheses when invoking a constructor with no arguments From eb321d46fbaf028086661c375c7b5393608f6d77 Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Fri, 26 May 2017 16:12:22 -0700 Subject: [PATCH 38/39] Fix rules formatting --- lib/rules/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/rules/index.js b/lib/rules/index.js index af5a7a1..032d35b 100644 --- a/lib/rules/index.js +++ b/lib/rules/index.js @@ -166,10 +166,10 @@ module.exports = { ], // require or disallow use of semicolons instead of ASI // 'semi-spacing': 0, // Enforce spacing before and after semicolons // 'sort-vars': 0, // sort variables within the same declaration block (off by default) - 'space-before-blocks': 'always', // enforce consistent spacing before blocks - 'space-before-function-paren': 'never', // enforce consistent spacing before function definition opening parenthesis - 'space-in-parens': 'always', // enforce consistent spacing inside parentheses - 'space-infix-ops': 'always', // require spacing around infix operators + 'space-before-blocks': [2, 'always'], // enforce consistent spacing before blocks + 'space-before-function-paren': [2, 'never'], // enforce consistent spacing before function definition opening parenthesis + 'space-in-parens': [2, 'always'], // enforce consistent spacing inside parentheses + 'space-infix-ops': 2, // require spacing around infix operators 'space-unary-ops': [ 2, { From dd4bc5a90c323b8f8cafbf53b3fddd4d4111ef22 Mon Sep 17 00:00:00 2001 From: Neal Fennimore Date: Fri, 26 May 2017 16:27:31 -0700 Subject: [PATCH 39/39] Fix wpcalypso react config overwriting custom rules --- react/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/react/index.js b/react/index.js index 9515fbd..28d84d7 100644 --- a/react/index.js +++ b/react/index.js @@ -4,8 +4,8 @@ module.exports = { browser: true }, extends: [ - 'products/lib/defaults', - 'wpcalypso/react-a11y' + 'wpcalypso/react-a11y', + '../index.js' ], rules: { 'react/jsx-filename-extension': 0,