Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Description
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I haveread the FAQ and my problem is not listed.
Repro
{"rules": {"no-undef": [] }}// Add code below to valid cases of `packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts`// and run `yarn test no-undef`constobj={foo:'',bar(){letfoo:typeofthis.foo;},};
Expected Result
No error should be reported.
Actual Result
this intypeof this is reported as undefined.
● no-undef › valid › const obj = { foo: '', bar() { let foo: typeof this.foo; },}; assert.strictEqual(received, expected) Expected value to strictly be equal to: 0 Received: 1 Message: Should have no errors but had 1: [ { ruleId: 'no-undef', severity: 1, message: "'this' is not defined.", line: 5, column: 21, nodeType: 'Identifier', messageId: 'undef', endLine: 5, endColumn: 25 } ]Additional Info
Versions
Tested on latest commit,a9eb0b9.
| package | version |
|---|---|
@typescript-eslint/eslint-plugin | X.Y.Z |
@typescript-eslint/parser | X.Y.Z |
TypeScript | X.Y.Z |
ESLint | X.Y.Z |
node | X.Y.Z |