Enable unicorn/no-negated-array-predicate rule (#19369)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
996340794f
commit
bd3fd72f44
6 files changed
+13
-12
No files matched your search
@@ -324,7 +324,6 @@ const configs = [
|
||||
"unicorn/no-unreadable-object-destructuring": "off",
|
||||
"unicorn/no-unreadable-new-expression": "off",
|
||||
"unicorn/prefer-unicode-code-point-escapes": "off",
|
||||
"unicorn/no-negated-array-predicate": "off",
|
||||
"unicorn/no-break-in-nested-loop": "off",
|
||||
"unicorn/prefer-early-return": "off",
|
||||
"unicorn/no-undeclared-class-members": "off",
|
||||
|
||||
@@ -25,8 +25,8 @@ async function* checkDirectory(directory) {
|
||||
ok:
|
||||
directory === FORMAT_TEST_DIRECTORY ||
|
||||
files.some((file) => file.name === ".not-test-directory") ||
|
||||
!files.some(
|
||||
(file) => file.isFile() && file.name !== TEST_SCRIPT_FILE_NAME,
|
||||
files.every(
|
||||
(file) => !(file.isFile() && file.name !== TEST_SCRIPT_FILE_NAME),
|
||||
) ||
|
||||
files.some(
|
||||
(file) => file.isFile() && file.name === TEST_SCRIPT_FILE_NAME,
|
||||
|
||||
@@ -398,7 +398,7 @@ function isValidHookCallbackAndDepsFormat(args, baseIndex) {
|
||||
getFunctionParameters(maybeArrowFunction).length === 0 &&
|
||||
maybeArrowFunction.body.type === "BlockStatement" &&
|
||||
maybeDepsArray.type === "ArrayExpression" &&
|
||||
!args.some((arg) => hasComment(arg))
|
||||
args.every((arg) => !hasComment(arg))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -347,7 +347,7 @@ function printMemberChain(path, options, print) {
|
||||
if (
|
||||
groups.length <= cutoff &&
|
||||
!nodeHasComment &&
|
||||
!groups.some((g) => g.at(-1).hasTrailingEmptyLine)
|
||||
groups.every((g) => !g.at(-1).hasTrailingEmptyLine)
|
||||
) {
|
||||
if (isLongCurriedCallExpression(path)) {
|
||||
return oneLine;
|
||||
@@ -396,8 +396,8 @@ function printMemberChain(path, options, print) {
|
||||
if (
|
||||
nodeHasComment ||
|
||||
(callExpressions.length > 2 &&
|
||||
callExpressions.some(
|
||||
(expr) => !expr.arguments.every((arg) => isSimpleCallArgument(arg)),
|
||||
callExpressions.some((expr) =>
|
||||
expr.arguments.some((arg) => !isSimpleCallArgument(arg)),
|
||||
)) ||
|
||||
printedGroups.slice(0, -1).some(willBreak) ||
|
||||
lastGroupWillBreakAndOtherCallsHaveFunctionArguments()
|
||||
|
||||
@@ -91,11 +91,13 @@ function validateImportExport(ast, type) {
|
||||
|
||||
// https://github.com/mdx-js/mdx/blob/3430138958c9c0344ecad9d59e0d6b5d72bedae3/packages/remark-mdx/extract-imports-and-exports.js#L16
|
||||
if (
|
||||
!body.every(
|
||||
body.some(
|
||||
(node) =>
|
||||
node.type === "ImportDeclaration" ||
|
||||
node.type === "ExportDefaultDeclaration" ||
|
||||
node.type === "ExportNamedDeclaration",
|
||||
!(
|
||||
node.type === "ImportDeclaration" ||
|
||||
node.type === "ExportDefaultDeclaration" ||
|
||||
node.type === "ExportNamedDeclaration"
|
||||
),
|
||||
)
|
||||
) {
|
||||
throw new Error(`Unexpected '${type}' in MDX.`);
|
||||
|
||||
@@ -165,7 +165,7 @@ function splitText(text) {
|
||||
lastNode?.type === "word" &&
|
||||
!isBetween(KIND_NON_CJK, KIND_CJK_PUNCTUATION) &&
|
||||
// disallow leading/trailing full-width whitespace
|
||||
![lastNode.value, node.value].some((value) => /\u3000/.test(value))
|
||||
[lastNode.value, node.value].every((value) => !/\u3000/.test(value))
|
||||
) {
|
||||
nodes.push({ type: "whitespace", value: "" });
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user