"extensions": "eslint: Recommended"
the attribute in the configuration file enables this rule.
Most code conventions require tabs or spaces for indentation. Therefore, if a single line code is indented with tabs and spaces, an error usually occurs.
This rule does not allow indenting with mixed spaces and tabs.
Example of error code for this rule:
/*eslint no-mixed-spaces-and-tabs: "error"*/
function add(x, y) {
// --->..return x + y;
return x + y;
}
function main() {
// --->var x = 5,
// --->....y = 7;
var x = 5,
y = 7;
}
Example of the correct code for this rule:
/*eslint no-mixed-spaces-and-tabs: "error"*/
function add(x, y) {
// --->return x + y;
return x + y;
}
This rule has a string option.
"smart tabs"
when the latter is used for alignment, it is allowed to mix space and labels.
Smart tag
The correct code example for this rule includes the following "smart tabs"
Options:
/*eslint no-mixed-spaces-and-tabs: ["error", "smart-tabs"]*/
function main() {
// --->var x = 5,
// --->....y = 7;
var x = 5,
y = 7;
}
Add this line:
/*eslint no-mixed-spaces-and-tabs: [“error”, “smart-tabs”]*/
<template>
<comp-setup>
</comp-setup>
</template>
<script>
/*eslint no-mixed-spaces-and-tabs: ["error", "smart-tabs"]*/
import CompSetup from './components/setupview'
export default {
name: 'App',
components: {
CompSetup,
}
}
</script>
<style>
</style>
Read More:
- Python: How to Set Line breaks and tabs for Strings
- Httprunner Run Error: while parsing a block mapping
- The anaconda-navigator interface cannot be started, loading application, report ERROR download_api._get_url error
- How to Solve Python Xlwt ValueError: More than 4094 XFs (styles)
- The range of Chinese Unicode encoding and the calculation of the number of Chinese and English words in text
- AttributeError: module ‘enum‘ has no attribute ‘IntFlag‘ [How to Solve]
- Python defines a full vector class
- [Solved] Python Project Import Module Error: ModuleNotFoundError
- [Solved] Python Relative Reference Error: ImportError: attempted relative import with no known parent package
- error: (-5:Bad argument) in function ‘seamlessClone‘ and error: (-215:Assertion failed) 0 <= roi.x && 0 [How to Solve]
- [Solved] AttributeError: ‘NoneType‘ object has no attribute ‘astype‘
- [Solved] RuntimeError: Error(s) in loading state dict for YOLOX:
- How to Solve Turtle_tf Error in ROS
- [Solved] HTTPError: 404 Client Error: Not Found for url: https://huggingface.co/saved_model
- How to Solve Python AttributeError: ‘module’ object has no attribute ‘xxx’
- Autograd error in Python: runtimeerror: grad can be implicitly created only for scalar outputs
- [Solved] TypeError: Object of type ‘bytes’ is not JSON serializable
- [How to Solve] ImportError: No module named typing
- ValueError: need more than 1 value to unpack
- The automatic token of Python interface is passed into the header