Skip to content

Commit 69da5ad

Browse files
Merge pull request #1 from airbnb/master
PR latest
2 parents 22c97fa + f8f13d9 commit 69da5ad

21 files changed

Lines changed: 359 additions & 118 deletions

File tree

‎.travis.yml‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,27 @@ before_install:
99
- 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then npm install -g npm@1.3 ; elif [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi'
1010
- 'if [ "${TRAVIS_NODE_VERSION%${TRAVIS_NODE_VERSION#[0-9]}}" = "0" ] || [ "${TRAVIS_NODE_VERSION:0:4}" = "iojs" ]; then npm install -g npm@4.5 ; elif [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then npm install -g npm; fi'
1111
install:
12-
- 'cd "packages/${PACKAGE}"'
12+
- 'if [ -n "${PACKAGE-}" ]; then cd "packages/${PACKAGE}"; fi'
1313
- 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then nvm install 0.8 && npm install -g npm@1.3 && npm install -g npm@1.4.28 && npm install -g npm@2 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;'
14+
- 'if [ -n "${ESLINT}" ]; then npm install --no-save "eslint@${ESLINT}"; fi'
1415
script:
15-
- 'if [ -n "${PREPUBLISH-}" ]; then npm run pretravis && npm run prepublish && npm run posttravis; else npm run travis; fi'
16+
- 'if [ -n "${PREPUBLISH-}" ]; then npm run pretravis && npm run prepublish && npm run posttravis; elif [ -n "${LINT-}" ]; then npm run lint; else npm run travis; fi'
1617
sudo: false
1718
env:
1819
matrix:
19-
- 'TEST=true PACKAGE=eslint-config-airbnb'
20-
- 'TEST=true PACKAGE=eslint-config-airbnb-base'
20+
- 'TEST=true ESLINT=4 PACKAGE=eslint-config-airbnb'
21+
- 'TEST=true ESLINT=4 PACKAGE=eslint-config-airbnb-base'
2122
matrix:
2223
fast_finish: true
2324
include:
2425
- node_js: "node"
25-
env: PREPUBLISH=true PACKAGE=eslint-config-airbnb
26+
env: PREPUBLISH=true ESLINT=4 PACKAGE=eslint-config-airbnb
2627
- node_js: "node"
27-
env: PREPUBLISH=true PACKAGE=eslint-config-airbnb-base
28+
env: PREPUBLISH=true ESLINT=4 PACKAGE=eslint-config-airbnb-base
29+
- node_js: "node"
30+
env: LINT=true
2831
allow_failures:
2932
- node_js: "7"
3033
- node_js: "5"
31-
- env: PREPUBLISH=true PACKAGE=eslint-config-airbnb
32-
- env: PREPUBLISH=true PACKAGE=eslint-config-airbnb-base
34+
- env: PREPUBLISH=true ESLINT=4 PACKAGE=eslint-config-airbnb
35+
- env: PREPUBLISH=true ESLINT=4 PACKAGE=eslint-config-airbnb-base

‎README.md‎

Lines changed: 109 additions & 30 deletions
Large diffs are not rendered by default.

‎packages/eslint-config-airbnb-base/CHANGELOG.md‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1+
12.0.2 / 2017-10-05
2+
==================
3+
- [deps] update `eslint`
4+
5+
12.0.1 / 2017-09-27
6+
==================
7+
- [fix] ensure all JSX elements are ignored by `indent` (#1569)
8+
- [deps] update `eslint`
9+
10+
12.0.0 / 2017-09-02
11+
==================
12+
- [deps] [breaking] require `eslint` v4
13+
- 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-destructuring`
14+
- improve `indent`, `no-multi-spaces`, `no-trailing-spaces`, `no-underscore-dangle`
15+
- [breaking] move `comma-dangle` to Stylistic Issues (#1514)
16+
- [breaking] Rules prohibiting global isNaN, isFinite (#1477)
17+
- [patch] also disallow padding in classes and switches (#1403)
18+
- [patch] support Protractor config files in import/no-extraneous-dependencies (#1543)
19+
20+
11.3.2 / 2017-08-22
21+
==================
22+
- [patch] Add jest.config.js to import/no-extraneous-dependencies devDeps (#1522)
23+
- [patch] Improve Gruntfile glob pattern (#1503)
24+
- [deps] update `eslint` v4, `tape`
25+
- [docs] Specify yarn-specific install instructions (#1511)
26+
27+
11.3.1 / 2017-07-24
28+
==================
29+
- [fix] `legacy`: remove top-level `ecmaFeatures`
30+
31+
11.3.0 / 2017-07-23
32+
==================
33+
- [deps] allow eslint v3 or v4 (#1447)
34+
- [deps] update `eslint-plugin-import`
35+
- [minor] Balanced spacing for inline block comments (#1440)
36+
- [minor] `no-return-assign`: strengthen linting against returning assignments
37+
- [patch] Allow jsx extensions for test files (#1427)
38+
- [patch] `no-restricted-globals`: add confusing globals; leave disabled for now (#1420)
39+
- [patch] Support Protractor config files in import/no-extraneous-dependencies (#1456)
40+
- [docs] Remove TODO in prefer-reflect as it's deprecated (#1452)
41+
- [docs] add yarn instructions (#1463, #1464)
42+
143
11.2.0 / 2017-05-14
244
==================
345
- [minor] Disallow unused global variables

‎packages/eslint-config-airbnb-base/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ We export two ESLint configurations for your usage.
1212

1313
Our default export contains all of our ESLint rules, including ECMAScript 6+. It requires `eslint` and `eslint-plugin-import`.
1414

15-
If you use yarn, run `yarn add --dev eslint-config-airbnb-base eslint-plugin-import`, or see below for npm instructions.
15+
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 <dependency>@<version>` for each listed peer dependency. See below for npm instructions.
1616

1717
1. Install the correct versions of each package, which are listed by the command:
1818

‎packages/eslint-config-airbnb-base/legacy.js‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ module.exports = {
1313
mocha: false,
1414
jasmine: false
1515
},
16-
ecmaFeatures: {},
17-
globals: {},
1816
rules: {
1917
'comma-dangle': ['error', 'never'],
2018
'prefer-numeric-literals': 'off',

‎packages/eslint-config-airbnb-base/package.json‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-config-airbnb-base",
3-
"version": "11.2.0",
3+
"version": "12.0.2",
44
"description": "Airbnb's base JS ESLint config, following our styleguide",
55
"main": "index.js",
66
"scripts": {
@@ -51,16 +51,16 @@
5151
"babel-preset-airbnb": "^2.4.0",
5252
"babel-tape-runner": "^2.0.1",
5353
"editorconfig-tools": "^0.1.1",
54-
"eslint": "^3.19.0",
54+
"eslint": "^4.8.0",
5555
"eslint-find-rules": "^3.1.1",
56-
"eslint-plugin-import": "^2.6.1",
56+
"eslint-plugin-import": "^2.7.0",
5757
"in-publish": "^2.0.0",
5858
"safe-publish-latest": "^1.1.1",
59-
"tape": "^4.7.0"
59+
"tape": "^4.8.0"
6060
},
6161
"peerDependencies": {
62-
"eslint": "^3.19.0",
63-
"eslint-plugin-import": "^2.6.1"
62+
"eslint": "^4.8.0",
63+
"eslint-plugin-import": "^2.7.0"
6464
},
6565
"engines": {
6666
"node": ">= 4"

‎packages/eslint-config-airbnb-base/rules/best-practices.js‎

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ module.exports = {
142142
}],
143143

144144
// disallow use of multiple spaces
145-
'no-multi-spaces': 'error',
145+
'no-multi-spaces': ['error', {
146+
ignoreEOLComments: false,
147+
}],
146148

147149
// disallow use of multiline strings
148150
'no-multi-str': 'error',
@@ -192,6 +194,30 @@ module.exports = {
192194
object: 'arguments',
193195
property: 'callee',
194196
message: 'arguments.callee is deprecated',
197+
}, {
198+
object: 'global',
199+
property: 'isFinite',
200+
message: 'Please use Number.isFinite instead',
201+
}, {
202+
object: 'self',
203+
property: 'isFinite',
204+
message: 'Please use Number.isFinite instead',
205+
}, {
206+
object: 'window',
207+
property: 'isFinite',
208+
message: 'Please use Number.isFinite instead',
209+
}, {
210+
object: 'global',
211+
property: 'isNaN',
212+
message: 'Please use Number.isNaN instead',
213+
}, {
214+
object: 'self',
215+
property: 'isNaN',
216+
message: 'Please use Number.isNaN instead',
217+
}, {
218+
object: 'window',
219+
property: 'isNaN',
220+
message: 'Please use Number.isNaN instead',
195221
}, {
196222
property: '__defineGetter__',
197223
message: 'Please use Object.defineProperty instead.',
@@ -268,8 +294,7 @@ module.exports = {
268294

269295
// require using Error objects as Promise rejection reasons
270296
// http://eslint.org/docs/rules/prefer-promise-reject-errors
271-
// TODO: enable, semver-major
272-
'prefer-promise-reject-errors': ['off', { allowEmptyReject: true }],
297+
'prefer-promise-reject-errors': ['error', { allowEmptyReject: true }],
273298

274299
// require use of the second argument for parseInt()
275300
radix: 'error',

‎packages/eslint-config-airbnb-base/rules/errors.js‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
module.exports = {
22
rules: {
3-
// require trailing commas in multiline object literals
4-
'comma-dangle': ['error', {
5-
arrays: 'always-multiline',
6-
objects: 'always-multiline',
7-
imports: 'always-multiline',
8-
exports: 'always-multiline',
9-
functions: 'always-multiline',
10-
}],
3+
// Enforce “for” loop update clause moving the counter in the right direction
4+
// http://eslint.org/docs/rules/for-direction
5+
'for-direction': 'error',
6+
7+
// Enforces that a return statement is present in property getters
8+
// http://eslint.org/docs/rules/getter-return
9+
'getter-return': ['error', { allowImplicit: true }],
1110

1211
// Disallow await inside of loops
1312
// http://eslint.org/docs/rules/no-await-in-loop
1413
'no-await-in-loop': 'error',
1514

1615
// Disallow comparisons to negative zero
1716
// http://eslint.org/docs/rules/no-compare-neg-zero
18-
// TODO: enable (semver-major)
19-
'no-compare-neg-zero': 'off',
17+
'no-compare-neg-zero': 'error',
2018

2119
// disallow assignment in conditional expressions
2220
'no-cond-assign': ['error', 'always'],
@@ -61,6 +59,8 @@ module.exports = {
6159
conditionalAssign: true,
6260
nestedBinaryExpressions: false,
6361
returnAssign: false,
62+
ignoreJSX: 'all', // delegate to eslint-plugin-react
63+
enforceForArrowConditionals: false,
6464
}],
6565

6666
// disallow unnecessary semicolons

‎packages/eslint-config-airbnb-base/rules/es6.js‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,15 @@ module.exports = {
110110

111111
// Prefer destructuring from arrays and objects
112112
// http://eslint.org/docs/rules/prefer-destructuring
113-
// TODO: enable
114-
'prefer-destructuring': ['off', {
115-
array: true,
116-
object: true,
113+
'prefer-destructuring': ['error', {
114+
VariableDeclarator: {
115+
array: false,
116+
object: true,
117+
},
118+
AssignmentExpression: {
119+
array: true,
120+
object: true,
121+
},
117122
}, {
118123
enforceForRenamedProperties: false,
119124
}],

‎packages/eslint-config-airbnb-base/rules/imports.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,15 @@ module.exports = {
7676
'test.{js,jsx}', // repos with a single test file
7777
'test-*.{js,jsx}', // repos with multiple top-level test files
7878
'**/*.{test,spec}.{js,jsx}', // tests where the extension denotes that it is a test
79+
'**/jest.config.js', // jest config
7980
'**/webpack.config.js', // webpack config
8081
'**/webpack.config.*.js', // webpack config
8182
'**/rollup.config.js', // rollup config
8283
'**/rollup.config.*.js', // rollup config
8384
'**/gulpfile.js', // gulp config
8485
'**/gulpfile.*.js', // gulp config
85-
'**/Gruntfile', // grunt config
86+
'**/Gruntfile{,.js}', // grunt config
87+
'**/protractor.conf.js', // protractor config
8688
'**/protractor.conf.*.js', // protractor config
8789
],
8890
optionalDependencies: false,

0 commit comments

Comments
 (0)