Code first
//
http://eslint.org/docs/rules/ Parsing error: Unexpected token
10 | @Component
11 | export default class HelloWorld extends Vue {
> 12 | private msg: string = "Welcome to Your Vue.js App"
| ^
13 | private defaultOpen: Array<string> = []
14 | private get mmsg () : string {
15 | return "ok ok is ok"
src/components/HelloWorld.vue:19:12
private msg: string = "Welcome to Your Vue.js App"
^
1 problem (1 error, 0 warnings)
Errors:
1 http://eslint.org/docs/rules/null
You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.
warning in ./src/main.ts
// .eslintrc.js
module.exports = {
root: true,
parserOptions: {
parser: "babel-eslint"
},
env: {
browser: true,
},
extends: [
// https://github.com/vuejs/eslint-plugin-vue-sharppriority-a-essential-error-prevention
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
"plugin:vue/essential",
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
"standard"
],
// required to lint *.vue files
plugins: [
"vue"
],
// add your custom rules here
rules: {
// allow async-await
"generator-star-spacing": "off",
// allow debugger during development
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
"indent": ["error", 4, {
SwitchCase: 1
}],
}
}
of course, this warning will not block the running of the program, and removing private
will not pop up the warning. But why do I warn when I add private
?