Bump packages to fix linter
This commit is contained in:
parent
ed9506bbaf
commit
0a11e3fdd9
6063 changed files with 378752 additions and 306784 deletions
12
node_modules/eslint/lib/rules/no-confusing-arrow.js
generated
vendored
12
node_modules/eslint/lib/rules/no-confusing-arrow.js
generated
vendored
|
|
@ -25,13 +25,13 @@ function isConditional(node) {
|
|||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @type {import('../shared/types').Rule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
type: "suggestion",
|
||||
|
||||
docs: {
|
||||
description: "disallow arrow functions where they could be confused with comparisons",
|
||||
category: "ECMAScript 6",
|
||||
description: "Disallow arrow functions where they could be confused with comparisons",
|
||||
recommended: false,
|
||||
url: "https://eslint.org/docs/rules/no-confusing-arrow"
|
||||
},
|
||||
|
|
@ -41,7 +41,8 @@ module.exports = {
|
|||
schema: [{
|
||||
type: "object",
|
||||
properties: {
|
||||
allowParens: { type: "boolean", default: true }
|
||||
allowParens: { type: "boolean", default: true },
|
||||
onlyOneSimpleParam: { type: "boolean", default: false }
|
||||
},
|
||||
additionalProperties: false
|
||||
}],
|
||||
|
|
@ -54,6 +55,7 @@ module.exports = {
|
|||
create(context) {
|
||||
const config = context.options[0] || {};
|
||||
const allowParens = config.allowParens || (config.allowParens === void 0);
|
||||
const onlyOneSimpleParam = config.onlyOneSimpleParam;
|
||||
const sourceCode = context.getSourceCode();
|
||||
|
||||
|
||||
|
|
@ -65,7 +67,9 @@ module.exports = {
|
|||
function checkArrowFunc(node) {
|
||||
const body = node.body;
|
||||
|
||||
if (isConditional(body) && !(allowParens && astUtils.isParenthesised(sourceCode, body))) {
|
||||
if (isConditional(body) &&
|
||||
!(allowParens && astUtils.isParenthesised(sourceCode, body)) &&
|
||||
!(onlyOneSimpleParam && !(node.params.length === 1 && node.params[0].type === "Identifier"))) {
|
||||
context.report({
|
||||
node,
|
||||
messageId: "confusing",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue