Skip to content

Commit

Permalink
Merge branch 'master' into shar--always-use-parens-for-arrow-functions
Browse files Browse the repository at this point in the history
  • Loading branch information
sharmilajesupaul authored Jul 29, 2019
2 parents cf57435 + 030e23b commit e1cef35
Show file tree
Hide file tree
Showing 17 changed files with 262 additions and 57 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
language: node_js
node_js:
- "11"
- "10"
- "9"
- "8"
Expand Down
104 changes: 80 additions & 24 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@
},
"homepage": "https://github.com/airbnb/javascript",
"devDependencies": {
"markdownlint-cli": "^0.10.0"
"markdownlint-cli": "^0.13.0"
}
}
14 changes: 14 additions & 0 deletions packages/eslint-config-airbnb-base/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
13.2.0 / 2019-07-01
==================
- [minor] Enforce dangling underscores in method names (#1907)
- [fix] disable `no-var` in legacy entry point
- [patch] Ignore property modifications of `staticContext` params (#2029)
- [patch] `no-extraneous-dependencies`: Add jest.setup.js to devDeps (#1998)
- [meta] add disabled `prefer-named-capture-group` rule
- [meta] add disabled `no-useless-catch` config
- [deps] Switch to confusing-browser-globals (#1961)
- [deps] update `object.entries`, `eslint-plugin-import`, `eslint-plugin-jsx-a11y`, `eslint-plugin-react`, `tape`
- [docs] correct JavaScript capitalization (#2046)
- [readme] Improve eslint config setup instructions for yarn (#2001)
- [docs] fix docs for whitespace config (#1914, #1871)

13.1.0 / 2018-08-13
==================
- [new] add eslint v5 support (#1834)
Expand Down
8 changes: 5 additions & 3 deletions packages/eslint-config-airbnb-base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ 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 `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.

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

```sh
Expand All @@ -26,6 +24,10 @@ If you use yarn, run `npm info "eslint-config-airbnb-base@latest" peerDependenci
npx install-peerdeps --dev eslint-config-airbnb-base
```

If using **yarn**, you can also use the shortcut described above if you have npm 5+ installed on your machine, as the command will detect that you are using yarn and will act accordingly.
Otherwise, 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.


If using **npm < 5**, Linux/OSX users can run

```sh
Expand Down Expand Up @@ -82,7 +84,7 @@ Lints ES5 and below. Requires `eslint` and `eslint-plugin-import`.

2. Add `"extends": "airbnb-base/legacy"` to your .eslintrc

See [Airbnb's overarching ESLint config](https://npmjs.com/eslint-config-airbnb), [Airbnb's Javascript styleguide](https://github.com/airbnb/javascript), and the [ESlint config docs](https://eslint.org/docs/user-guide/configuring#extending-configuration-files) for more information.
See [Airbnb's overarching ESLint config](https://npmjs.com/eslint-config-airbnb), [Airbnb's JavaScript styleguide](https://github.com/airbnb/javascript), and the [ESlint config docs](https://eslint.org/docs/user-guide/configuring#extending-configuration-files) for more information.

### eslint-config-airbnb-base/whitespace

Expand Down
1 change: 1 addition & 0 deletions packages/eslint-config-airbnb-base/legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ module.exports = {
property: '__defineSetter__',
message: 'Please use Object.defineProperty instead.',
}],
'no-var': 'off'
}
};
14 changes: 7 additions & 7 deletions packages/eslint-config-airbnb-base/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-airbnb-base",
"version": "13.1.0",
"version": "13.2.0",
"description": "Airbnb's base JS ESLint config, following our styleguide",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -53,26 +53,26 @@
},
"homepage": "https://github.com/airbnb/javascript",
"devDependencies": {
"babel-preset-airbnb": "^2.5.3",
"babel-preset-airbnb": "^2.6.0",
"babel-tape-runner": "^2.0.1",
"editorconfig-tools": "^0.1.1",
"eslint": "^4.19.1 || ^5.3.0",
"eslint-find-rules": "^3.3.1",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-import": "^2.18.0",
"in-publish": "^2.0.0",
"safe-publish-latest": "^1.1.2",
"tape": "^4.9.1"
"tape": "^4.11.0"
},
"peerDependencies": {
"eslint": "^4.19.1 || ^5.3.0",
"eslint-plugin-import": "^2.14.0"
"eslint-plugin-import": "^2.18.0"
},
"engines": {
"node": ">= 4"
},
"dependencies": {
"confusing-browser-globals": "^1.0.5",
"confusing-browser-globals": "^1.0.7",
"object.assign": "^4.1.0",
"object.entries": "^1.0.4"
"object.entries": "^1.1.0"
}
}
10 changes: 10 additions & 0 deletions packages/eslint-config-airbnb-base/rules/best-practices.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ module.exports = {
'res', // for Express responses
'response', // for Express responses
'$scope', // for Angular 1 scopes
'staticContext', // for ReactRouter context
]
}],

Expand Down Expand Up @@ -280,6 +281,11 @@ module.exports = {
// disallow unnecessary .call() and .apply()
'no-useless-call': 'off',

// Disallow unnecessary catch clauses
// https://eslint.org/docs/rules/no-useless-catch
// TODO: enable, semver-major
'no-useless-catch': 'off',

// disallow useless string concatenation
// https://eslint.org/docs/rules/no-useless-concat
'no-useless-concat': 'error',
Expand All @@ -306,6 +312,10 @@ module.exports = {
// https://eslint.org/docs/rules/prefer-promise-reject-errors
'prefer-promise-reject-errors': ['error', { allowEmptyReject: true }],

// Suggest using named capture group in regular expression
// https://eslint.org/docs/rules/prefer-named-capture-group
'prefer-named-capture-group': 'off',

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

Expand Down
1 change: 1 addition & 0 deletions packages/eslint-config-airbnb-base/rules/es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ module.exports = {
// https://eslint.org/docs/rules/sort-imports
'sort-imports': ['off', {
ignoreCase: false,
ignoreDeclarationSort: false,
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
}],
Expand Down
14 changes: 14 additions & 0 deletions packages/eslint-config-airbnb-base/rules/imports.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ module.exports = {
'test-*.{js,jsx}', // repos with multiple top-level test files
'**/*{.,_}{test,spec}.{js,jsx}', // tests where the extension or filename suffix denotes that it is a test
'**/jest.config.js', // jest config
'**/jest.setup.js', // jest setup
'**/vue.config.js', // vue-cli config
'**/webpack.config.js', // webpack config
'**/webpack.config.*.js', // webpack config
Expand Down Expand Up @@ -221,6 +222,10 @@ module.exports = {
// https://github.com/benmosher/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/no-default-export.md
'import/no-default-export': 'off',

// Prohibit named exports. this is a terrible rule, do not use it.
// https://github.com/benmosher/eslint-plugin-import/blob/1ec80fa35fa1819e2d35a70e68fb6a149fb57c5e/docs/rules/no-named-export.md
'import/no-named-export': 'off',

// Forbid a module from importing itself
// https://github.com/benmosher/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/no-self-import.md
'import/no-self-import': 'error',
Expand All @@ -243,5 +248,14 @@ module.exports = {
// Use this rule to prevent imports to folders in relative parent paths.
// https://github.com/benmosher/eslint-plugin-import/blob/c34f14f67f077acd5a61b3da9c0b0de298d20059/docs/rules/no-relative-parent-imports.md
'import/no-relative-parent-imports': 'off',

// Reports modules without any exports, or with unused exports
// https://github.com/benmosher/eslint-plugin-import/blob/f63dd261809de6883b13b6b5b960e6d7f42a7813/docs/rules/no-unused-modules.md
// TODO: enable, semver-major
'import/no-unused-modules': ['off', {
ignoreExports: [],
missingExports: true,
unusedExports: true,
}],
},
};
8 changes: 7 additions & 1 deletion packages/eslint-config-airbnb-base/rules/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,13 @@ module.exports = {
'operator-linebreak': ['error', 'before', { overrides: { '=': 'none' } }],

// disallow padding within blocks
'padded-blocks': ['error', { blocks: 'never', classes: 'never', switches: 'never' }],
// TODO, semver-major: uncomment option
'padded-blocks': ['error', {
blocks: 'never',
classes: 'never',
switches: 'never',
// allowSingleLineBlocks: true,
}],

// Require or disallow padding lines between statements
// https://eslint.org/docs/rules/padding-line-between-statements
Expand Down
10 changes: 10 additions & 0 deletions packages/eslint-config-airbnb/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
17.1.1 / 2019-07-01
==================
- [patch] Turn off `react/no-multi-comp` (#2006)
- [patch] extend `no-underscore-dangle` to allow for redux dev tools in the main config instead (#1996)
- [meta] add disabled `jsx-fragments` rule
- [deps] update `eslint-config-airbnb-base`, `object.entries`, `eslint-plugin-import`, `eslint-plugin-react`, `eslint-plugin-jsx-a11y`, `babel-preset-airbnb`, `tape` (#2005, etc)
- [docs] correct JavaScript capitalization (#2046)
- [docs] fix docs for whitespace config (#1914, #1871)
- [readme] Improve eslint config setup instructions for yarn (#2001)

17.1.0 / 2018-08-13
==================
- [new] add eslint v5 support
Expand Down
7 changes: 4 additions & 3 deletions packages/eslint-config-airbnb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ 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 `npm info "eslint-config-airbnb@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.

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

```sh
Expand All @@ -26,6 +24,9 @@ If you use yarn, run `npm info "eslint-config-airbnb@latest" peerDependencies` t
npx install-peerdeps --dev eslint-config-airbnb
```

If using **yarn**, you can also use the shortcut described above if you have npm 5+ installed on your machine, as the command will detect that you are using yarn and will act accordingly.
Otherwise, run `npm info "eslint-config-airbnb@latest" peerDependencies` to list the peer dependencies and versions, then run `yarn add --dev <dependency>@<version>` for each listed peer dependency.

If using **npm < 5**, Linux/OSX users can run

```sh
Expand Down Expand Up @@ -67,7 +68,7 @@ This entry point is deprecated. See [eslint-config-airbnb-base](https://npmjs.co

This entry point is deprecated. See [eslint-config-airbnb-base](https://npmjs.com/eslint-config-airbnb-base).

See [Airbnb's Javascript styleguide](https://github.com/airbnb/javascript) and
See [Airbnb's JavaScript styleguide](https://github.com/airbnb/javascript) and
the [ESlint config docs](https://eslint.org/docs/user-guide/configuring#extending-configuration-files)
for more information.

Expand Down
24 changes: 12 additions & 12 deletions packages/eslint-config-airbnb/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-airbnb",
"version": "17.1.0",
"version": "17.1.1",
"description": "Airbnb's ESLint config, following our styleguide",
"main": "index.js",
"scripts": {
Expand All @@ -11,7 +11,7 @@
"prepublish": "(in-install || eslint-find-rules --unused) && (not-in-publish || npm test) && safe-publish-latest",
"pretest": "npm run --silent lint",
"test": "npm run --silent tests-only",
"link:eslint": "cd node_modules/eslint && npm link && cd -",
"link:eslint": "cd node_modules/eslint && npm link --production && cd -",
"pretravis": "npm run link:eslint && cd ../eslint-config-airbnb-base && npm link eslint && npm install && npm link && cd - && npm link --no-save eslint-config-airbnb-base",
"travis": "npm run --silent test",
"posttravis": "npm unlink --no-save eslint-config-airbnb-base eslint >/dev/null &"
Expand Down Expand Up @@ -54,29 +54,29 @@
},
"homepage": "https://github.com/airbnb/javascript",
"dependencies": {
"eslint-config-airbnb-base": "^13.1.0",
"eslint-config-airbnb-base": "^13.2.0",
"object.assign": "^4.1.0",
"object.entries": "^1.0.4"
"object.entries": "^1.1.0"
},
"devDependencies": {
"babel-preset-airbnb": "^2.5.3",
"babel-preset-airbnb": "^2.6.0",
"babel-tape-runner": "^2.0.1",
"editorconfig-tools": "^0.1.1",
"eslint": "^4.19.1 || ^5.3.0",
"eslint-find-rules": "^3.3.1",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.1",
"eslint-plugin-react": "^7.11.0",
"eslint-plugin-import": "^2.18.0",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.14.2",
"in-publish": "^2.0.0",
"react": ">= 0.13.0",
"safe-publish-latest": "^1.1.2",
"tape": "^4.9.1"
"tape": "^4.11.0"
},
"peerDependencies": {
"eslint": "^4.19.1 || ^5.3.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.1",
"eslint-plugin-react": "^7.11.0"
"eslint-plugin-import": "^2.18.0",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.14.2"
},
"engines": {
"node": ">= 4"
Expand Down
30 changes: 30 additions & 0 deletions packages/eslint-config-airbnb/rules/react-a11y.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,36 @@ module.exports = {
depth: 25
}],

// Enforce that a control (an interactive element) has a text label.
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/control-has-associated-label.md
// TODO, semver-major: enable
'jsx-a11y/control-has-associated-label': ['off', {
labelAttributes: ['label'],
controlComponents: [],
ignoreElements: [
'audio',
'canvas',
'embed',
'input',
'textarea',
'tr',
'video',
],
ignoreRoles: [
'grid',
'listbox',
'menu',
'menubar',
'radiogroup',
'row',
'tablist',
'toolbar',
'tree',
'treegrid',
],
depth: 5,
}],

// require that mouseover/out come with focus/blur, for keyboard-only users
// 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': 'error',
Expand Down
Loading

0 comments on commit e1cef35

Please sign in to comment.