Skip to content

Commit 26194e2

Browse files
committed
Merge pull request airbnb#448 from justjake/jake/packages
[eslint] restructure eslint-config-airbnb, move .eslintrc
2 parents 1b212cf + dbbf71b commit 26194e2

File tree

5 files changed

+235
-223
lines changed

5 files changed

+235
-223
lines changed

linters/.eslintrc

Lines changed: 3 additions & 215 deletions
Original file line numberDiff line numberDiff line change
@@ -1,217 +1,5 @@
1+
// Use this file as a starting point for your project's .eslintrc.
2+
// Copy this file, and add rule overrides as needed.
13
{
2-
"parser": "babel-eslint", // https://github.com/babel/babel-eslint
3-
"plugins": [
4-
"react" // https://github.com/yannickcr/eslint-plugin-react
5-
],
6-
"env": { // http://eslint.org/docs/user-guide/configuring.html#specifying-environments
7-
"browser": true, // browser global variables
8-
"node": true // Node.js global variables and Node.js-specific rules
9-
},
10-
"ecmaFeatures": {
11-
"arrowFunctions": true,
12-
"blockBindings": true,
13-
"classes": true,
14-
"defaultParams": true,
15-
"destructuring": true,
16-
"forOf": true,
17-
"generators": false,
18-
"modules": true,
19-
"objectLiteralComputedProperties": true,
20-
"objectLiteralDuplicateProperties": false,
21-
"objectLiteralShorthandMethods": true,
22-
"objectLiteralShorthandProperties": true,
23-
"spread": true,
24-
"superInFunctions": true,
25-
"templateStrings": true,
26-
"jsx": true
27-
},
28-
"rules": {
29-
/**
30-
* Strict mode
31-
*/
32-
// babel inserts "use strict"; for us
33-
"strict": [2, "never"], // http://eslint.org/docs/rules/strict
34-
35-
/**
36-
* ES6
37-
*/
38-
"no-var": 2, // http://eslint.org/docs/rules/no-var
39-
"prefer-const": 2, // http://eslint.org/docs/rules/prefer-const
40-
41-
/**
42-
* Variables
43-
*/
44-
"no-shadow": 2, // http://eslint.org/docs/rules/no-shadow
45-
"no-shadow-restricted-names": 2, // http://eslint.org/docs/rules/no-shadow-restricted-names
46-
"no-unused-vars": [2, { // http://eslint.org/docs/rules/no-unused-vars
47-
"vars": "local",
48-
"args": "after-used"
49-
}],
50-
"no-use-before-define": 2, // http://eslint.org/docs/rules/no-use-before-define
51-
52-
/**
53-
* Possible errors
54-
*/
55-
"comma-dangle": [2, "always-multiline"], // http://eslint.org/docs/rules/comma-dangle
56-
"no-cond-assign": [2, "always"], // http://eslint.org/docs/rules/no-cond-assign
57-
"no-console": 1, // http://eslint.org/docs/rules/no-console
58-
"no-debugger": 1, // http://eslint.org/docs/rules/no-debugger
59-
"no-alert": 1, // http://eslint.org/docs/rules/no-alert
60-
"no-constant-condition": 1, // http://eslint.org/docs/rules/no-constant-condition
61-
"no-dupe-keys": 2, // http://eslint.org/docs/rules/no-dupe-keys
62-
"no-duplicate-case": 2, // http://eslint.org/docs/rules/no-duplicate-case
63-
"no-empty": 2, // http://eslint.org/docs/rules/no-empty
64-
"no-ex-assign": 2, // http://eslint.org/docs/rules/no-ex-assign
65-
"no-extra-boolean-cast": 0, // http://eslint.org/docs/rules/no-extra-boolean-cast
66-
"no-extra-semi": 2, // http://eslint.org/docs/rules/no-extra-semi
67-
"no-func-assign": 2, // http://eslint.org/docs/rules/no-func-assign
68-
"no-inner-declarations": 2, // http://eslint.org/docs/rules/no-inner-declarations
69-
"no-invalid-regexp": 2, // http://eslint.org/docs/rules/no-invalid-regexp
70-
"no-irregular-whitespace": 2, // http://eslint.org/docs/rules/no-irregular-whitespace
71-
"no-obj-calls": 2, // http://eslint.org/docs/rules/no-obj-calls
72-
"no-sparse-arrays": 2, // http://eslint.org/docs/rules/no-sparse-arrays
73-
"no-unreachable": 2, // http://eslint.org/docs/rules/no-unreachable
74-
"use-isnan": 2, // http://eslint.org/docs/rules/use-isnan
75-
"block-scoped-var": 2, // http://eslint.org/docs/rules/block-scoped-var
76-
77-
/**
78-
* Best practices
79-
*/
80-
"consistent-return": 2, // http://eslint.org/docs/rules/consistent-return
81-
"curly": [2, "multi-line"], // http://eslint.org/docs/rules/curly
82-
"default-case": 2, // http://eslint.org/docs/rules/default-case
83-
"dot-notation": [2, { // http://eslint.org/docs/rules/dot-notation
84-
"allowKeywords": true
85-
}],
86-
"eqeqeq": 2, // http://eslint.org/docs/rules/eqeqeq
87-
"guard-for-in": 2, // http://eslint.org/docs/rules/guard-for-in
88-
"no-caller": 2, // http://eslint.org/docs/rules/no-caller
89-
"no-else-return": 2, // http://eslint.org/docs/rules/no-else-return
90-
"no-eq-null": 2, // http://eslint.org/docs/rules/no-eq-null
91-
"no-eval": 2, // http://eslint.org/docs/rules/no-eval
92-
"no-extend-native": 2, // http://eslint.org/docs/rules/no-extend-native
93-
"no-extra-bind": 2, // http://eslint.org/docs/rules/no-extra-bind
94-
"no-fallthrough": 2, // http://eslint.org/docs/rules/no-fallthrough
95-
"no-floating-decimal": 2, // http://eslint.org/docs/rules/no-floating-decimal
96-
"no-implied-eval": 2, // http://eslint.org/docs/rules/no-implied-eval
97-
"no-lone-blocks": 2, // http://eslint.org/docs/rules/no-lone-blocks
98-
"no-loop-func": 2, // http://eslint.org/docs/rules/no-loop-func
99-
"no-multi-str": 2, // http://eslint.org/docs/rules/no-multi-str
100-
"no-native-reassign": 2, // http://eslint.org/docs/rules/no-native-reassign
101-
"no-new": 2, // http://eslint.org/docs/rules/no-new
102-
"no-new-func": 2, // http://eslint.org/docs/rules/no-new-func
103-
"no-new-wrappers": 2, // http://eslint.org/docs/rules/no-new-wrappers
104-
"no-octal": 2, // http://eslint.org/docs/rules/no-octal
105-
"no-octal-escape": 2, // http://eslint.org/docs/rules/no-octal-escape
106-
"no-param-reassign": 2, // http://eslint.org/docs/rules/no-param-reassign
107-
"no-proto": 2, // http://eslint.org/docs/rules/no-proto
108-
"no-redeclare": 2, // http://eslint.org/docs/rules/no-redeclare
109-
"no-return-assign": 2, // http://eslint.org/docs/rules/no-return-assign
110-
"no-script-url": 2, // http://eslint.org/docs/rules/no-script-url
111-
"no-self-compare": 2, // http://eslint.org/docs/rules/no-self-compare
112-
"no-sequences": 2, // http://eslint.org/docs/rules/no-sequences
113-
"no-throw-literal": 2, // http://eslint.org/docs/rules/no-throw-literal
114-
"no-with": 2, // http://eslint.org/docs/rules/no-with
115-
"radix": 2, // http://eslint.org/docs/rules/radix
116-
"vars-on-top": 2, // http://eslint.org/docs/rules/vars-on-top
117-
"wrap-iife": [2, "any"], // http://eslint.org/docs/rules/wrap-iife
118-
"yoda": 2, // http://eslint.org/docs/rules/yoda
119-
120-
/**
121-
* Style
122-
*/
123-
"indent": [2, 2], // http://eslint.org/docs/rules/indent
124-
"brace-style": [2, // http://eslint.org/docs/rules/brace-style
125-
"1tbs", {
126-
"allowSingleLine": true
127-
}],
128-
"quotes": [
129-
2, "single", "avoid-escape" // http://eslint.org/docs/rules/quotes
130-
],
131-
"camelcase": [2, { // http://eslint.org/docs/rules/camelcase
132-
"properties": "never"
133-
}],
134-
"comma-spacing": [2, { // http://eslint.org/docs/rules/comma-spacing
135-
"before": false,
136-
"after": true
137-
}],
138-
"comma-style": [2, "last"], // http://eslint.org/docs/rules/comma-style
139-
"eol-last": 2, // http://eslint.org/docs/rules/eol-last
140-
"func-names": 1, // http://eslint.org/docs/rules/func-names
141-
"key-spacing": [2, { // http://eslint.org/docs/rules/key-spacing
142-
"beforeColon": false,
143-
"afterColon": true
144-
}],
145-
"new-cap": [2, { // http://eslint.org/docs/rules/new-cap
146-
"newIsCap": true
147-
}],
148-
"no-multiple-empty-lines": [2, { // http://eslint.org/docs/rules/no-multiple-empty-lines
149-
"max": 2
150-
}],
151-
"no-nested-ternary": 2, // http://eslint.org/docs/rules/no-nested-ternary
152-
"no-new-object": 2, // http://eslint.org/docs/rules/no-new-object
153-
"no-spaced-func": 2, // http://eslint.org/docs/rules/no-spaced-func
154-
"no-trailing-spaces": 2, // http://eslint.org/docs/rules/no-trailing-spaces
155-
"no-extra-parens": [2, "functions"], // http://eslint.org/docs/rules/no-extra-parens
156-
"no-underscore-dangle": 0, // http://eslint.org/docs/rules/no-underscore-dangle
157-
"one-var": [2, "never"], // http://eslint.org/docs/rules/one-var
158-
"padded-blocks": [2, "never"], // http://eslint.org/docs/rules/padded-blocks
159-
"semi": [2, "always"], // http://eslint.org/docs/rules/semi
160-
"semi-spacing": [2, { // http://eslint.org/docs/rules/semi-spacing
161-
"before": false,
162-
"after": true
163-
}],
164-
"space-after-keywords": 2, // http://eslint.org/docs/rules/space-after-keywords
165-
"space-before-blocks": 2, // http://eslint.org/docs/rules/space-before-blocks
166-
"space-before-function-paren": [2, "never"], // http://eslint.org/docs/rules/space-before-function-paren
167-
"space-infix-ops": 2, // http://eslint.org/docs/rules/space-infix-ops
168-
"space-return-throw-case": 2, // http://eslint.org/docs/rules/space-return-throw-case
169-
"spaced-comment": 2, // http://eslint.org/docs/rules/spaced-comment
170-
171-
/**
172-
* JSX style
173-
*/
174-
"react/display-name": 0, // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/display-name.md
175-
"react/jsx-boolean-value": 2, // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md
176-
"react/jsx-quotes": [2, "double"], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-quotes.md
177-
"react/jsx-no-undef": 2, // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md
178-
"react/jsx-sort-props": 0, // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md
179-
"react/jsx-sort-prop-types": 0, // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-prop-types.md
180-
"react/jsx-uses-react": 2, // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-react.md
181-
"react/jsx-uses-vars": 2, // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md
182-
"react/no-did-mount-set-state": [2, "allow-in-func"], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-mount-set-state.md
183-
"react/no-did-update-set-state": 2, // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-update-set-state.md
184-
"react/no-multi-comp": 2, // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md
185-
"react/no-unknown-property": 2, // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md
186-
"react/prop-types": 2, // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md
187-
"react/react-in-jsx-scope": 2, // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md
188-
"react/self-closing-comp": 2, // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md
189-
"react/wrap-multilines": 2, // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/wrap-multilines.md
190-
"react/sort-comp": [2, { // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-comp.md
191-
"order": [
192-
"displayName",
193-
"propTypes",
194-
"contextTypes",
195-
"childContextTypes",
196-
"mixins",
197-
"statics",
198-
"defaultProps",
199-
"constructor",
200-
"getDefaultProps",
201-
"getInitialState",
202-
"getChildContext",
203-
"componentWillMount",
204-
"componentDidMount",
205-
"componentWillReceiveProps",
206-
"shouldComponentUpdate",
207-
"componentWillUpdate",
208-
"componentDidUpdate",
209-
"componentWillUnmount",
210-
"/^on.+$/",
211-
"/^get.+$/",
212-
"/^render.+$/",
213-
"render"
214-
]
215-
}]
216-
}
4+
"extends": "airbnb"
2175
}

0 commit comments

Comments
 (0)