Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/numToStr/prettierrc.nvim
Apply editor settings from prettier config
https://github.com/numToStr/prettierrc.nvim
neovim neovim-plugin prettier prettier-config
Last synced: 3 months ago
JSON representation
Apply editor settings from prettier config
- Host: GitHub
- URL: https://github.com/numToStr/prettierrc.nvim
- Owner: numToStr
- License: mit
- Created: 2022-08-22T11:05:50.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-11-17T14:29:20.000Z (about 1 year ago)
- Last Synced: 2024-05-05T15:36:22.171Z (7 months ago)
- Topics: neovim, neovim-plugin, prettier, prettier-config
- Language: Lua
- Homepage:
- Size: 7.81 KB
- Stars: 19
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
prettierrc.nvim
Editor settings via prettier config
### Installation
- With [packer.nvim](https://github.com/wbthomason/packer.nvim)
```lua
use('numToStr/prettierrc.nvim')
```- With [vim-plug](https://github.com/junegunn/vim-plug)
```vim
Plug 'numToStr/prettierrc.nvim'
```And that's it. Restart your neovim to see the magic.
### Support
#### Options
Following options are supported:
- [`printWidth`](https://prettier.io/docs/en/options.html#print-width)
- [`tabWidth`](https://prettier.io/docs/en/options.html#tab-width)
- [`useTabs`](https://prettier.io/docs/en/options.html#tabs)
- [`endOfLine`](https://prettier.io/docs/en/options.html#end-of-line)#### Files
Following [config files](https://prettier.io/docs/en/configuration.html) are supported in the respective order.
- `.prettierrc`
- `.prettierrc.json`
- `.prettierrc.yml`
- `.prettierrc.yaml`
- `.prettierrc.toml`Keep in mind, there is no support for nested configuration as of now.
- Supported
```json
{
"trailingComma": "es5",
"tabWidth": 4,
"printWidth": 100
}
```- Not Supported
```json
{
"semi": false,
"overrides": [
{
"files": "*.test.js",
"options": {
"semi": true
}
},
{
"files": ["*.html", "legacy/**/*.js"],
"options": {
"tabWidth": 4
}
}
]
}
```### Limitation
Following filetype/format are not supported
- `.prettierrc.{js,cjs}` and `.prettierrc.config.{js,cjs}` - I am not going to create a javascipt parser
- `package.json` (`prettier` option) - Technically, it's possible to support but I am lazy.### Contributing
You can contribute to the project by filing [bug reports](https://github.com/numToStr/prettierrc.nvim/issues) or submit PR :)
### Credits
- [`editorconfig.nvim`](https://github.com/gpanders/editorconfig.nvim) - For motivation and guidance