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

"No parser and no filepath given" #42

Closed
wirekang opened this issue Aug 5, 2022 · 4 comments
Closed

"No parser and no filepath given" #42

wirekang opened this issue Aug 5, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@wirekang
Copy link

wirekang commented Aug 5, 2022

.ctirc:

{
  "project": "./tsconfig.json",
  "exportFilename": "index.ts",
  "useSemicolon": false,
  "useTimestamp": false,
  "useComment": false,
  "quote": "'",
  "overwrite": true,
  "keepFileExt": false,
  "skipEmptyDir": true,
  "output": "./",
  "useRootDir": false,
  "includeBackup": false
}

Command:
npx ctix create

Output:
No parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a filepath so one can be inferred.

@imjuni
Copy link
Owner

imjuni commented Aug 5, 2022

Hi @wirekang

ctix works fine on my project what jin-frame and erdia.

Can you create example repository for solve this problem?

@imjuni imjuni added the question Further information is requested label Aug 5, 2022
@Chanki-Min
Copy link

Chanki-Min commented Aug 23, 2022

Hello @imjuni

Looks like this is prettier of ctix's problem
prettier needs parser field to run. and if not, No parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a filepath so one can be inferred. warning will be thrown

And looking at prettier useage in ctix's code, looks like ctix using host project's prettier config (.prettirc)

So, If host project (who uses ctix) doesn't have .prettirc. than there are no parser config given to ctix's prettier instance.

So i guess ctix needs to give default prettier config

ref) vuejs/vue-cli#3356 (comment)

By the way, I'm very grateful to use this library. I wish this could helps

@Chanki-Min
Copy link

I deleted my project's .prettierrc and ran ctix than same warning rises :)

@imjuni imjuni added bug Something isn't working and removed question Further information is requested labels Aug 24, 2022
@imjuni
Copy link
Owner

imjuni commented Aug 24, 2022

If you set the .editorconfig when you are not using the prettier, it will occur when the pretter works.

This issue has been fixed in v1.3.3, and even if .editorconfig is set, the prettier will not work unless parser is set to typescript in the prettier option.

@wirekang @Chanki-Min Thank you for your help fix this problem.

@imjuni imjuni closed this as completed Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants