-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Description
Versions
- nuxt:
2.15.7 - node:
14.15.0
Reproduction
I've created a new Nuxt project with the latest version thanks to npx with the following configuration
I could not have a working Prettier with the configuration of the repo.
create-nuxt-app release.
My initial file to format looks like this
<template>
<div>
nice
<Tutorial/>
</div>
</template>
<script>
export default {
data() {
return {
key: 'test'
}
},
}
</script>How to solve the issue
After some tests, I found the culprit in .eslintrc.js, this is the current configuration generated by the CLI
extends: [
'@nuxtjs',
'plugin:nuxt/recommended',
'prettier'
],This is the one that do actually work as before
extends: [
'@nuxtjs',
'plugin:prettier/recommended', // this line was updated
'prettier'
],Then, it formats my file properly
<template>
<div>
nice
<Tutorial />
</div>
</template>
<script>
export default {
data() {
return {
key: 'test',
}
},
}
</script>I did not hosted it on codesandbox, but the repo can be found on Github.
yarn add -D eslint-plugin-prettier to have it working.
