ESLint can't find undefined method or property in template

Viewed 248

I write Vue Components with typescript, and use typescript-eslint.
If template has undefined method or property,I can't find it until it runs.
Other problems for example "no-trailing-spaces" can be found both on VSCode and npm run lint.
What rule can find this probrem?

package.json

  "devDependencies": {
    "@types/jest": "^24.0.19",
    "@typescript-eslint/eslint-plugin": "^2.18.0",
    "@typescript-eslint/parser": "^2.18.0",
    "@vue/cli-plugin-eslint": "~4.2.0",
    "@vue/cli-plugin-router": "~4.2.0",
    "@vue/cli-plugin-typescript": "~4.2.0",
    "@vue/cli-plugin-unit-jest": "~4.2.0",
    "@vue/cli-plugin-vuex": "~4.2.0",
    "@vue/cli-service": "~4.2.0",
    "@vue/eslint-config-typescript": "^5.0.1",
    "@vue/eslint-config-airbnb": "^5.0.2",
    "@vue/test-utils": "1.0.0-beta.31",
    "eslint": "^6.7.2",
    "eslint-plugin-vue": "^6.1.2",
    "sass": "^1.25.0",
    "sass-loader": "^8.0.2",
    "typescript": "~3.7.5",
    "vue-template-compiler": "^2.6.11"
  }
<template>
  <div>
    <div @click="undefinedNiceMethod()">   
      {{undefined_variable}}
    </div>
  </div>
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';

@Component({})
export default class Hoge extends Vue {
  blankValue: string = '';
}
</script>
1 Answers

You can't catch this no-undef error in Vue Template with eslint.

I'm going to close this proposition, as I believe it's almost not possible to implement and even if it is - because of the number of different criteria that should be satisfied it will most likely cause some false positives and may cause more harm than good. If you don't agree and have an idea of how to best tackle this, please reopen this issue and share your thoughts :)

Source: Rule Proposal: vue/no-undef

Related