Skip to content

Commit

Permalink
update eslint-plugin-unicorn
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Jun 2, 2021
1 parent 4580cef commit 7d3200c
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,10 @@ const base = {
'unicorn/prefer-string-slice': 'error',
// prefer `switch` over multiple `else-if`
'unicorn/prefer-switch': ['error', { minimumCases: 3 }],
// enforce using the separator argument with `Array#join()`
'unicorn/require-array-join-separator': 'error',
// enforce using the digits argument with `Number#toFixed()`
'unicorn/require-number-to-fixed-digits-argument': 'error',

// sonarjs
// merging collapsible if statements increases the code's readability
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"eslint-plugin-qunit": "^6.1.1",
"eslint-plugin-regexp": "~0.11.0",
"eslint-plugin-sonarjs": "~0.7.0",
"eslint-plugin-unicorn": "^32.0.1",
"eslint-plugin-unicorn": "^33.0.0",
"glob": "^7.1.7",
"jsonc-eslint-parser": "^1.0.1",
"karma": "^6.3.3",
Expand Down
2 changes: 1 addition & 1 deletion tests/compat/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ GLOBAL.tests = {
return false;
}
try {
Array.prototype.join.call(null);
Array.prototype.join.call(null, '');
return false;
} catch (error) { /* empty */ }
return true;
Expand Down
1 change: 1 addition & 0 deletions tests/pure/esnext.set.join.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/require-array-join-separator -- required for testing */
import Set from 'core-js-pure/features/set';

QUnit.test('Set#join', assert => {
Expand Down
1 change: 1 addition & 0 deletions tests/tests/es.number.to-fixed.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/require-number-to-fixed-digits-argument -- required for testing */
QUnit.test('Number#toFixed', assert => {
const { toFixed } = Number.prototype;
assert.isFunction(toFixed);
Expand Down
1 change: 1 addition & 0 deletions tests/tests/es.typed-array.join.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/require-array-join-separator -- required for testing */
import { DESCRIPTORS, GLOBAL, TYPED_ARRAYS } from '../helpers/constants';

if (DESCRIPTORS) QUnit.test('%TypedArrayPrototype%.join', assert => {
Expand Down
1 change: 1 addition & 0 deletions tests/tests/esnext.set.join.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/require-array-join-separator -- required for testing */
QUnit.test('Set#join', assert => {
const { join } = Set.prototype;

Expand Down

0 comments on commit 7d3200c

Please sign in to comment.