Replace `↹` with `··`
See original GitHub issueWhat version of eslint
are you using?
4.18.2
What version of prettier
are you using?
1.13.7
What version of eslint-plugin-prettier
are you using?
2.6.1
Please paste any applicable config files that you’re using (e.g. .prettierrc
or .eslintrc
files)
.prettierrc.js
module.exports = {
semi: false,
tabWidth: 2,
singleQuote: true,
useTabs: false
}
.eslintrc
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint'
},
env: {
browser: true
},
extends: [
'plugin:vue/essential',
'standard',
'prettier'
],
plugins: ['vue', 'prettier'],
rules: {
'generator-star-spacing': 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'prettier/prettier': 'error'
}
}
Additional Info MacOS 10.13.5 Keyboard Layout: UK (British) English Software: Visual Studio Code 1.25.0 node: 10.5.0 npm: 6.1.0
Visual Studio User settings:
"editor.formatOnSave": true,
"[javascript]": {
"editor.formatOnSave": false
},
"eslint.autoFixOnSave": true,
"eslint.alwaysShowStatus": true,
"prettier.disableLanguages": [
"js"
],
"files.autoSave": "onFocusChange",
"git.enableSmartCommit": true,
"editor.fontSize": 14,
"editor.formatOnType": false,
"prettier.singleQuote": true,
"prettier.semi": false,
"prettier.eslintIntegration": true,
"vetur.format.defaultFormatter.html": "js-beautify-html"
What source code are you linting?
<template>
<section id="contact-form" class="contact-form">
<form v-if="isSent == false" class="form" @submit="onSubmit" method="post">
<input name="name" v-model="contact.name" placeholder="NAME" type="text" autocomplete="name" required>
<input name="email" v-model="contact.email" placeholder="EMAIL" type="email" autocomplete="email" required>
<input name="phone" v-model="contact.phone" placeholder="PHONE" type="text" autocomplete="phone" required>
<textarea name="enquiry" v-model="contact.enquiry" rows="4" placeholder="ENQUIRY" required></textarea>
<div class="button-wrap">
<button class="button" :disabled="isSending === true">Send Enquiry</button>
</div>
</form>
<h3 class="thank-you" v-if="isSent"> Thank you for sending your enquiry!</h3>
</section>
</template>
<script>
import axios from 'axios'
export default {
name: 'ContactForm',
data() {
return {
contact: {
name: '',
email: '',
phone: '',
enquiry: ''
},
isSending: false,
isSent: false
}
},
methods: {
onSubmit: function(e) {
e.preventDefault()
const qs = require('qs')
this.isSending = true
axios
.post(
'/app.php',
qs.stringify({
name: this.contact.name,
email: this.contact.email,
phone: this.contact.phone,
enquiry: this.contact.enquiry
})
)
.then(response => {
if (response.status === 200) {
this.isSent = true
this.isSending = false
}
})
.catch(e => {
console.log(e)
})
}
}
}
</script>
<style lang="scss" scoped>
@import '~@/scss/main';
.contact-form {
background: $color-black;
color: $color-white;
padding: 4.5rem 3.5rem;
p,
form {
max-width: 66rem;
margin: 0 auto;
}
form {
margin-top: 4rem;
}
}
.button {
margin: 6rem 0 4rem;
border: 0.2rem solid $color-black;
cursor: pointer;
&:hover {
background: $color-black;
color: $color-aureolin;
border: 0.2rem solid $color-aureolin;
}
&:disabled,
&:disabled:hover,
&:disabled:focus {
border: 1px solid $color-gray;
background-color: $color-iron;
color: $color-mine-shaft;
cursor: not-allowed;
}
}
</style>
What did you expect to happen? I was expecting Prettier plugin to automatically fix any spacing issue on the script section of the ‘.vue’ file as it does for the ‘.js’ files or not throw any error.
What actually happened?
During each build, it throws errors like these: Replace ↹↹↹↹↹
with ··········
. The only way to fix it is manually delete the ‘tab’ characters and replace them with spaces one by one.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:23
- Comments:25 (2 by maintainers)
Hi,
In order to automatically fix your code, you need to run ESLint with the
--fix
flag.Had the same issue.
This fixed my issue