Skip to content

Commit b2a1a5b

Browse files
committed
Add rule
1 parent 7fa067f commit b2a1a5b

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

etc/eslint/rules/style.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
var rules = {};
99

1010
/**
11-
* Disable requiring line breaks if line breaks already exist between array elements.
11+
* Always requiring line breaks if line breaks already exist between array elements. NOTE: disabled to allow some freedom in determining best presentation. In general, prefer line breaks if already using line breaks.
1212
*
1313
* @name array-bracket-newline
1414
* @memberof rules
@@ -67,6 +67,31 @@ rules[ 'array-bracket-spacing' ] = [ 'off', 'always', {
6767
'arraysInArrays': false
6868
}];
6969

70+
/**
71+
* Do not enforce line breaks between array elements.
72+
*
73+
* @name array-element-newline
74+
* @memberof rules
75+
* @type {Array}
76+
* @see [array-element-newline]{@link http://eslint.org/docs/rules/array-element-newline}
77+
*
78+
* @example
79+
* // Okay...
80+
* var arr = [ 1, 2, 3 ];
81+
*
82+
* @example
83+
* // Okay...
84+
* var arr = [
85+
* 1,
86+
* 2,
87+
* 3
88+
* ];
89+
*/
90+
rules[ 'array-element-newline' ] = [ 'off', {
91+
'multiline': true,
92+
'minItems': null
93+
}];
94+
7095
/**
7196
* Always require spaces in single-line blocks.
7297
*

0 commit comments

Comments
 (0)