//------------------------------------------------------------------------------
const TARGET_NODE_TYPE = /^(?:Arrow)?FunctionExpression$/u;
-const TARGET_METHODS = /^(?:every|filter|find(?:Index)?|flatMap|forEach|map|reduce(?:Right)?|some|sort)$/u;
+const TARGET_METHODS = /^(?:every|filter|find(?:Last)?(?:Index)?|flatMap|forEach|map|reduce(?:Right)?|some|sort|toSorted)$/u;
/**
* Checks a given code path segment is reachable.
docs: {
description: "Enforce `return` statements in callbacks of array methods",
recommended: false,
- url: "https://eslint.org/docs/rules/array-callback-return"
+ url: "https://eslint.org/docs/latest/rules/array-callback-return"
},
schema: [
create(context) {
const options = context.options[0] || { allowImplicit: false, checkForEach: false };
- const sourceCode = context.getSourceCode();
+ const sourceCode = context.sourceCode;
let funcInfo = {
arrayMethodName: null,