Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[no-undef] No-undef error on user-defined Typescript type guards #2462

Closed
3 tasks done
victorgarciaesgi opened this issue Sep 1, 2020 · 3 comments · Fixed by #2493
Closed
3 tasks done

[no-undef] No-undef error on user-defined Typescript type guards #2462

victorgarciaesgi opened this issue Sep 1, 2020 · 3 comments · Fixed by #2493
Assignees
Labels
bug Something isn't working has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@victorgarciaesgi
Copy link

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

{
  "rules": {
    '@typescript-eslint/no-useless-constructor': 'error',
    '@typescript-eslint/no-unused-vars': 'off',
    '@typescript-eslint/explicit-function-return-type': 'off',
    '@typescript-eslint/no-explicit-any': 'off',
    '@typescript-eslint/no-use-before-define': 'off',
    '@typescript-eslint/interface-name-prefix': 'off',
    '@typescript-eslint/no-var-requires': 'off',
    '@typescript-eslint/no-namespace': 'off',
    '@typescript-eslint/camelcase': 'off',
    '@typescript-eslint/no-empty-function': 'off',
    '@typescript-eslint/ban-ts-ignore': 'off',
    '@typescript-eslint/explicit-module-boundary-types': 'off',
    '@typescript-eslint/ban-ts-comment': 'off',
    '@typescript-eslint/no-non-null-assertion': 'off',
  }
}
@Component
export default class Column extends Vue {
  isColumnString(column: TableColumn): column is string {
                                   //   ^^^^^ 'column' is not defined (eslint: no-undef)
    return typeof this.column === 'string';
  }
}

Expected Result

Actual Result

Versions

package version
@typescript-eslint/eslint-plugin 4.0.1
@typescript-eslint/parser 4.0.1
TypeScript 4.0.2
ESLint 7.8.0
node 12.18.0
@victorgarciaesgi victorgarciaesgi added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Sep 1, 2020
@bradzacher bradzacher added bug Something isn't working and removed triage Waiting for maintainers to take a look labels Sep 1, 2020
@jacekkarczmarczyk
Copy link

Is this bug related/duplicate?

@vvscode
Copy link

vvscode commented Sep 2, 2020

@jacekkarczmarczyk in fact it's another problem, but it might be caused with same reason

@vvscode
Copy link

vvscode commented Sep 2, 2020

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants