Skip to content

Linting error on file paths with ()[] characters #3182

Open
@princejoogie

Description

@princejoogie

Issue

In nextjs and other frontend frameworks, files can be named with []() characters e.g. src/(main)/product/[id]/page.tsx.

eslint fails to recognize these paths when you dont surround them with quotes.

e.g.

eslint src/(main)/product/[id]/page.tsx

it does not error when wrapping the filepath in quotes

e.g.

eslint "src/(main)/product/[id]/page.tsx"

is there a way to pass a "template" command for the lint-cmd option? something like:

lint-cmd:
  - javascript:eslint "<file>"
  - typescript:eslint "<file>"

o that the resulting command would wrap the filepath in quotes

Here are some screenshots of the issue:

Image Image

Version and model info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions