Skip to content
Permalink
Browse files
fix(no-undefined-types): allow this; fixes #660
  • Loading branch information
brettz9 committed Dec 19, 2020
1 parent 68eb1c3 commit bda59595c03d7e2b6a596e6864d883d84f04a618
Showing with 29 additions and 0 deletions.
  1. +1 −0 .README/rules/no-undefined-types.md
  2. +12 −0 README.md
  3. +1 −0 src/rules/noUndefinedTypes.js
  4. +15 −0 test/rules/assertions/noUndefinedTypes.js
@@ -27,6 +27,7 @@ The following types are always considered defined.
`function`, `symbol`
- `number`, `bigint`, `NaN`, `Infinity`
- `any`, `*`
- `this`
- `Array`, `Object`, `RegExp`, `Date`, `Function`

Note that preferred types indicated within `settings.jsdoc.preferredTypes` will
@@ -7026,6 +7026,7 @@ The following types are always considered defined.
`function`, `symbol`
- `number`, `bigint`, `NaN`, `Infinity`
- `any`, `*`
- `this`
- `Array`, `Object`, `RegExp`, `Date`, `Function`
Note that preferred types indicated within `settings.jsdoc.preferredTypes` will
@@ -7563,6 +7564,17 @@ function quux () {}
* @type {SomeType}
*/
// Settings: {"jsdoc":{"structuredTags":{"namepathDefiner":{"name":"namepath-defining"}}}}
class Test {
/**
* Method.
*
* @returns {this} Return description.
*/
method (): this {
return this;
}
}
````
@@ -15,6 +15,7 @@ const extraTypes = [
'function', 'symbol',
'number', 'bigint', 'NaN', 'Infinity',
'any', '*',
'this',
'Array', 'Object', 'RegExp', 'Date', 'Function',
];

@@ -938,5 +938,20 @@ export default {
},
},
},
{
code: `
class Test {
/**
* Method.
*
* @returns {this} Return description.
*/
method (): this {
return this;
}
}
`,
parser: require.resolve('@typescript-eslint/parser'),
},
],
};

0 comments on commit bda5959

Please sign in to comment.