In general everything works well (:Prettier do apply fixes on code), but the project-specific configuration .eslintrc is not take into account, e.g. instead of import { useState } from "react", I'm getting import {useState} from 'react'
In the exact same project using VS Code prettier works excellent (also it's the same correct when using ./node_modules/.bin/prettier --write src/.
Specifying the required rules explicitly (e.g. "spaceBeforeBlocks": "always" and "jsxQuotes": "prefer-double"
Adding let g:prettier#autoformat_config_files = ['.eslintrc']
Adding let g:prettier#exec_cmd_path = ".../path/to/my/project/node_modules/.bin/prettier"
Specifying format rules in a way like let g:prettier#config#tab_width = 4. This made the expected affect, but not all the settings are available in this way + I need to change the configuration project to project
I'm using
NVIM v0.6.1
, the plugin has been added using this code in~/.config/nvim/init.vim
:In general everything works well (
:Prettier
do apply fixes on code), but the project-specific configuration.eslintrc
is not take into account, e.g. instead ofimport { useState } from "react"
, I'm gettingimport {useState} from 'react'
In the exact same project using VS Code prettier works excellent (also it's the same correct when using./node_modules/.bin/prettier --write src/
..eslintrc:
What I've tried:
"spaceBeforeBlocks": "always"
and"jsxQuotes": "prefer-double"
let g:prettier#autoformat_config_files = ['.eslintrc']
let g:prettier#exec_cmd_path = ".../path/to/my/project/node_modules/.bin/prettier"
let g:prettier#config#tab_width = 4
. This made the expected affect, but not all the settings are available in this way + I need to change the configuration project to project~/.config/nvim/
OS:
macOS 11.5.1
Prettier:2.3.2