Another possible solution to the conflict between ESLint and Prettier, especially on space-before-function-paren, is not to integrate them at all, but run them to format and lint our code separately. So let's get this working in the following steps:
- Create the scripts separately for Prettier and ESLint in the package.json file as follows:
// package.json
"scripts": {
"prettier": "prettier --check \"
{components,layouts,pages,store,middleware,plugins}/**/*.{vue,js}
\"", "prettier-fix": "prettier --write
{components,layouts,pages,store,middleware,plugins}
/**/*.{vue,js}\"", "lint": "eslint --ext .js,.vue
--ignore-path .gitignore .",
"lint-fix": "eslint --fix --ext .js,.vue --ignore-path
.gitignore ."
}
So now we can completely forget about eslint-plugin-prettier and the eslint-config-prettier config in...