1 | module.exports = {
|
2 | 'rules': {
|
3 | // enforce spacing inside array brackets
|
4 | 'array-bracket-spacing': [2, 'never'],
|
5 | // enforce one true brace style
|
6 | 'brace-style': [2, '1tbs', {'allowSingleLine': true }],
|
7 | // require camel case names
|
8 | 'camelcase': [2, {'properties': 'never'}],
|
9 | // enforce spacing before and after comma
|
10 | 'comma-spacing': [2, {'before': false, 'after': true}],
|
11 | // enforce one true comma style
|
12 | 'comma-style': [2, 'last'],
|
13 | // disallow padding inside computed properties
|
14 | 'computed-property-spacing': [2, 'never'],
|
15 | // enforces consistent naming when capturing the current execution context
|
16 | 'consistent-this': 0,
|
17 | // enforce newline at the end of file, with no multiple empty lines
|
18 | 'eol-last': 2,
|
19 | // require function expressions to have a name
|
20 | 'func-names': 1,
|
21 | // enforces use of function declarations or expressions
|
22 | 'func-style': 0,
|
23 | // this option enforces minimum and maximum identifier lengths (variable names, property names etc.)
|
24 | "id-length": [2, {
|
25 | exceptions: [
|
26 | "e", // events
|
27 | "_", // params
|
28 | "i" // fors
|
29 | ]
|
30 | }],
|
31 | // this option sets a specific tab width for your code
|
32 | // https://github.com/eslint/eslint/blob/master/docs/rules/indent.md
|
33 | 'indent': [2, 2, { "SwitchCase": 1, "VariableDeclarator": 1 }],
|
34 | // specify whether double or single quotes should be used in JSX attributes
|
35 | // http://eslint.org/docs/rules/jsx-quotes
|
36 | 'jsx-quotes': [2, 'prefer-double'],
|
37 | // enforces spacing between keys and values in object literal properties
|
38 | 'key-spacing': [2, {'beforeColon': false, 'afterColon': true}],
|
39 | // enforces empty lines around comments
|
40 | 'lines-around-comment': 0,
|
41 | // disallow mixed 'LF' and 'CRLF' as linebreaks
|
42 | 'linebreak-style': 0,
|
43 | // specify the maximum length of a line in your program
|
44 | // https://github.com/eslint/eslint/blob/master/docs/rules/max-len.md
|
45 | 'max-len': [1, 80, 4],
|
46 | // specify the maximum depth callbacks can be nested
|
47 | 'max-nested-callbacks': 0,
|
48 | // require a capital letter for constructors
|
49 | 'new-cap': [2, {'newIsCap': true}],
|
50 | // disallow the omission of parentheses when invoking a constructor with no arguments
|
51 | 'new-parens': 0,
|
52 | // allow/disallow an empty newline after var statement
|
53 | 'newline-after-var': 0,
|
54 | // disallow use of the Array constructor
|
55 | 'no-array-constructor': 0,
|
56 | // disallow use of the continue statement
|
57 | 'no-continue': 0,
|
58 | // disallow comments inline after code
|
59 | 'no-inline-comments': 0,
|
60 | // disallow if as the only statement in an else block
|
61 | 'no-lonely-if': 0,
|
62 | // disallow mixed spaces and tabs for indentation
|
63 | 'no-mixed-spaces-and-tabs': 2,
|
64 | // disallow multiple empty lines and only one newline at the end
|
65 | 'no-multiple-empty-lines': [2, {'max': 2, 'maxEOF': 1}],
|
66 | // disallow nested ternary expressions
|
67 | 'no-nested-ternary': 2,
|
68 | // disallow use of the Object constructor
|
69 | 'no-new-object': 2,
|
70 | // disallow space between function identifier and application
|
71 | 'no-spaced-func': 2,
|
72 | // disallow the use of ternary operators
|
73 | 'no-ternary': 0,
|
74 | // disallow trailing whitespace at the end of lines
|
75 | 'no-trailing-spaces': 2,
|
76 | // disallow dangling underscores in identifiers
|
77 | 'no-underscore-dangle': 0,
|
78 | // disallow the use of Boolean literals in conditional expressions
|
79 | 'no-unneeded-ternary': 0,
|
80 | // require padding inside curly braces
|
81 | 'object-curly-spacing': [2, 'always'],
|
82 | // allow just one var statement per function
|
83 | 'one-var': [2, 'never'],
|
84 | // require assignment operator shorthand where possible or prohibit it entirely
|
85 | 'operator-assignment': 0,
|
86 | // enforce operators to be placed before or after line breaks
|
87 | 'operator-linebreak': 0,
|
88 | // enforce padding within blocks
|
89 | 'padded-blocks': [2, 'never'],
|
90 | // require quotes around object literal property names
|
91 | 'quote-props': 0,
|
92 | // specify whether double or single quotes should be used
|
93 | 'quotes': [2, 'single', 'avoid-escape'],
|
94 | // require identifiers to match the provided regular expression
|
95 | 'id-match': 0,
|
96 | // enforce spacing before and after semicolons
|
97 | 'semi-spacing': [2, {'before': false, 'after': true}],
|
98 | // require or disallow use of semicolons instead of ASI
|
99 | 'semi': [2, 'always'],
|
100 | // sort variables within the same declaration block
|
101 | 'sort-vars': 0,
|
102 | // require a space before certain keywords
|
103 | 'space-before-keywords': [2, 'always'],
|
104 | // require a space after certain keywords
|
105 | 'space-after-keywords': [2, 'always'],
|
106 | // require or disallow space before blocks
|
107 | 'space-before-blocks': 2,
|
108 | // require or disallow space before function opening parenthesis
|
109 | // https://github.com/eslint/eslint/blob/master/docs/rules/space-before-function-paren.md
|
110 | 'space-before-function-paren': [2, { 'anonymous': 'always', 'named': 'never' }],
|
111 | // require or disallow spaces inside parentheses
|
112 | 'space-in-parens': [2, 'never'],
|
113 | // require spaces around operators
|
114 | 'space-infix-ops': 2,
|
115 | // require a space after return, throw, and case
|
116 | 'space-return-throw-case': 2,
|
117 | // Require or disallow spaces before/after unary operators
|
118 | 'space-unary-ops': 0,
|
119 | // require or disallow a space immediately following the // or /* in a comment
|
120 | 'spaced-comment': [2, 'always', {
|
121 | 'exceptions': ['-', '+'],
|
122 | 'markers': ['=', '!'] // space here to support sprockets directives
|
123 | }],
|
124 | // require regex literals to be wrapped in parentheses
|
125 | 'wrap-regex': 0
|
126 | }
|
127 | };
|