UNPKG

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