require-array-join-separator
March 27, 2026 ยท View on GitHub
๐ Enforce using the separator argument with Array#join().
๐ผ This rule is enabled in the following configs: โ
recommended, โ๏ธ unopinionated.
๐ง This rule is automatically fixable by the --fix CLI option.
It's better to make it clear what the separator is when calling Array#join(), instead of relying on the default comma (',') separator.
Examples
// โ
const string = array.join();
// โ
const string = array.join(',');
// โ
const string = array.join('|');
// โ
const string = Array.prototype.join.call(arrayLike);
// โ
const string = Array.prototype.join.call(arrayLike, '');
// โ
const string = [].join.call(arrayLike);
// โ
const string = [].join.call(arrayLike, '\n');