
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@0x706b/coc-prettier
Advanced tools
Coc extension to format your JavaScript / TypeScript / CSS / JSON using Prettier.
A fork of prettier-vscode
Run vim command:
:CocInstall coc-prettier
Prettier
command in your init.vim
or .vimrc
command! -nargs=0 Prettier :CocCommand prettier.formatFile
Then you can use :Prettier
to format current buffer.
init.vim
or .vimrc
vmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)
Then you can <leader>f
for range format.
Prettier range format only support languageId including: javascript
,
javascriptreact
, typescript
, typescriptreact
, json
and graphql
.
coc-settings.json
for format on save.Open settings file with:
:CocConfig
Add:
"coc.preferences.formatOnSaveFiletypes": ["css", "markdown"],
to setup the languages which you want to format on save.
Note: prettier extension have lower priority, if the document have other registered document format provider, prettier would not work.
To check the format is done by prettier, check out the output message after
format, which should contains Formatted by prettier
.
To make prettier do the format, use command :CocCommand prettier.formatFile
To save without formatting, use :noa w
Settings will be read from (listed by priority):
.editorconfig
Or if no prettier configuration file exist
.editorconfig
Fit code within this line limit
Number of spaces it should use per tab
If true, will use single instead of double quotes
Controls the printing of trailing commas wherever possible. Valid options:
Controls the printing of spaces inside object literals
If true, puts the >
of a multi-line jsx element at the end of the last line instead of being alone on the next line
Which parser to use. Valid options are 'flow' and 'babylon'.
Whether to add a semicolon at the end of every line (semi: true), or only at the beginning of lines that may introduce ASI failures (semi: false)
If true, indent lines with tabs
(Markdown) wrap prose over multiple lines.
Include parentheses around a sole arrow function parameter
These settings are specific to Coc and need to be set in the Coc settings file. See the documentation for how to do that.
Change it to -1
if you don't want prettier to have higher priority than
formatter provided by other language server.
Use prettier-eslint instead of prettier. Other settings will only be fallbacks in case they could not be inferred from ESLint rules.
Use prettier-tslint instead of prettier. Other settings will only be fallbacks in case they could not be inferred from TSLint rules.
Use prettier-stylelint instead of prettier. Other settings will only be fallbacks in case they could not be inferred from stylelint rules.
Require a 'prettierconfig' to format
Supply the path to an ignore file such as .gitignore
or .prettierignore
.
Files which match will not be formatted. Set to null
to not read ignore files. Restart required.
A list of languages IDs to disable this extension on. Restart required. Note: Disabling a language enabled in a parent folder will prevent formatting instead of letting any other formatter to run
Text of status item indicating current buffer can be formatted by prettier.
Only use the version of prettier installed by the client, ignoring the version bundled with coc-prettier
Disable the 'Formatted by prettier' message which is echoed every time a file is successfully formatted
This extension will use prettier from your project's local dependencies. Should prettier not be installed locally with your project's dependencies, a copy will be bundled with the extension.
prettier-eslint
and prettier-tslint
are included with the installation of this extension. There is no need for a separate local or global install of either for functionality.
eslint
, tslint
, and all peer dependencies required by your specific configuration must be installed locally. Global installations will not be recognized.
Feel free to open issues or PRs!
FAQs
prettier extension for coc.nvim
The npm package @0x706b/coc-prettier receives a total of 0 weekly downloads. As such, @0x706b/coc-prettier popularity was classified as not popular.
We found that @0x706b/coc-prettier demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.