Skip to content

Commit 7fa067f

Browse files
committed
Add rule
1 parent f364949 commit 7fa067f

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

etc/eslint/rules/style.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,32 @@
77
*/
88
var rules = {};
99

10+
/**
11+
* Disable requiring line breaks if line breaks already exist between array elements.
12+
*
13+
* @name array-bracket-newline
14+
* @memberof rules
15+
* @type {Array}
16+
* @see [array-bracket-newline]{@link http://eslint.org/docs/rules/array-bracket-newline}
17+
*
18+
* @example
19+
* // Bad...
20+
* var arr = [
21+
* 1, 2
22+
* ];
23+
*
24+
* @example
25+
* // Good...
26+
* var arr = [
27+
* 1,
28+
* 2
29+
* ];
30+
*/
31+
rules[ 'array-bracket-newline' ] = [ 'off', {
32+
'multiline': true,
33+
'minItems': null
34+
}];
35+
1036
/**
1137
* Warn when not having spaces within array brackets. NOTE: disabled as difficult to enforce a general rule. Prefer spaces within array brackets, but allow discretion in balancing readability, clarity, and aesthetics.
1238
*

0 commit comments

Comments
 (0)