Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit 3b1fc42

Browse files
fxmaxvlmarkelog
authored andcommitted
Preset: add disallowArrayDestructuringReturn in airbnb preset
According to the documentation, array destructuring is not recommended for multiple return values - https://github.com/airbnb/javascript#5.3 Closes gh-2149
1 parent 8500623 commit 3b1fc42

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

presets/airbnb.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,6 @@
7575
"validateLineBreaks": "LF",
7676
"validateQuoteMarks": { "mark": "'", "escape": true, "ignoreJSX": true },
7777
"validateIndentation": 2,
78-
"maximumLineLength": 100
78+
"maximumLineLength": 100,
79+
"disallowArrayDestructuringReturn": true
7980
}

test/data/options/preset/airbnb.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,4 +412,17 @@
412412
(function () {
413413
})();
414414

415+
//disallowArrayDestructuringReturn
416+
//https://github.com/airbnb/javascript#5.3
417+
(function () {
418+
function processInput(input) {
419+
const left = 1;
420+
const right = 2;
421+
const top = 3;
422+
const bottom = 4;
423+
424+
return { left, right, top, bottom };
425+
}
426+
})();
427+
415428
})(window);

0 commit comments

Comments
 (0)