Closed kozer closed 3 years ago
Try :echo CocAction getConfig('prettier')
If I run this specific command I get E121: Undefined variable: CocAction
. Is this correct?
Also, how this will solve the issue?
:echo CocAction('getConfig', 'prettier')
Thanks @fannheyward . Still no clue how this will solve the issue. I get the config back, so what?
cc: @chemzqm
{'trailingComma': 'es5', 'endOfLine': 'lf', 'tslintIntegration': 'false', 'disableLanguages': ['vue'], 'semi': v:true, 'tabWidth': 2, 'printWidth': 80, 'disableSuccessMessage': v:fal
se, 'proseWrap': 'preserve', 'arrowParens': 'always', 'htmlWhitespaceSensitivity': 'css', 'jsxBracketSameLine': v:false, 'useTabs': v:false, 'stylelintIntegration': 'false', 'jsxSing
leQuote': v:false, 'formatterPriority': '1', 'singleQuote': v:false, 'statusItemText': 'Prettier', 'onlyUseLocalVersion': v:false, 'parser': 'none', 'requireConfig': 'true', 'bracket
Spacing': v:true, 'eslintIntegration': 'false', 'ignorePath': '.prettierignore'}
It's "prettier.tslintIntegration": false
, not "false"
, type is boolean https://github.com/neoclide/coc-prettier/blob/master/package.json#L47-L49.
Use https://github.com/neoclide/coc-json for json validation is recommended.
Having
typescriptreact
andtypescript
on my formatfilesOnSave make prettier failed with the following.Notice that I have prettier installed locally in my project. If I install
prettier-tslint
locally as well everything works as expected.The local installation of
prettier
doesn't seem to be the issue though as removing it makes the error message still appears. (At first I thought that the local version was creating an issue resolving the bundled prettier)Also a strange thing is that I have those options in my
coc-config
Seems that it tries to resolve prettier-tslint from my project and not using the bundled one.
Could you provide some help to solve this?
Thanks!
PS: Installed local typescript version:
"typescript": "^4.2.3",
PS2: Don't think that's relative but I don't have a coc-config json file. I uselet g:coc_user_config
in my vim config to provide coc nvim with my preferred options