Skip to content

Commit

Permalink
feat(no-types): add TSMethodSignature; fixes gajus#1249
Browse files Browse the repository at this point in the history
  • Loading branch information
brettz9 committed Jun 24, 2024
1 parent 5497b03 commit fae6fc7
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/rules/noTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ export default iterateJsdoc(({
}
}
}, {
contextDefaults: true,
contextDefaults: [
'ArrowFunctionExpression', 'FunctionDeclaration', 'FunctionExpression', 'TSDeclareFunction',
// Add this to above defaults
'TSMethodSignature'
],
meta: {
docs: {
description: 'This rule reports types being used on `@param` or `@returns`.',
Expand Down
29 changes: 29 additions & 0 deletions test/rules/assertions/noTypes.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import * as typescriptEslintParser from '@typescript-eslint/parser';

export default {
invalid: [
{
Expand Down Expand Up @@ -226,6 +228,33 @@ export default {
}
`,
},
{
code: `
export interface B {
/**
* @param {string} paramA
*/
methodB(paramB: string): void
}
`,
errors: [
{
line: 4,
message: 'Types are not permitted on @param.',
},
],
languageOptions: {
parser: typescriptEslintParser
},
output: `
export interface B {
/**
* @param paramA
*/
methodB(paramB: string): void
}
`,
}
],
valid: [
{
Expand Down

0 comments on commit fae6fc7

Please sign in to comment.