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 Dec 17, 2020
1 parent fc1ea33 commit 8acc71b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.js
Expand Up @@ -226,8 +226,6 @@ const base = {
'new-cap': ['error', { newIsCap: true, capIsNew: false }],
// require parentheses when invoking a constructor with no arguments
'new-parens': 'error',
// disallow if as the only statement in an else block
'no-lonely-if': 'error',
// disallow mixed spaces and tabs for indentation
'no-mixed-spaces-and-tabs': 'error',
// disallow multiple empty lines and only one newline at the end
Expand Down Expand Up @@ -363,6 +361,8 @@ const base = {
'unicorn/no-console-spaces': 'error',
// enforce the use of unicode escapes instead of hexadecimal escapes
'unicorn/no-hex-escape': 'error',
// disallow if as the only statement in an else block
'unicorn/no-lonely-if': 'error',
// disallow unreadable array destructuring
'unicorn/no-unreadable-array-destructuring': 'error',
// disallow unsafe regular expressions
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -33,7 +33,7 @@
"eslint-plugin-optimize-regex": "^1.2.0",
"eslint-plugin-qunit": "^5.2.0",
"eslint-plugin-sonarjs": "~0.5.0",
"eslint-plugin-unicorn": "^23.0.0",
"eslint-plugin-unicorn": "^24.0.0",
"grunt": "^1.3.0",
"grunt-cli": "^1.3.2",
"grunt-contrib-clean": "^2.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/core-js/modules/es.aggregate-error.js
Expand Up @@ -11,6 +11,7 @@ var $AggregateError = function AggregateError(errors, message) {
var that = this;
if (!(that instanceof $AggregateError)) return new $AggregateError(errors, message);
if (setPrototypeOf) {
// eslint-disable-next-line unicorn/error-message
that = setPrototypeOf(new Error(undefined), getPrototypeOf(that));
}
if (message !== undefined) createNonEnumerableProperty(that, 'message', String(message));
Expand Down

4 comments on commit 8acc71b

@fisker
Copy link

@fisker fisker commented on 8acc71b Jun 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, @zloirock you misunderstood the unicorn/no-lonely-if rule, it checks if-in-if, the core rule check if-in-else, they are total different, is it because the rule name or doc misleading?

@zloirock
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fisker yes, thanks. Probably for both reasons - I thought that it's an extended no-lonely-if version and I missed the last example. I think it could be better to highlight it in the docs -)

@fisker
Copy link

@fisker fisker commented on 8acc71b Jun 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you like to improve it?

@zloirock
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that I'll choose the correct words. However, why not...

Please sign in to comment.