Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File system dynamic routes doesn't work with eslint 6 #7924

Closed
cajoy opened this issue Jul 12, 2019 · 10 comments
Closed

File system dynamic routes doesn't work with eslint 6 #7924

cajoy opened this issue Jul 12, 2019 · 10 comments

Comments

@cajoy
Copy link

cajoy commented Jul 12, 2019

Bug report

Describe the bug

File system dynamic routes doesn't work with eslint 6

See output:

Screen Shot 2019-07-12 at 12 10 17 PM

file is there for sure

System information

  • OS: macOS
  • Version of Next.js: 9.0.1
  • Version of Eslint: 6.0.1
@timneutkens
Copy link
Member

timneutkens commented Jul 12, 2019

Sounds like a bug in eslint, not Next.js. Potentially you have to double escape or use "./pages/\[id\].tsx" (with quotes)

@Timer
Copy link
Member

Timer commented Jul 14, 2019

I believe you need to use single quotes instead of double, but one of the two options should work!

Please file this bug with ESLint for adding special handling to a valid filename.

@Timer Timer closed this as completed Jul 14, 2019
@Pushplaybang
Copy link

Pushplaybang commented Jul 16, 2019

receiving a similar issue with prettier:

/Users/paul/repositories/client/crowdcaster2/web/node_modules/.bin/prettier --write pages/podcasts/[id]/edit.js
[error] No matching files. Patterns tried: pages/podcasts/[id]/edit.js !**/node_modules/** !./node_modules/** !**/.{git,svn,hg}/** !./.{git,svn,hg}/**

EDIT: note this is only using prettier with a file watcher in intellij with prettier

@Pushplaybang
Copy link

NB: the following command runs fine, in package.json scripts:

//... other scripts
"lint:fix": "prettier --write \"**/*.js\" && eslint . --fix"
//...

@cajoy did you resolve this with eslint on your side?

@Pushplaybang
Copy link

@cajoy @Timer FYI

Still receiving this in IntelliJ Idea using prettier with a file watcher. Going to disable for now, and usee the command line before committing might be useful for others to document this once its solved.

/Users/paul/repositories/client/crowdcaster2/web/node_modules/.bin/prettier --write 'pages/podcasts/[id]/edit.js'
[error] No matching files. Patterns tried: 'pages/podcasts/[id]/edit.js' !**/node_modules/** !./node_modules/** !**/.{git,svn,hg}/** !./.{git,svn,hg}/**

have tried, double quotes, single quotes, escaped double quotes in the file watcher config.

Screenshot 2019-07-16 at 22 20 27

@aripekkako
Copy link

My current workaround is to run prettier through eslint and then trigger eslint --fix on every save.

@murajun1978
Copy link

Yeah, this problem was solved by eslint/eslint#11986 😄

@timneutkens
Copy link
Member

Awesome @murajun1978 💯

@Kielan
Copy link

Kielan commented Oct 2, 2019

this can come up if you are using eslint previous to 6.1.0

eslint/eslint#11940

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants