-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
64 lines (53 loc) · 2.13 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
module.exports = {
// Build upon Airbnb JavaScript style guide
// https://github.com/airbnb/javascript
// https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb
extends: 'airbnb',
// Environments define global variables that are predefined.
// http://eslint.org/docs/user-guide/configuring.html#specifying-environments
env: {
// Enforce explicit globals via window.foo
browser: false,
// jasmine, describe, it, expect etc.
jasmine: true,
},
globals: {
window: false,
},
// Override some rules in the Airbnb style guide to match
// our setup and preferences.
rules: {
// Allow ++ operator
// https://eslint.org/docs/rules/no-plusplus
'no-plusplus': 'off',
// React / JSX
// -----------
//
// The following rules overwrite the AirBnB rules for React / JSX:
// https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb/rules/react.js
// In JSX, prefer single quotes
// https://eslint.org/docs/rules/jsx-quotes
'jsx-quotes': ['warn', 'prefer-single'],
// Restrict file extensions that may contain JSX
// Disable rule since we’re using .js instead of .jsx
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
'react/jsx-filename-extension': 'off',
// Prevent missing React when using JSX
// Disable since it does not make sense for Preact
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md
'react/react-in-jsx-scope': 'off',
// Stylistic rules
// ---------------
// Limit Maximum Length of Line
// http://eslint.org/docs/rules/max-len.html
'max-len': ['warn', 80, 2, { ignoreUrls: true }],
// eslint-plugin-import
// --------------------
//
// ESLint plugin with rules that help validate proper imports.
// Ensure imports point to a file/module that can be resolved.
// Disable since it makes no sense in a Webpack project
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md
'import/no-unresolved': 'off',
},
};