From 5fd7c6f08c0650ed67297fc83c8a0590c9a92cc8 Mon Sep 17 00:00:00 2001 From: Estelle Date: Mon, 23 Mar 2015 18:48:19 -0700 Subject: [PATCH 001/302] added naming convention of UPPERCASE names --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 2c6c5c6c7d..1116dcb4ba 100644 --- a/README.md +++ b/README.md @@ -3139,6 +3139,33 @@ Other Style Guides ]; ``` + + - [23.10](#naming--uppercase) Use UPPERCASE for nested object namespacing, global variables, and constants. + + + ```javascript + // bad + const namespace = namespace || {}; + + namespace.util.Widget = { + // ...stuff... + } + + // bad + const apiKey = '44b345234534t455245njkl523452-vbb9'; + + // good + const NAMESPACE = NAMESPACE || {}; + + NAMESPACE.util.Widget = { + // ...stuff... + } + + // good + const API_KEY = '44b345234534t455245njkl523452-vbb9'; + ``` + + **[⬆ back to top](#table-of-contents)** ## Accessors From 5dec8272e03ce792f3c1a5dc8cf94042609e0615 Mon Sep 17 00:00:00 2001 From: koooge Date: Thu, 3 Aug 2017 17:57:58 +0200 Subject: [PATCH 002/302] [eslint config] [base] [breaking] move `comma-dangle` to Stylistic Issues --- packages/eslint-config-airbnb-base/rules/errors.js | 9 --------- packages/eslint-config-airbnb-base/rules/style.js | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/eslint-config-airbnb-base/rules/errors.js b/packages/eslint-config-airbnb-base/rules/errors.js index 02befbb5af..786b88ae1e 100644 --- a/packages/eslint-config-airbnb-base/rules/errors.js +++ b/packages/eslint-config-airbnb-base/rules/errors.js @@ -1,14 +1,5 @@ module.exports = { rules: { - // require trailing commas in multiline object literals - 'comma-dangle': ['error', { - arrays: 'always-multiline', - objects: 'always-multiline', - imports: 'always-multiline', - exports: 'always-multiline', - functions: 'always-multiline', - }], - // Enforce “for” loop update clause moving the counter in the right direction // http://eslint.org/docs/rules/for-direction // TODO: enable, semver-major until v3 is dropped; semver-minor otherwise diff --git a/packages/eslint-config-airbnb-base/rules/style.js b/packages/eslint-config-airbnb-base/rules/style.js index 42e820870e..82ef7018c2 100644 --- a/packages/eslint-config-airbnb-base/rules/style.js +++ b/packages/eslint-config-airbnb-base/rules/style.js @@ -38,6 +38,15 @@ module.exports = { }, }], + // require trailing commas in multiline object literals + 'comma-dangle': ['error', { + arrays: 'always-multiline', + objects: 'always-multiline', + imports: 'always-multiline', + exports: 'always-multiline', + functions: 'always-multiline', + }], + // enforce spacing before and after comma 'comma-spacing': ['error', { before: false, after: true }], From f5cd2869d35268cc158409195b561b28feca5d94 Mon Sep 17 00:00:00 2001 From: David Walsh Date: Tue, 4 Jul 2017 12:40:53 +1000 Subject: [PATCH 003/302] [guide] [eslint config] [base] [breaking] Rules prohibiting global isNaN, isFinite. - Update README with new Standard Library section. --- README.md | 45 ++++++++++++++++++- .../rules/best-practices.js | 24 ++++++++++ .../rules/variables.js | 3 +- 3 files changed, 68 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b9887ff20a..4125081c2f 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ Other Style Guides 1. [jQuery](#jquery) 1. [ECMAScript 5 Compatibility](#ecmascript-5-compatibility) 1. [ECMAScript 6+ (ES 2015+) Styles](#ecmascript-6-es-2015-styles) + 1. [Standard Library](#standard-library) 1. [Testing](#testing) 1. [Performance](#performance) 1. [Resources](#resources) @@ -3148,10 +3149,50 @@ Other Style Guides **[⬆ back to top](#table-of-contents)** +## Standard Library + + The [Standard Library](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects) + contains utilities that are functionally broken but remain for legacy reasons. + + + - [29.1](#standard-library--isnan) Use `Number.isNaN` instead of global `isNaN`. + eslint: [`no-restricted-globals`](http://eslint.org/docs/rules/no-restricted-globals) + + > Why? The global `isNaN` coerces non-numbers to numbers, returning true for anything that coerces to NaN. + If this behavior is desired, make it explicit. + + ```javascript + // bad + isNaN('1.2'); // false + isNaN('1.2.3'); // true + + // good + Number.isNaN('1.2.3'); // false + Number.isNaN(Number('1.2.3')); // true + ``` + + + - [29.2](#standard-library--isfinite) Use `Number.isFinite` instead of global `isFinite`. + eslint: [`no-restricted-globals`](http://eslint.org/docs/rules/no-restricted-globals) + + > Why? The global `isFinite` coerces non-numbers to numbers, returning true for anything that coerces to a finite number. + If this behavior is desired, make it explicit. + + ```javascript + // bad + isFinite('2e3'); // true + + // good + Number.isFinite('2e3'); // false + Number.isFinite(parseInt('2e3', 10)); // true + ``` + +**[⬆ back to top](#table-of-contents)** + ## Testing - - [29.1](#testing--yup) **Yup.** + - [30.1](#testing--yup) **Yup.** ```javascript function foo() { @@ -3160,7 +3201,7 @@ Other Style Guides ``` - - [29.2](#testing--for-real) **No, but seriously**: + - [30.2](#testing--for-real) **No, but seriously**: - Whichever testing framework you use, you should be writing tests! - Strive to write many small pure functions, and minimize where mutations occur. - Be cautious about stubs and mocks - they can make your tests more brittle. diff --git a/packages/eslint-config-airbnb-base/rules/best-practices.js b/packages/eslint-config-airbnb-base/rules/best-practices.js index 02ea3e23b3..11b18a2efd 100644 --- a/packages/eslint-config-airbnb-base/rules/best-practices.js +++ b/packages/eslint-config-airbnb-base/rules/best-practices.js @@ -194,6 +194,30 @@ module.exports = { object: 'arguments', property: 'callee', message: 'arguments.callee is deprecated', + }, { + object: 'global', + property: 'isFinite', + message: 'Please use Number.isFinite instead', + }, { + object: 'self', + property: 'isFinite', + message: 'Please use Number.isFinite instead', + }, { + object: 'window', + property: 'isFinite', + message: 'Please use Number.isFinite instead', + }, { + object: 'global', + property: 'isNaN', + message: 'Please use Number.isNaN instead', + }, { + object: 'self', + property: 'isNaN', + message: 'Please use Number.isNaN instead', + }, { + object: 'window', + property: 'isNaN', + message: 'Please use Number.isNaN instead', }, { property: '__defineGetter__', message: 'Please use Object.defineProperty instead.', diff --git a/packages/eslint-config-airbnb-base/rules/variables.js b/packages/eslint-config-airbnb-base/rules/variables.js index fe38ea5d60..805563a51a 100644 --- a/packages/eslint-config-airbnb-base/rules/variables.js +++ b/packages/eslint-config-airbnb-base/rules/variables.js @@ -16,8 +16,7 @@ module.exports = { 'no-label-var': 'error', // disallow specific globals - // TODO: enable, semver-major - 'no-restricted-globals': ['off'].concat(restrictedGlobals), + 'no-restricted-globals': ['error', 'isFinite', 'isNaN'].concat(restrictedGlobals), // disallow declaration of variables already declared in the outer scope 'no-shadow': 'error', From 5aa203eaa88fb7febfb1ccf8736e896ca0959049 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Fri, 1 Sep 2017 22:25:31 -0700 Subject: [PATCH 004/302] [eslint config] [base] [deps] [breaking] require `eslint` v4 - enable `function-paren-newline`, `for-direction`, `getter-return`, `no-compare-neg-zero`, `semi-style`, `object-curly-newline`, `no-buffer-constructor`, `no-restricted-globals`, `switch-colon-spacing`, `template-tag-spacing`, `prefer-promise-reject-errors`, `prefer-restructuring` - improve `indent`, `no-multi-spaces`, `no-trailing-spaces`, `no-underscore-dangle` --- .travis.yml | 4 --- .../eslint-config-airbnb-base/package.json | 4 +-- .../rules/best-practices.js | 5 ++- .../eslint-config-airbnb-base/rules/errors.js | 9 ++--- .../eslint-config-airbnb-base/rules/es6.js | 3 +- .../eslint-config-airbnb-base/rules/node.js | 3 +- .../eslint-config-airbnb-base/rules/style.js | 33 +++++++++++-------- 7 files changed, 28 insertions(+), 33 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7d887ca685..9e1091574d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,6 @@ env: matrix: - 'TEST=true ESLINT=3 PACKAGE=eslint-config-airbnb' - 'TEST=true ESLINT=4 PACKAGE=eslint-config-airbnb' - - 'TEST=true ESLINT=3 PACKAGE=eslint-config-airbnb-base' - 'TEST=true ESLINT=4 PACKAGE=eslint-config-airbnb-base' matrix: fast_finish: true @@ -28,8 +27,6 @@ matrix: env: PREPUBLISH=true ESLINT=3 PACKAGE=eslint-config-airbnb - node_js: "node" env: PREPUBLISH=true ESLINT=4 PACKAGE=eslint-config-airbnb - - node_js: "node" - env: PREPUBLISH=true ESLINT=3 PACKAGE=eslint-config-airbnb-base - node_js: "node" env: PREPUBLISH=true ESLINT=4 PACKAGE=eslint-config-airbnb-base allow_failures: @@ -37,5 +34,4 @@ matrix: - node_js: "5" - env: PREPUBLISH=true ESLINT=3 PACKAGE=eslint-config-airbnb - env: PREPUBLISH=true ESLINT=4 PACKAGE=eslint-config-airbnb - - env: PREPUBLISH=true ESLINT=3 PACKAGE=eslint-config-airbnb-base - env: PREPUBLISH=true ESLINT=4 PACKAGE=eslint-config-airbnb-base diff --git a/packages/eslint-config-airbnb-base/package.json b/packages/eslint-config-airbnb-base/package.json index 90078eb1d0..f23359e969 100644 --- a/packages/eslint-config-airbnb-base/package.json +++ b/packages/eslint-config-airbnb-base/package.json @@ -51,7 +51,7 @@ "babel-preset-airbnb": "^2.4.0", "babel-tape-runner": "^2.0.1", "editorconfig-tools": "^0.1.1", - "eslint": "^4.5.0", + "eslint": "^4.6.0", "eslint-find-rules": "^3.1.1", "eslint-plugin-import": "^2.7.0", "in-publish": "^2.0.0", @@ -59,7 +59,7 @@ "tape": "^4.8.0" }, "peerDependencies": { - "eslint": "^3.19.0 || ^4.5.0", + "eslint": "^4.6.0", "eslint-plugin-import": "^2.7.0" }, "engines": { diff --git a/packages/eslint-config-airbnb-base/rules/best-practices.js b/packages/eslint-config-airbnb-base/rules/best-practices.js index 11b18a2efd..83808bb879 100644 --- a/packages/eslint-config-airbnb-base/rules/best-practices.js +++ b/packages/eslint-config-airbnb-base/rules/best-practices.js @@ -143,7 +143,7 @@ module.exports = { // disallow use of multiple spaces 'no-multi-spaces': ['error', { - // ignoreEOLComments: false, // TODO: uncomment once v3 is dropped + ignoreEOLComments: false, }], // disallow use of multiline strings @@ -294,8 +294,7 @@ module.exports = { // require using Error objects as Promise rejection reasons // http://eslint.org/docs/rules/prefer-promise-reject-errors - // TODO: enable, semver-major - 'prefer-promise-reject-errors': ['off', { allowEmptyReject: true }], + 'prefer-promise-reject-errors': ['error', { allowEmptyReject: true }], // require use of the second argument for parseInt() radix: 'error', diff --git a/packages/eslint-config-airbnb-base/rules/errors.js b/packages/eslint-config-airbnb-base/rules/errors.js index 786b88ae1e..19b815a09b 100644 --- a/packages/eslint-config-airbnb-base/rules/errors.js +++ b/packages/eslint-config-airbnb-base/rules/errors.js @@ -2,13 +2,11 @@ module.exports = { rules: { // Enforce “for” loop update clause moving the counter in the right direction // http://eslint.org/docs/rules/for-direction - // TODO: enable, semver-major until v3 is dropped; semver-minor otherwise - 'for-direction': 'off', + 'for-direction': 'error', // Enforces that a return statement is present in property getters // http://eslint.org/docs/rules/getter-return - // TODO: enable, semver-major when v3 is dropped - 'getter-return': ['off', { allowImplicit: true }], + 'getter-return': ['error', { allowImplicit: true }], // Disallow await inside of loops // http://eslint.org/docs/rules/no-await-in-loop @@ -16,8 +14,7 @@ module.exports = { // Disallow comparisons to negative zero // http://eslint.org/docs/rules/no-compare-neg-zero - // TODO: enable (semver-major) - 'no-compare-neg-zero': 'off', + 'no-compare-neg-zero': 'error', // disallow assignment in conditional expressions 'no-cond-assign': ['error', 'always'], diff --git a/packages/eslint-config-airbnb-base/rules/es6.js b/packages/eslint-config-airbnb-base/rules/es6.js index a77f3a6641..f53814d1e7 100644 --- a/packages/eslint-config-airbnb-base/rules/es6.js +++ b/packages/eslint-config-airbnb-base/rules/es6.js @@ -110,8 +110,7 @@ module.exports = { // Prefer destructuring from arrays and objects // http://eslint.org/docs/rules/prefer-destructuring - // TODO: enable - 'prefer-destructuring': ['off', { + 'prefer-destructuring': ['error', { VariableDeclarator: { array: false, object: true, diff --git a/packages/eslint-config-airbnb-base/rules/node.js b/packages/eslint-config-airbnb-base/rules/node.js index d890a67c1b..9413b5483a 100644 --- a/packages/eslint-config-airbnb-base/rules/node.js +++ b/packages/eslint-config-airbnb-base/rules/node.js @@ -16,8 +16,7 @@ module.exports = { // disallow use of the Buffer() constructor // http://eslint.org/docs/rules/no-buffer-constructor - // TODO: enable, semver-major - 'no-buffer-constructor': 'off', + 'no-buffer-constructor': 'error', // disallow mixing regular variable and require declarations 'no-mixed-requires': ['off', false], diff --git a/packages/eslint-config-airbnb-base/rules/style.js b/packages/eslint-config-airbnb-base/rules/style.js index 82ef7018c2..bcd83778e1 100644 --- a/packages/eslint-config-airbnb-base/rules/style.js +++ b/packages/eslint-config-airbnb-base/rules/style.js @@ -82,6 +82,10 @@ module.exports = { // TODO: enable 'func-style': ['off', 'expression'], + // enforce consistent line breaks inside function parentheses + // https://eslint.org/docs/rules/function-paren-newline + 'function-paren-newline': ['error', 'multiline'], + // Blacklist certain identifiers to prevent them being used // http://eslint.org/docs/rules/id-blacklist 'id-blacklist': 'off', @@ -100,9 +104,6 @@ module.exports = { VariableDeclarator: 1, outerIIFEBody: 1, // MemberExpression: null, - // CallExpression: { - // parameters: null, - // }, FunctionDeclaration: { parameters: 1, body: 1 @@ -110,7 +111,15 @@ module.exports = { FunctionExpression: { parameters: 1, body: 1 - } + }, + CallExpression: { + 'arguments': 1 + }, + ArrayExpression: 1, + ObjectExpression: 1, + ImportDeclaration: 1, + flatTernaryExpressions: false, + ignoredNodes: ['JSXElement *'] }], // specify whether double or single quotes should be used in JSX attributes @@ -305,7 +314,7 @@ module.exports = { // disallow trailing whitespace at the end of lines 'no-trailing-spaces': ['error', { skipBlankLines: false, - // ignoreComments: false, // TODO: uncomment once v3 is dropped + ignoreComments: false, }], // disallow dangling underscores in identifiers @@ -313,7 +322,7 @@ module.exports = { allow: [], allowAfterThis: false, allowAfterSuper: false, - // enforceInMethodNames: false, // TODO: uncoment and enable, semver-minor once v3 is dropped + enforceInMethodNames: false, }], // disallow the use of Boolean literals in conditional expressions @@ -334,8 +343,7 @@ module.exports = { // enforce line breaks between braces // http://eslint.org/docs/rules/object-curly-newline - // TODO: enable once https://github.com/eslint/eslint/issues/6488 is resolved and v3 is dropped - 'object-curly-newline': ['off', { + 'object-curly-newline': ['error', { ObjectExpression: { minProperties: 3, multiline: true, consistent: true }, ObjectPattern: { minProperties: 3, multiline: true, consistent: true } }], @@ -386,8 +394,7 @@ module.exports = { // Enforce location of semicolons // http://eslint.org/docs/rules/semi-style - // TODO: enable, semver-major until v3 is dropped, semver-minor otherwise - 'semi-style': ['off', 'last'], + 'semi-style': ['error', 'last'], // requires object keys to be sorted 'sort-keys': ['off', 'asc', { caseSensitive: false, natural: true }], @@ -437,13 +444,11 @@ module.exports = { // Enforce spacing around colons of switch statements // http://eslint.org/docs/rules/switch-colon-spacing - // TODO: enable, semver-major - 'switch-colon-spacing': ['off', { after: true, before: false }], + 'switch-colon-spacing': ['error', { after: true, before: false }], // Require or disallow spacing between template tags and their literals // http://eslint.org/docs/rules/template-tag-spacing - // TODO: enable, semver-major - 'template-tag-spacing': ['off', 'never'], + 'template-tag-spacing': ['error', 'never'], // require or disallow the Unicode Byte Order Mark // http://eslint.org/docs/rules/unicode-bom From f878edad256fabd4fdcdfdffabd884744b0924d4 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Fri, 5 May 2017 11:42:43 +0100 Subject: [PATCH 005/302] [eslint config] [base] [patch] also disallow padding in classes and switches --- README.md | 10 +++++++++- packages/eslint-config-airbnb-base/rules/style.js | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4125081c2f..27070b7792 100644 --- a/README.md +++ b/README.md @@ -2396,7 +2396,7 @@ Other Style Guides } - // also bad + // bad if (baz) { console.log(qux); @@ -2405,6 +2405,14 @@ Other Style Guides } + // bad + class Foo { + + constructor(bar) { + this.bar = bar; + } + } + // good function bar() { console.log(foo); diff --git a/packages/eslint-config-airbnb-base/rules/style.js b/packages/eslint-config-airbnb-base/rules/style.js index bcd83778e1..d36309a808 100644 --- a/packages/eslint-config-airbnb-base/rules/style.js +++ b/packages/eslint-config-airbnb-base/rules/style.js @@ -368,8 +368,8 @@ module.exports = { // enforce operators to be placed before or after line breaks 'operator-linebreak': 'off', - // enforce padding within blocks - 'padded-blocks': ['error', 'never'], + // disallow padding within blocks + 'padded-blocks': ['error', { blocks: 'never', classes: 'never', switches: 'never' }], // Require or disallow padding lines between statements // http://eslint.org/docs/rules/padding-line-between-statements From b687a9ceb8030dcdc467adb51c33e37a9a1c6101 Mon Sep 17 00:00:00 2001 From: elmehri Date: Tue, 29 Aug 2017 15:27:08 +0100 Subject: [PATCH 006/302] [eslint config] [base] [patch] support Protractor config files in import/no-extraneous-dependencies --- packages/eslint-config-airbnb-base/rules/imports.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/eslint-config-airbnb-base/rules/imports.js b/packages/eslint-config-airbnb-base/rules/imports.js index 2700194efe..81b845a871 100644 --- a/packages/eslint-config-airbnb-base/rules/imports.js +++ b/packages/eslint-config-airbnb-base/rules/imports.js @@ -84,6 +84,7 @@ module.exports = { '**/gulpfile.js', // gulp config '**/gulpfile.*.js', // gulp config '**/Gruntfile{,.js}', // grunt config + '**/protractor.conf.js', // protractor config '**/protractor.conf.*.js', // protractor config ], optionalDependencies: false, From 9d91990221d47b2782f586370451033460e0a32b Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Fri, 1 Sep 2017 22:59:54 -0700 Subject: [PATCH 007/302] [Tests] stop testing on eslint v3 --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9e1091574d..c083bda347 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,14 +17,11 @@ script: sudo: false env: matrix: - - 'TEST=true ESLINT=3 PACKAGE=eslint-config-airbnb' - 'TEST=true ESLINT=4 PACKAGE=eslint-config-airbnb' - 'TEST=true ESLINT=4 PACKAGE=eslint-config-airbnb-base' matrix: fast_finish: true include: - - node_js: "node" - env: PREPUBLISH=true ESLINT=3 PACKAGE=eslint-config-airbnb - node_js: "node" env: PREPUBLISH=true ESLINT=4 PACKAGE=eslint-config-airbnb - node_js: "node" @@ -32,6 +29,5 @@ matrix: allow_failures: - node_js: "7" - node_js: "5" - - env: PREPUBLISH=true ESLINT=3 PACKAGE=eslint-config-airbnb - env: PREPUBLISH=true ESLINT=4 PACKAGE=eslint-config-airbnb - env: PREPUBLISH=true ESLINT=4 PACKAGE=eslint-config-airbnb-base From 63d1ae175e01391ded18c0a4d03c0eca4c49edbe Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Fri, 1 Sep 2017 23:00:41 -0700 Subject: [PATCH 008/302] [Tests] fix linting error caused by updated base config --- packages/eslint-config-airbnb-base/rules/style.js | 6 +++--- packages/eslint-config-airbnb-base/test/test-base.js | 4 ++-- packages/eslint-config-airbnb/rules/react.js | 6 +++++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/eslint-config-airbnb-base/rules/style.js b/packages/eslint-config-airbnb-base/rules/style.js index d36309a808..4aa35aeafe 100644 --- a/packages/eslint-config-airbnb-base/rules/style.js +++ b/packages/eslint-config-airbnb-base/rules/style.js @@ -113,7 +113,7 @@ module.exports = { body: 1 }, CallExpression: { - 'arguments': 1 + arguments: 1 }, ArrayExpression: 1, ObjectExpression: 1, @@ -344,8 +344,8 @@ module.exports = { // enforce line breaks between braces // http://eslint.org/docs/rules/object-curly-newline 'object-curly-newline': ['error', { - ObjectExpression: { minProperties: 3, multiline: true, consistent: true }, - ObjectPattern: { minProperties: 3, multiline: true, consistent: true } + ObjectExpression: { minProperties: 4, multiline: true, consistent: true }, + ObjectPattern: { minProperties: 4, multiline: true, consistent: true } }], // enforce "same line" or "multiple line" on object properties. diff --git a/packages/eslint-config-airbnb-base/test/test-base.js b/packages/eslint-config-airbnb-base/test/test-base.js index 810c8000b0..6936e0eb24 100644 --- a/packages/eslint-config-airbnb-base/test/test-base.js +++ b/packages/eslint-config-airbnb-base/test/test-base.js @@ -11,9 +11,9 @@ fs.readdirSync(path.join(__dirname, '../rules')).forEach((name) => { files[name] = require(`../rules/${name}`); // eslint-disable-line global-require }); -Object.keys(files).forEach(( +Object.keys(files).forEach(( // eslint-disable-line function-paren-newline name, // trailing function comma is to test parsing -) => { +) => { // eslint-disable-line function-paren-newline const config = files[name]; test(`${name}: does not reference react`, (t) => { diff --git a/packages/eslint-config-airbnb/rules/react.js b/packages/eslint-config-airbnb/rules/react.js index 96b1d25644..15324c8608 100644 --- a/packages/eslint-config-airbnb/rules/react.js +++ b/packages/eslint-config-airbnb/rules/react.js @@ -186,7 +186,11 @@ module.exports = { // Prevent missing props validation in a React component definition // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md - 'react/prop-types': ['error', { ignore: [], customValidators: [], skipUndeclared: false }], + 'react/prop-types': ['error', { + ignore: [], + customValidators: [], + skipUndeclared: false + }], // Prevent missing React when using JSX // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md From 1f5ca4c976b906a94d4faa2e01dfff2c9a106bfb Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Fri, 1 Sep 2017 22:57:11 -0700 Subject: [PATCH 009/302] [eslint config] [base] v12.0.0 --- packages/eslint-config-airbnb-base/CHANGELOG.md | 10 ++++++++++ packages/eslint-config-airbnb-base/package.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/eslint-config-airbnb-base/CHANGELOG.md b/packages/eslint-config-airbnb-base/CHANGELOG.md index 6dcd4587a5..5e268d704b 100644 --- a/packages/eslint-config-airbnb-base/CHANGELOG.md +++ b/packages/eslint-config-airbnb-base/CHANGELOG.md @@ -1,3 +1,13 @@ +12.0.0 / 2017-09-02 +================== + - [deps] [breaking] require `eslint` v4 + - enable `function-paren-newline`, `for-direction`, `getter-return`, `no-compare-neg-zero`, `semi-style`, `object-curly-newline`, `no-buffer-constructor`, `no-restricted-globals`, `switch-colon-spacing`, `template-tag-spacing`, `prefer-promise-reject-errors`, `prefer-restructuring` + - improve `indent`, `no-multi-spaces`, `no-trailing-spaces`, `no-underscore-dangle` + - [breaking] move `comma-dangle` to Stylistic Issues (#1514) + - [breaking] Rules prohibiting global isNaN, isFinite (#1477) + - [patch] also disallow padding in classes and switches (#1403) + - [patch] support Protractor config files in import/no-extraneous-dependencies (#1543) + 11.3.2 / 2017-08-22 ================== - [patch] Add jest.config.js to import/no-extraneous-dependencies devDeps (#1522) diff --git a/packages/eslint-config-airbnb-base/package.json b/packages/eslint-config-airbnb-base/package.json index f23359e969..6c18415998 100644 --- a/packages/eslint-config-airbnb-base/package.json +++ b/packages/eslint-config-airbnb-base/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-airbnb-base", - "version": "11.3.2", + "version": "12.0.0", "description": "Airbnb's base JS ESLint config, following our styleguide", "main": "index.js", "scripts": { From 7b30681227ffec7e5ff958a43f0ba31633ad045d Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sat, 2 Sep 2017 10:24:51 -0700 Subject: [PATCH 010/302] [eslint config] [breaking] [deps] require `eslint` `v4`, update `eslint-config-airbnb-base` --- packages/eslint-config-airbnb/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/eslint-config-airbnb/package.json b/packages/eslint-config-airbnb/package.json index d1aa120358..e424218002 100644 --- a/packages/eslint-config-airbnb/package.json +++ b/packages/eslint-config-airbnb/package.json @@ -48,13 +48,13 @@ }, "homepage": "https://github.com/airbnb/javascript", "dependencies": { - "eslint-config-airbnb-base": "^11.3.2" + "eslint-config-airbnb-base": "^12.0.0" }, "devDependencies": { "babel-preset-airbnb": "^2.4.0", "babel-tape-runner": "^2.0.1", "editorconfig-tools": "^0.1.1", - "eslint": "^3.19.0 || ^4.5.0", + "eslint": "^4.6.0", "eslint-find-rules": "^3.1.1", "eslint-plugin-import": "^2.7.0", "eslint-plugin-jsx-a11y": "^5.1.1", @@ -65,7 +65,7 @@ "tape": "^4.8.0" }, "peerDependencies": { - "eslint": "^3.19.0 || ^4.5.0", + "eslint": "^4.6.0", "eslint-plugin-jsx-a11y": "^5.1.1", "eslint-plugin-import": "^2.7.0", "eslint-plugin-react": "^7.3.0" From 074b2f81b810519421a875bff94e15be118c2cd2 Mon Sep 17 00:00:00 2001 From: Stephen Wyatt Bush Date: Wed, 5 Jul 2017 15:47:54 -0700 Subject: [PATCH 011/302] [eslint config] [breaking] [deps] Upgrade `eslint-plugin-jsx-a11y` to `v6` - enable more a11y rules --- packages/eslint-config-airbnb/package.json | 4 ++-- packages/eslint-config-airbnb/rules/react-a11y.js | 15 ++++----------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/packages/eslint-config-airbnb/package.json b/packages/eslint-config-airbnb/package.json index e424218002..5edc1665fe 100644 --- a/packages/eslint-config-airbnb/package.json +++ b/packages/eslint-config-airbnb/package.json @@ -57,7 +57,7 @@ "eslint": "^4.6.0", "eslint-find-rules": "^3.1.1", "eslint-plugin-import": "^2.7.0", - "eslint-plugin-jsx-a11y": "^5.1.1", + "eslint-plugin-jsx-a11y": "^6.0.2", "eslint-plugin-react": "^7.3.0", "in-publish": "^2.0.0", "react": ">= 0.13.0", @@ -66,7 +66,7 @@ }, "peerDependencies": { "eslint": "^4.6.0", - "eslint-plugin-jsx-a11y": "^5.1.1", + "eslint-plugin-jsx-a11y": "^6.0.2", "eslint-plugin-import": "^2.7.0", "eslint-plugin-react": "^7.3.0" }, diff --git a/packages/eslint-config-airbnb/rules/react-a11y.js b/packages/eslint-config-airbnb/rules/react-a11y.js index 4cdf1cf39c..6e1c395656 100644 --- a/packages/eslint-config-airbnb/rules/react-a11y.js +++ b/packages/eslint-config-airbnb/rules/react-a11y.js @@ -13,7 +13,7 @@ module.exports = { rules: { // Enforce that anchors have content // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-has-content.md - 'jsx-a11y/anchor-has-content': ['error', { components: [''] }], + 'jsx-a11y/anchor-has-content': ['error', { components: [] }], // Require ARIA roles to be valid and non-abstract // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-role.md @@ -32,10 +32,6 @@ module.exports = { // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-unsupported-elements.md 'jsx-a11y/aria-unsupported-elements': 'error', - // disallow href "#" - // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/href-no-hash.md - 'jsx-a11y/href-no-hash': ['error', { components: ['a'] }], - // Enforce that all elements that require alternative text have meaningful information // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/alt-text.md 'jsx-a11y/alt-text': ['error', { @@ -55,9 +51,8 @@ module.exports = { 'jsx-a11y/label-has-for': ['error', { components: ['label'] }], // require that mouseover/out come with focus/blur, for keyboard-only users - // TODO: evaluate // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/mouse-events-have-key-events.md - 'jsx-a11y/mouse-events-have-key-events': 'off', + 'jsx-a11y/mouse-events-have-key-events': 'error', // Prevent use of `accessKey` // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-access-key.md @@ -109,8 +104,7 @@ module.exports = { // require onClick be accompanied by onKeyUp/onKeyDown/onKeyPress // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/click-events-have-key-events.md - // TODO: enable? - 'jsx-a11y/click-events-have-key-events': 'off', + 'jsx-a11y/click-events-have-key-events': 'error', // Enforce that DOM elements without semantic behavior not have interaction handlers // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md @@ -191,8 +185,7 @@ module.exports = { // ensure tags are valid // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/0745af376cdc8686d85a361ce36952b1fb1ccf6e/docs/rules/anchor-is-valid.md - // TODO: enable, semver-major - 'jsx-a11y/anchor-is-valid': ['off', { + 'jsx-a11y/anchor-is-valid': ['error', { components: ['Link'], specialLink: [], aspects: ['noHref', 'invalidHref', 'preferButton'], From a206c52854ec8de387289ceb3d88fefc7ff2b030 Mon Sep 17 00:00:00 2001 From: Will Clark Date: Tue, 25 Jul 2017 11:41:34 +0200 Subject: [PATCH 012/302] [eslint config] [base] [patch] Improve Gruntfile glob pattern To cover `Gruntfile` and `Gruntfile.js` instead of just `Gruntfile`. --- packages/eslint-config-airbnb-base/rules/imports.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-config-airbnb-base/rules/imports.js b/packages/eslint-config-airbnb-base/rules/imports.js index 0150724f6b..6116c6f67c 100644 --- a/packages/eslint-config-airbnb-base/rules/imports.js +++ b/packages/eslint-config-airbnb-base/rules/imports.js @@ -82,7 +82,7 @@ module.exports = { '**/rollup.config.*.js', // rollup config '**/gulpfile.js', // gulp config '**/gulpfile.*.js', // gulp config - '**/Gruntfile', // grunt config + '**/Gruntfile{,.js}', // grunt config '**/protractor.conf.*.js', // protractor config ], optionalDependencies: false, From e4f35ac959ce531e128d97cea051ddd76dd5aa6c Mon Sep 17 00:00:00 2001 From: Chris Atkin Date: Mon, 31 Jul 2017 17:12:27 +0100 Subject: [PATCH 013/302] Removing "GitHub" from In The Wild reference This removes the word "GitHub" from an In The Wild reference link, to prevent association with the main GitHub organisation. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f0b3eaa6c6..408a150cb6 100644 --- a/README.md +++ b/README.md @@ -3330,7 +3330,7 @@ Other Style Guides - **React**: [facebook.github.io/react/contributing/how-to-contribute.html#style-guide](https://facebook.github.io/react/contributing/how-to-contribute.html#style-guide) - **REI**: [reidev/js-style-guide](https://github.com/rei/code-style-guides/blob/master/docs/javascript.md) - **Ripple**: [ripple/javascript-style-guide](https://github.com/ripple/javascript-style-guide) - - **Sainsbury's Supermarkets**: [github/jsainsburyplc](https://github.com/jsainsburyplc) + - **Sainsbury's Supermarkets**: [jsainsburyplc](https://github.com/jsainsburyplc) - **SeekingAlpha**: [seekingalpha/javascript-style-guide](https://github.com/seekingalpha/javascript-style-guide) - **Shutterfly**: [shutterfly/javascript](https://github.com/shutterfly/javascript) - **Sourcetoad**: [sourcetoad/javascript](https://github.com/sourcetoad/javascript) From 16faade698a185d3a84f4c2c8ef70ec4cf712936 Mon Sep 17 00:00:00 2001 From: Eric Pan Date: Mon, 31 Jul 2017 11:19:07 -0700 Subject: [PATCH 014/302] [eslint config] [*] [docs] Specify yarn-specific install instructions Attempts to clarify and address issue https://github.com/airbnb/javascript/issues/1508#issuecomment-319113807 Recommends yarn users to list peer dependencies and then install each peer dependency with specified version. Prior yarn instructions led users to install the latest version of each peer dependency which, in some cases, led to errors if the latest version of a peer dependency did not have rules that this package uses. --- packages/eslint-config-airbnb-base/README.md | 2 +- packages/eslint-config-airbnb/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/eslint-config-airbnb-base/README.md b/packages/eslint-config-airbnb-base/README.md index 968cec06cd..881b86b2db 100644 --- a/packages/eslint-config-airbnb-base/README.md +++ b/packages/eslint-config-airbnb-base/README.md @@ -12,7 +12,7 @@ We export two ESLint configurations for your usage. Our default export contains all of our ESLint rules, including ECMAScript 6+. It requires `eslint` and `eslint-plugin-import`. -If you use yarn, run `yarn add --dev eslint-config-airbnb-base eslint-plugin-import`, or see below for npm instructions. +If you use yarn, run `npm info "eslint-config-airbnb-base@latest" peerDependencies` to list the peer dependencies and versions, then run `yarn add --dev @` for each listed peer dependency. See below for npm instructions. 1. Install the correct versions of each package, which are listed by the command: diff --git a/packages/eslint-config-airbnb/README.md b/packages/eslint-config-airbnb/README.md index a3a7c71340..567c929a31 100644 --- a/packages/eslint-config-airbnb/README.md +++ b/packages/eslint-config-airbnb/README.md @@ -12,7 +12,7 @@ We export three ESLint configurations for your usage. Our default export contains all of our ESLint rules, including ECMAScript 6+ and React. It requires `eslint`, `eslint-plugin-import`, `eslint-plugin-react`, and `eslint-plugin-jsx-a11y`. If you don't need React, see [eslint-config-airbnb-base](https://npmjs.com/eslint-config-airbnb-base). -If you use yarn, run `yarn add --dev eslint-config-airbnb-base eslint-plugin-import eslint-plugin-react eslint-plugin-jsx-a11y`, and see below for npm instructions. +If you use yarn, run `npm info "eslint-config-airbnb@latest" peerDependencies` to list the peer dependencies and versions, then run `yarn add --dev @` for each listed peer dependency. See below for npm instructions. 1. Install the correct versions of each package, which are listed by the command: From dbdbde0b81622d2f76c3babb9ddcfdbdf880190e Mon Sep 17 00:00:00 2001 From: marhub Date: Mon, 7 Aug 2017 12:48:54 +0200 Subject: [PATCH 015/302] Remove polish translation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove link to polish translation as it's outdated ( last commit from 2-3 years ago ). For example in polish translation you can read that you should use one "var" keyword to declare your vars. example: ```js // źle ( bad ) var items = getItems(); var goSportsTeam = true; var dragonball = 'z'; // dobrze ( good ) var items = getItems(), goSportsTeam = true, dragonball = 'z'; ``` --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 408a150cb6..f1cfe81db2 100644 --- a/README.md +++ b/README.md @@ -3367,7 +3367,6 @@ Other Style Guides - ![it](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/Italy.png) **Italian**: [sinkswim/javascript-style-guide](https://github.com/sinkswim/javascript-style-guide) - ![jp](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/Japan.png) **Japanese**: [mitsuruog/javascript-style-guide](https://github.com/mitsuruog/javascript-style-guide) - ![kr](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/South-Korea.png) **Korean**: [tipjs/javascript-style-guide](https://github.com/tipjs/javascript-style-guide) - - ![pl](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/Poland.png) **Polish**: [mjurczyk/javascript](https://github.com/mjurczyk/javascript) - ![ru](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/Russia.png) **Russian**: [leonidlebedev/javascript-airbnb](https://github.com/leonidlebedev/javascript-airbnb) - ![es](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/Spain.png) **Spanish**: [paolocarrasco/javascript-style-guide](https://github.com/paolocarrasco/javascript-style-guide) - ![th](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/Thailand.png) **Thai**: [lvarayut/javascript-style-guide](https://github.com/lvarayut/javascript-style-guide) From b5e14dc5d06ddbadc0bc932b7f988f9552fb667e Mon Sep 17 00:00:00 2001 From: Jared Deckard Date: Mon, 7 Aug 2017 15:36:22 -0500 Subject: [PATCH 016/302] Explain why default exports are preferred --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f1cfe81db2..562eebc955 100644 --- a/README.md +++ b/README.md @@ -1285,6 +1285,7 @@ Other Style Guides - [10.6](#modules--prefer-default-export) In modules with a single export, prefer default export over named export. eslint: [`import/prefer-default-export`](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/prefer-default-export.md) + > Why? To encourage more files that only ever export one thing, which is better for readability and maintainability. ```javascript // bad From 6bd73560eea8f3c00c8185f96799f69ad4ba1fcb Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Wed, 9 Aug 2017 17:35:23 -0700 Subject: [PATCH 017/302] [eslint config] [deps] update `eslint` v4, `eslint-plugin-react`, `tape` --- packages/eslint-config-airbnb/package.json | 10 ++++----- packages/eslint-config-airbnb/rules/react.js | 23 ++++++++++++++++++-- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/packages/eslint-config-airbnb/package.json b/packages/eslint-config-airbnb/package.json index 4f48b8fee2..41fa65abbb 100644 --- a/packages/eslint-config-airbnb/package.json +++ b/packages/eslint-config-airbnb/package.json @@ -54,21 +54,21 @@ "babel-preset-airbnb": "^2.4.0", "babel-tape-runner": "^2.0.1", "editorconfig-tools": "^0.1.1", - "eslint": "^3.19.0 || ^4.3.0", + "eslint": "^3.19.0 || ^4.4.1", "eslint-find-rules": "^3.1.1", "eslint-plugin-import": "^2.7.0", "eslint-plugin-jsx-a11y": "^5.1.1", - "eslint-plugin-react": "^7.1.0", + "eslint-plugin-react": "^7.2.0", "in-publish": "^2.0.0", "react": ">= 0.13.0", "safe-publish-latest": "^1.1.1", - "tape": "^4.7.0" + "tape": "^4.8.0" }, "peerDependencies": { - "eslint": "^3.19.0 || ^4.3.0", + "eslint": "^3.19.0 || ^4.4.1", "eslint-plugin-jsx-a11y": "^5.1.1", "eslint-plugin-import": "^2.7.0", - "eslint-plugin-react": "^7.1.0" + "eslint-plugin-react": "^7.2.0" }, "engines": { "node": ">= 4" diff --git a/packages/eslint-config-airbnb/rules/react.js b/packages/eslint-config-airbnb/rules/react.js index 96e5f4a75d..c5503a17b1 100644 --- a/packages/eslint-config-airbnb/rules/react.js +++ b/packages/eslint-config-airbnb/rules/react.js @@ -42,7 +42,7 @@ module.exports = { // Enforce boolean attributes notation in JSX // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md - 'react/jsx-boolean-value': ['error', 'never'], + 'react/jsx-boolean-value': ['error', 'never', { always: [] }], // Validate closing bracket location in JSX // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md @@ -90,7 +90,7 @@ module.exports = { // Prevent usage of unwrapped JSX strings // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-literals.md - 'react/jsx-no-literals': 'off', + 'react/jsx-no-literals': ['off', { noStrings: true }], // Disallow undeclared variables in JSX // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md @@ -208,6 +208,8 @@ module.exports = { 'static-methods', 'lifecycle', '/^on.+$/', + 'getters', + 'setters', '/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/', 'everything-else', '/^render.+$/', @@ -330,6 +332,23 @@ module.exports = { // https://github.com/yannickcr/eslint-plugin-react/blob/9e13ae2c51e44872b45cc15bf1ac3a72105bdd0e/docs/rules/no-redundant-should-component-update.md // TODO: enable, semver-major 'react/no-redundant-should-component-update': 'off', + + // Prevent unused state values + // https://github.com/yannickcr/eslint-plugin-react/pull/1103/files + // TODO: enable? semver-major + 'react/no-unused-state': 'off', + + // Enforces consistent naming for boolean props + // https://github.com/yannickcr/eslint-plugin-react/blob/73abadb697034b5ccb514d79fb4689836fe61f91/docs/rules/boolean-prop-naming.md + 'react/boolean-prop-naming': ['off', { + propTypeNames: ['bool', 'mutuallyExclusiveTrueProps'], + rule: '^(is|has)[A-Z]([A-Za-z0-9]?)+', + }], + + // Prevents common casing typos + // https://github.com/yannickcr/eslint-plugin-react/blob/73abadb697034b5ccb514d79fb4689836fe61f91/docs/rules/no-typos.md + // TODO: enable, semver-major + 'react/no-typos': 'off', }, settings: { From 1cddb4f2c0069000c235817069cc4449ce2ed681 Mon Sep 17 00:00:00 2001 From: Mark Larah Date: Mon, 14 Aug 2017 19:49:29 -0700 Subject: [PATCH 018/302] [eslint config] [base] [patch] Add jest.config.js to import/no-extraneous-dependencies devDeps --- packages/eslint-config-airbnb-base/rules/imports.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/eslint-config-airbnb-base/rules/imports.js b/packages/eslint-config-airbnb-base/rules/imports.js index 6116c6f67c..2700194efe 100644 --- a/packages/eslint-config-airbnb-base/rules/imports.js +++ b/packages/eslint-config-airbnb-base/rules/imports.js @@ -76,6 +76,7 @@ module.exports = { 'test.{js,jsx}', // repos with a single test file 'test-*.{js,jsx}', // repos with multiple top-level test files '**/*.{test,spec}.{js,jsx}', // tests where the extension denotes that it is a test + '**/jest.config.js', // jest config '**/webpack.config.js', // webpack config '**/webpack.config.*.js', // webpack config '**/rollup.config.js', // rollup config From 344c25d83a91c7a9c456e6fc9d5b40d1b924f8d3 Mon Sep 17 00:00:00 2001 From: Wooram Jun Date: Thu, 17 Aug 2017 15:35:14 +0900 Subject: [PATCH 019/302] Fix a wrong link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 562eebc955..65309ed421 100644 --- a/README.md +++ b/README.md @@ -2658,7 +2658,7 @@ Other Style Guides })()); ``` - [Read more](https://stackoverflow.com/questions/7365172/semicolon-before-self-invoking-function/7365214%237365214). + [Read more](https://stackoverflow.com/questions/7365172/semicolon-before-self-invoking-function/7365214#7365214). **[⬆ back to top](#table-of-contents)** From 855426b3db99b07469962b4d1515757d8284dda0 Mon Sep 17 00:00:00 2001 From: Anton Vasyunin Date: Fri, 18 Aug 2017 00:05:21 +0700 Subject: [PATCH 020/302] Update section on naming conventions for acronyms - Fix array name starting with a capital - Add alternative good example --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 65309ed421..69ff656e32 100644 --- a/README.md +++ b/README.md @@ -2928,11 +2928,16 @@ Other Style Guides // ... ]; + // also good + const httpRequests = [ + // ... + ]; + // best import TextMessageContainer from './containers/TextMessageContainer'; // best - const Requests = [ + const requests = [ // ... ]; ``` From 09988e34b4d580af8f6988b438ce492686ad2759 Mon Sep 17 00:00:00 2001 From: Max Kaplan Date: Sun, 20 Aug 2017 09:24:03 -0400 Subject: [PATCH 021/302] [inthewild] adding kaplan komputing --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 69ff656e32..b9887ff20a 100644 --- a/README.md +++ b/README.md @@ -3313,6 +3313,7 @@ Other Style Guides - **Jam3**: [Jam3/Javascript-Code-Conventions](https://github.com/Jam3/Javascript-Code-Conventions) - **JeopardyBot**: [kesne/jeopardy-bot](https://github.com/kesne/jeopardy-bot/blob/master/STYLEGUIDE.md) - **JSSolutions**: [JSSolutions/javascript](https://github.com/JSSolutions/javascript) + - **Kaplan Komputing**: [kaplankomputing/javascript](https://github.com/kaplankomputing/javascript) - **KickorStick**: [kickorstick/javascript](https://github.com/kickorstick/javascript) - **Kinetica Solutions**: [kinetica/javascript](https://github.com/kinetica/Javascript-style-guide) - **LEINWAND**: [LEINWAND/javascript](https://github.com/LEINWAND/javascript) From a79237b02090df922f54b1082515139a59f04874 Mon Sep 17 00:00:00 2001 From: Dhruvdutt Jadhav Date: Thu, 17 Aug 2017 22:54:31 +0530 Subject: [PATCH 022/302] =?UTF-8?q?[guide]=20[react]=20add=20another=20?= =?UTF-8?q?=E2=80=9Cgood=E2=80=9D=20example?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- react/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/react/README.md b/react/README.md index b86f743f23..b1ba2ac7a7 100644 --- a/react/README.md +++ b/react/README.md @@ -269,6 +269,9 @@