Skip to content

bug: lodash/prefer-lodash-method false positive with nextjs (react) router replace #296

@rotkiw

Description

@rotkiw

`import { useRouter } from 'next/router'
const router = useRouter()

router.replace('/')`

with plugin:lodash/recommended:
ESLint: Prefer '_.replace' over the native function. (lodash/prefer-lodash-method)

quick fix rule:
'lodash/prefer-lodash-method': [2, { ignoreMethods: ['replace'] }]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions