Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 52d3401

Browse files
committed
[eslint config] [eslint config base] [breaking] Migrate non-React rules to a separate linter config.
1 parent bdbecf2 commit 52d3401

27 files changed

+199
-56
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ node_js:
55
- "iojs"
66
env:
77
- 'TEST_DIR=packages/eslint-config-airbnb'
8+
- 'TEST_DIR=packages/eslint-config-airbnb-base'
89
before_install:
910
- 'cd $TEST_DIR'
1011
- 'if [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g [email protected] ;; 2.*) npm install -g npm@2 ;; esac ; fi'

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*A mostly reasonable approach to JavaScript*
44

55
[![Downloads](https://img.shields.io/npm/dm/eslint-config-airbnb.svg)](https://www.npmjs.com/package/eslint-config-airbnb)
6+
[![Downloads](https://img.shields.io/npm/dm/eslint-config-airbnb-base.svg)](https://www.npmjs.com/package/eslint-config-airbnb-base)
67
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/airbnb/javascript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
78

89
Other Style Guides

linters/README.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"version": "2.0.0",
44
"description": "A mostly reasonable approach to JavaScript.",
55
"scripts": {
6-
"test": "echo \"Error: no test specified\" && exit 1",
7-
"publish-all": "npm publish && cd ./packages/eslint-config-airbnb && npm publish"
6+
"test": "echo \"Error: no test specified\" && exit 1"
87
},
98
"repository": {
109
"type": "git",
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./index.js",
3+
"rules": {
4+
// disable requiring trailing commas because it might be nice to revert to
5+
// being JSON at some point, and I don't want to make big changes now.
6+
"comma-dangle": 0
7+
}
8+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
1.0.0 / 2016-04-16
2+
==================
3+
- Initial commmit; moved content over from `eslint-config-airbnb` package.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# eslint-config-airbnb-base
2+
3+
[![npm version](https://badge.fury.io/js/eslint-config-airbnb-base.svg)](http://badge.fury.io/js/eslint-config-airbnb-base)
4+
5+
This package provides Airbnb's base JS .eslintrc as an extensible shared config.
6+
7+
## Usage
8+
9+
We export two ESLint configurations for your usage.
10+
11+
### eslint-config-airbnb-base
12+
13+
Our default export contains all of our ESLint rules, including ECMAScript 6+ and React. It requires `eslint` and `eslint-plugin-import`.
14+
15+
1. `npm install --save-dev eslint-config-airbnb-base eslint-plugin-import eslint`
16+
2. add `"extends": "airbnb-base"` to your .eslintrc
17+
18+
### eslint-config-airbnb-base/legacy
19+
20+
Lints ES5 and below. Requires `eslint` and `eslint-plugin-import`.
21+
22+
1. `npm install --save-dev eslint-config-airbnb-base eslint-plugin-import eslint`
23+
2. add `"extends": "airbnb-base/legacy"` to your .eslintrc
24+
25+
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](http://eslint.org/docs/user-guide/configuring#extending-configuration-files) for more information.
26+
27+
## Improving this config
28+
29+
Consider adding test cases if you're making complicated rules changes, like anything involving regexes. Perhaps in a distant future, we could use literate programming to structure our README as test cases for our .eslintrc?
30+
31+
You can run tests with `npm test`.
32+
33+
You can make sure this module lints with itself using `npm run lint`.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
extends: [
3+
'./legacy',
4+
'./rules/es6',
5+
].map(require.resolve),
6+
parserOptions: {
7+
ecmaVersion: 7,
8+
sourceType: 'module',
9+
},
10+
rules: {
11+
strict: 2,
12+
}
13+
};
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = {
2+
extends: [
3+
'./rules/best-practices',
4+
'./rules/errors',
5+
'./rules/legacy',
6+
'./rules/node',
7+
'./rules/style',
8+
'./rules/variables'
9+
].map(require.resolve),
10+
env: {
11+
browser: true,
12+
node: true,
13+
amd: false,
14+
mocha: false,
15+
jasmine: false
16+
},
17+
ecmaFeatures: {},
18+
globals: {},
19+
rules: {}
20+
};
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"name": "eslint-config-airbnb-base",
3+
"version": "1.0.0",
4+
"description": "Airbnb's base JS ESLint config, following our styleguide",
5+
"main": "index.js",
6+
"scripts": {
7+
"lint": "eslint .",
8+
"tests-only": "babel-tape-runner ./test/test-*.js",
9+
"pretest": "eslint-find-rules --unused",
10+
"test": "npm run --silent lint && npm run --silent tests-only"
11+
},
12+
"repository": {
13+
"type": "git",
14+
"url": "https://github.com/airbnb/javascript"
15+
},
16+
"keywords": [
17+
"eslint",
18+
"eslintconfig",
19+
"config",
20+
"airbnb",
21+
"javascript",
22+
"styleguide"
23+
],
24+
"author": "Jake Teton-Landis (https://twitter.com/@jitl)",
25+
"contributors": [
26+
{
27+
"name": "Jake Teton-Landis",
28+
"url": "https://twitter.com/jitl"
29+
},
30+
{
31+
"name": "Jordan Harband",
32+
"email": "[email protected]",
33+
"url": "http://ljharb.codes"
34+
},
35+
{
36+
"name": "Harrison Shoff",
37+
"url": "https://twitter.com/hshoff"
38+
}
39+
],
40+
"license": "MIT",
41+
"bugs": {
42+
"url": "https://github.com/airbnb/javascript/issues"
43+
},
44+
"homepage": "https://github.com/airbnb/javascript",
45+
"devDependencies": {
46+
"babel-tape-runner": "^1.3.1",
47+
"eslint": "^2.8.0",
48+
"eslint-find-rules": "^1.3.0",
49+
"eslint-plugin-import": "^1.5.0",
50+
"tape": "^4.5.1"
51+
},
52+
"peerDependencies": {
53+
"eslint": "^2.8.0",
54+
"eslint-plugin-import": "^1.5.0"
55+
}
56+
}

0 commit comments

Comments
 (0)