From baa8b0e7f2682dbde73d1ad5f64285eb1752c954 Mon Sep 17 00:00:00 2001 From: Abraham Guo Date: Fri, 12 Jul 2024 13:14:32 -0500 Subject: [PATCH] prefer-arrow-callback --- eslint.config.mjs | 1 + packages/website-eslint/src/mock/path.js | 10 +++------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 4c259bee01a1..9f64059dbfea 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -207,6 +207,7 @@ export default tseslint.config( { commentPattern: '.*intentional fallthrough.*' }, ], 'one-var': ['error', 'never'], + 'prefer-arrow-callback': 'error', // // eslint-plugin-eslint-comment diff --git a/packages/website-eslint/src/mock/path.js b/packages/website-eslint/src/mock/path.js index abf5e0f2466c..238d8542c79f 100644 --- a/packages/website-eslint/src/mock/path.js +++ b/packages/website-eslint/src/mock/path.js @@ -82,9 +82,7 @@ export function resolve() { // Normalize the path resolvedPath = normalizeArray( - filter(resolvedPath.split('/'), function (p) { - return !!p; - }), + filter(resolvedPath.split('/'), p => !!p), !resolvedAbsolute, ).join('/'); @@ -99,9 +97,7 @@ export function normalize(path) { // Normalize the path path = normalizeArray( - filter(path.split('/'), function (p) { - return !!p; - }), + filter(path.split('/'), p => !!p), !isPathAbsolute, ).join('/'); @@ -124,7 +120,7 @@ export function isAbsolute(path) { export function join() { const paths = Array.prototype.slice.call(arguments, 0); return normalize( - filter(paths, function (p) { + filter(paths, p => { if (typeof p !== 'string') { throw new TypeError('Arguments to path.join must be strings'); } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy