R
R
Roman2021-02-11 20:34:41
Vue.js
Roman, 2021-02-11 20:34:41

Prettier and ESLint (in VSC) conflict about spaces before brackets - data() - how to make them friends?

I have so far registered in .eslintrc.js but this is not good, because in theory, these spaces are still needed. But how to configure Prettier so that it does not turn data () into data () - I do not understand. Or advise another formatter for Vue in VSC please. Thank you.
'space-before-function-paren': 'off'




Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Belyaev, 2021-02-11
@bingo347

Well, firstly, configure eslint correctly: https://eslint.org/docs/rules/space-before-functio...
In your case, you need not 'off', but ['error', 'always']
Secondly, configure the rest of the rules in eslint according to the accepted style code
B -third, replace prettier with eslint --fix and throw out prettier as unnecessary, because out of the box eslint can do everything that prettier does and much more, and with plugins its possibilities are generally endless

W
WbICHA, 2021-02-11
@WblCHA

https://www.npmjs.com/package/eslint-config-prettier

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question