diff --git a/.eslintrc.js b/.eslintrc.js index edbd04cf0a8..5698b88c33b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -10,6 +10,7 @@ module.exports = { 'eslint-plugin', 'import', 'jest', + 'jsdoc', 'simple-import-sort', 'unicorn', ], @@ -20,6 +21,7 @@ module.exports = { extends: [ 'eslint:recommended', 'plugin:eslint-plugin/recommended', + 'plugin:jsdoc/recommended-typescript-error', 'plugin:@typescript-eslint/strict-type-checked', 'plugin:@typescript-eslint/stylistic-type-checked', ], @@ -140,6 +142,7 @@ module.exports = { 'error', { commentPattern: '.*intentional fallthrough.*' }, ], + 'one-var': ['error', 'never'], // // eslint-plugin-eslint-comment @@ -215,7 +218,24 @@ module.exports = { // enforce a sort order across the codebase 'simple-import-sort/imports': 'error', - 'one-var': ['error', 'never'], + // + // eslint-plugin-jsdoc + // + + // We often use @remarks or other ad-hoc tag names + 'jsdoc/check-tag-names': 'off', + // https://github.com/gajus/eslint-plugin-jsdoc/issues/1169 + 'jsdoc/check-param-names': 'off', + // https://github.com/gajus/eslint-plugin-jsdoc/issues/1175 + 'jsdoc/require-jsdoc': 'off', + 'jsdoc/require-param': 'off', + 'jsdoc/require-returns': 'off', + 'jsdoc/require-yields': 'off', + 'jsdoc/tag-lines': 'off', + + // + // eslint-plugin-unicorn + // 'unicorn/no-typeof-undefined': 'error', }, diff --git a/package.json b/package.json index e1f231c13a5..2e5620ee1d0 100644 --- a/package.json +++ b/package.json @@ -88,6 +88,7 @@ "eslint-plugin-eslint-plugin": "^5.1.0", "eslint-plugin-import": "^2.27.5", "eslint-plugin-jest": "^27.2.2", + "eslint-plugin-jsdoc": "^46.9.1", "eslint-plugin-jsx-a11y": "^6.7.1", "eslint-plugin-react": "^7.32.2", "eslint-plugin-react-hooks": "^4.6.0", diff --git a/packages/ast-spec/tests/util/parsers/typescript-estree-import.ts b/packages/ast-spec/tests/util/parsers/typescript-estree-import.ts index a517c0eed31..d84ba32cd97 100644 --- a/packages/ast-spec/tests/util/parsers/typescript-estree-import.ts +++ b/packages/ast-spec/tests/util/parsers/typescript-estree-import.ts @@ -1,17 +1,15 @@ -/** - * Nx is picking up on the fact that we technically have a circular dependency between ast-spec - * and typescript-estree. - * - * This circular dependency only occurs in the tests/ for ast-spec and not in the main package source. - * - * We could therefore solve this by separating the ast-spec tests out into their own package, but the - * other option is to get Nx to turn a blind eye to the circular dependency by removing - * @typescript-eslint/typescript-estree as an explicit devDependency in the package.json and just doing an import here. - * - * This file is ignored via a root `.nxignore` - * - * This should be the only place in the package that we import from typescript-estree. - */ +// Nx is picking up on the fact that we technically have a circular dependency between ast-spec +// and typescript-estree. +// +// This circular dependency only occurs in the tests/ for ast-spec and not in the main package source. +// +// We could therefore solve this by separating the ast-spec tests out into their own package, but the +// other option is to get Nx to turn a blind eye to the circular dependency by removing +// @typescript-eslint/typescript-estree as an explicit devDependency in the package.json and just doing an import here. +// +// This file is ignored via a root `.nxignore` +// +// This should be the only place in the package that we import from typescript-estree. // eslint-disable-next-line no-restricted-imports -- the only safe and valid import from typescript-estree in this package export { parse, TSError } from '@typescript-eslint/typescript-estree'; diff --git a/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts b/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts index 45aee8fe043..b55e7202f55 100644 --- a/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts +++ b/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts @@ -129,7 +129,7 @@ export default createRule({ /** * Check the body for overload methods. - * @param {ASTNode} node the body to be inspected. + * @param node the body to be inspected. */ function checkBodyForOverloadMethods(node: RuleNode): void { const members = getMembers(node); diff --git a/packages/eslint-plugin/src/rules/consistent-type-imports.ts b/packages/eslint-plugin/src/rules/consistent-type-imports.ts index fd452d750b6..4bceed75f74 100644 --- a/packages/eslint-plugin/src/rules/consistent-type-imports.ts +++ b/packages/eslint-plugin/src/rules/consistent-type-imports.ts @@ -277,7 +277,8 @@ export default createRule({ report.unusedSpecifiers.length === 0 && report.node.importKind !== 'type' ) { - /** checks if import has type assertions + /** + * checks if import has type assertions * ``` * import * as type from 'mod' assert { type: 'json' }; * ``` diff --git a/packages/eslint-plugin/src/rules/func-call-spacing.ts b/packages/eslint-plugin/src/rules/func-call-spacing.ts index 03e8a368385..510730fca99 100644 --- a/packages/eslint-plugin/src/rules/func-call-spacing.ts +++ b/packages/eslint-plugin/src/rules/func-call-spacing.ts @@ -82,8 +82,7 @@ export default createRule({ /** * Check if open space is present in a function name - * @param {ASTNode} node node to evaluate - * @returns {void} + * @param node node to evaluate * @private */ function checkSpacing( diff --git a/packages/eslint-plugin/src/rules/member-delimiter-style.ts b/packages/eslint-plugin/src/rules/member-delimiter-style.ts index 1068387b6b1..08e44c52abe 100644 --- a/packages/eslint-plugin/src/rules/member-delimiter-style.ts +++ b/packages/eslint-plugin/src/rules/member-delimiter-style.ts @@ -314,7 +314,7 @@ export default createRule({ /** * Check the member separator being used matches the delimiter. - * @param {ASTNode} node the node to be evaluated. + * @param node the node to be evaluated. */ function checkMemberSeparatorStyle( node: TSESTree.TSInterfaceBody | TSESTree.TSTypeLiteral, diff --git a/packages/eslint-plugin/src/rules/member-ordering.ts b/packages/eslint-plugin/src/rules/member-ordering.ts index 95d6c3715e0..c404823dfd8 100644 --- a/packages/eslint-plugin/src/rules/member-ordering.ts +++ b/packages/eslint-plugin/src/rules/member-ordering.ts @@ -438,7 +438,6 @@ function getMemberRawName( * Gets the member name based on the member type. * * @param node the node to be evaluated. - * @param sourceCode */ function getMemberName( node: Member, @@ -801,7 +800,7 @@ export default createRule({ * Checks if the members are alphabetically sorted. * * @param members Members to be validated. - * @param caseSensitive indicates if the alpha ordering is case sensitive or not. + * @param order What order the members should be sorted in. * * @return True if all members are correctly sorted. */ diff --git a/packages/eslint-plugin/src/rules/no-loop-func.ts b/packages/eslint-plugin/src/rules/no-loop-func.ts index 7e681906470..c78e266da2a 100644 --- a/packages/eslint-plugin/src/rules/no-loop-func.ts +++ b/packages/eslint-plugin/src/rules/no-loop-func.ts @@ -35,7 +35,6 @@ export default createRule({ * - has any references which refers to an unsafe variable. * * @param node The AST node to check. - * @returns Whether or not the node is within a loop. */ function checkForLoops( node: diff --git a/packages/eslint-plugin/src/rules/no-shadow.ts b/packages/eslint-plugin/src/rules/no-shadow.ts index c1e637962a5..2904d7dbb1f 100644 --- a/packages/eslint-plugin/src/rules/no-shadow.ts +++ b/packages/eslint-plugin/src/rules/no-shadow.ts @@ -545,7 +545,7 @@ export default createRule({ /** * Checks the current context for shadowed variables. - * @param {Scope} scope Fixme + * @param scope Fixme */ function checkForShadows(scope: TSESLint.Scope.Scope): void { // ignore global augmentation diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts index a55fd0d3956..40787600143 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts @@ -310,8 +310,8 @@ export default createRule({ * NOTE: It's also unnecessary if the types that don't overlap at all * but that case is handled by the Typescript compiler itself. * Known exceptions: - * * https://github.com/microsoft/TypeScript/issues/32627 - * * https://github.com/microsoft/TypeScript/issues/37160 (handled) + * - https://github.com/microsoft/TypeScript/issues/32627 + * - https://github.com/microsoft/TypeScript/issues/37160 (handled) */ const BOOL_OPERATORS = new Set([ '<', diff --git a/packages/eslint-plugin/src/rules/no-unused-vars.ts b/packages/eslint-plugin/src/rules/no-unused-vars.ts index 47992ed9145..be8fcbe337e 100644 --- a/packages/eslint-plugin/src/rules/no-unused-vars.ts +++ b/packages/eslint-plugin/src/rules/no-unused-vars.ts @@ -159,8 +159,8 @@ export default createRule({ function collectUnusedVariables(): TSESLint.Scope.Variable[] { /** * Checks whether a node is a sibling of the rest property or not. - * @param {ASTNode} node a node to check - * @returns {boolean} True if the node is a sibling of the rest property, otherwise false. + * @param node a node to check + * @returns True if the node is a sibling of the rest property, otherwise false. */ function hasRestSibling(node: TSESTree.Node): boolean { return ( diff --git a/packages/eslint-plugin/src/rules/padding-line-between-statements.ts b/packages/eslint-plugin/src/rules/padding-line-between-statements.ts index 9c6555eb907..4359cd5d087 100644 --- a/packages/eslint-plugin/src/rules/padding-line-between-statements.ts +++ b/packages/eslint-plugin/src/rules/padding-line-between-statements.ts @@ -182,8 +182,8 @@ function isCJSRequire(node: TSESTree.Node): boolean { /** * Checks whether the given node is a block-like statement. * This checks the last token of the node is the closing brace of a block. - * @param sourceCode The source code to get tokens. * @param node The node to check. + * @param sourceCode The source code to get tokens. * @returns `true` if the node is a block-like statement. * @private */ @@ -323,8 +323,8 @@ function isExpression( * * foo() * ;[1, 2, 3].forEach(bar) - * @param sourceCode The source code to get tokens. * @param node The node to get. + * @param sourceCode The source code to get tokens. * @returns The actual last token. * @private */ diff --git a/packages/eslint-plugin/src/rules/prefer-function-type.ts b/packages/eslint-plugin/src/rules/prefer-function-type.ts index eecb8dc3ac4..c1d4bc8ec9c 100644 --- a/packages/eslint-plugin/src/rules/prefer-function-type.ts +++ b/packages/eslint-plugin/src/rules/prefer-function-type.ts @@ -70,7 +70,6 @@ export default createRule({ /** * @param member The TypeElement being checked * @param node The parent of member being checked - * @param tsThisTypes */ function checkMember( member: TSESTree.TypeElement, diff --git a/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts b/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts index 585bbe345b3..4669cc2a97c 100644 --- a/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts +++ b/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts @@ -46,7 +46,7 @@ export default createRule({ /** * Check if a given node type is a string. - * @param node The node type to check. + * @param type The node type to check. */ function isStringType(type: ts.Type): boolean { return getTypeName(checker, type) === 'string'; @@ -54,7 +54,7 @@ export default createRule({ /** * Check if a given node type is a RegExp. - * @param node The node type to check. + * @param type The node type to check. */ function isRegExpType(type: ts.Type): boolean { return getTypeName(checker, type) === 'RegExp'; diff --git a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts index 381d1152937..d63e58d88f9 100644 --- a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts +++ b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts @@ -78,7 +78,6 @@ export default createRule({ /** * Check if a given node is a `Literal` node that is a character. * @param node The node to check. - * @param kind The method name to get a character. */ function isCharacter(node: TSESTree.Node): node is TSESTree.Literal { const evaluated = getStaticValue(node, globalScope); diff --git a/packages/eslint-plugin/src/rules/require-array-sort-compare.ts b/packages/eslint-plugin/src/rules/require-array-sort-compare.ts index fe246a6d8bf..e6f83e800bb 100644 --- a/packages/eslint-plugin/src/rules/require-array-sort-compare.ts +++ b/packages/eslint-plugin/src/rules/require-array-sort-compare.ts @@ -54,7 +54,6 @@ export default createRule({ /** * Check if a given node is an array which all elements are string. - * @param node */ function isStringArrayNode(node: TSESTree.Expression): boolean { const type = services.getTypeAtLocation(node); diff --git a/packages/eslint-plugin/src/rules/space-before-function-paren.ts b/packages/eslint-plugin/src/rules/space-before-function-paren.ts index 9e3366f3a9b..d3966db5655 100644 --- a/packages/eslint-plugin/src/rules/space-before-function-paren.ts +++ b/packages/eslint-plugin/src/rules/space-before-function-paren.ts @@ -70,8 +70,8 @@ export default createRule({ /** * Determines whether a function has a name. - * @param {ASTNode} node The function node. - * @returns {boolean} Whether the function has a name. + * @param node The function node. + * @returns Whether the function has a name. */ function isNamedFunction( node: @@ -97,8 +97,7 @@ export default createRule({ /** * Gets the config for a given function - * @param {ASTNode} node The function node - * @returns {string} "always", "never", or "ignore" + * @param node The function node */ function getConfigForFunction( node: @@ -129,8 +128,7 @@ export default createRule({ /** * Checks the parens of a function node - * @param {ASTNode} node A function node - * @returns {void} + * @param node A function node */ function checkFunction( node: diff --git a/packages/eslint-plugin/src/util/astUtils.ts b/packages/eslint-plugin/src/util/astUtils.ts index c104a5b6476..daa69bc8583 100644 --- a/packages/eslint-plugin/src/util/astUtils.ts +++ b/packages/eslint-plugin/src/util/astUtils.ts @@ -11,10 +11,10 @@ export * from '@typescript-eslint/utils/ast-utils'; // Could be export { getNameLocationInGlobalDirectiveComment } from 'eslint/lib/rules/utils/ast-utils' /** * Get the `loc` object of a given name in a `/*globals` directive comment. - * @param {SourceCode} sourceCode The source code to convert index to loc. - * @param {Comment} comment The `/*globals` directive comment which include the name. - * @param {string} name The name to find. - * @returns {SourceLocation} The `loc` object. + * @param sourceCode The source code to convert index to loc. + * @param comment The `/*globals` directive comment which include the name. + * @param name The name to find. + * @returns The `loc` object. */ export function getNameLocationInGlobalDirectiveComment( sourceCode: TSESLint.SourceCode, diff --git a/packages/eslint-plugin/src/util/collectUnusedVariables.ts b/packages/eslint-plugin/src/util/collectUnusedVariables.ts index 81184ec2a08..0b0b592bf60 100644 --- a/packages/eslint-plugin/src/util/collectUnusedVariables.ts +++ b/packages/eslint-plugin/src/util/collectUnusedVariables.ts @@ -397,7 +397,6 @@ const MERGABLE_TYPES = new Set([ /** * Determine if the variable is directly exported * @param variable the variable to check - * @param target the type of node that is expected to be exported */ function isMergableExported(variable: TSESLint.Scope.Variable): boolean { // If all of the merged things are of the same type, TS will error if not all of them are exported - so we only need to find one diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts index 89cdd1a73ed..a3f26300b2c 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts @@ -254,9 +254,7 @@ function test(a: T) { } `, - /** - * Predicate functions - **/ + // Predicate functions ` // with literal arrow function [0, 1, 2].filter(x => x); diff --git a/packages/parser/tests/tools/test-utils.ts b/packages/parser/tests/tools/test-utils.ts index f36f37440d7..4d86b0d17cf 100644 --- a/packages/parser/tests/tools/test-utils.ts +++ b/packages/parser/tests/tools/test-utils.ts @@ -43,7 +43,7 @@ export function createSnapshotTestBlock( config = Object.assign({}, defaultConfig, config); /** - * @returns {Object} the AST object + * @returns the AST object */ function parse(): TSESTree.Program { const ast = parser.parseForESLint(code, config).ast; diff --git a/packages/rule-tester/src/utils/SourceCodeFixer.ts b/packages/rule-tester/src/utils/SourceCodeFixer.ts index 9346b42b080..a1f8fd3cb89 100644 --- a/packages/rule-tester/src/utils/SourceCodeFixer.ts +++ b/packages/rule-tester/src/utils/SourceCodeFixer.ts @@ -34,7 +34,7 @@ function compareMessagesByLocation(a: LintMessage, b: LintMessage): number { * smart about the fixes and won't apply fixes over the same area in the text. * @param sourceText The text to apply the changes to. * @param messages The array of messages reported by ESLint. - * @returns {Object} An object containing the fixed text and any unfixed messages. + * @returns An object containing the fixed text and any unfixed messages. */ export function applyFixes( sourceText: string, @@ -54,8 +54,8 @@ export function applyFixes( /** * Try to use the 'fix' from a problem. - * @param {Message} problem The message object to apply fixes from - * @returns {boolean} Whether fix was successfully applied + * @param problem The message object to apply fixes from + * @returns Whether fix was successfully applied */ function attemptFix(problem: LintMessageWithFix): boolean { const fix = problem.fix; diff --git a/packages/rule-tester/src/utils/config-validator.ts b/packages/rule-tester/src/utils/config-validator.ts index d3690bc9ba1..4160f81a4de 100644 --- a/packages/rule-tester/src/utils/config-validator.ts +++ b/packages/rule-tester/src/utils/config-validator.ts @@ -96,7 +96,7 @@ function validateRuleSchema( * Validates a rule's options against its schema. * @param rule The rule that the config is being validated for * @param ruleId The rule's unique name. - * @param {Array|number} options The given options for the rule. + * @param options The given options for the rule. * @param source The name of the configuration source to report in any errors. If null or undefined, * no source is prepended to the message. * @throws {Error} Upon any bad rule configuration. diff --git a/packages/scope-manager/src/ScopeManager.ts b/packages/scope-manager/src/ScopeManager.ts index 66f8bbe500f..c77bcfe62e9 100644 --- a/packages/scope-manager/src/ScopeManager.ts +++ b/packages/scope-manager/src/ScopeManager.ts @@ -39,7 +39,6 @@ class ScopeManager { public readonly declaredVariables: WeakMap; /** * The root scope - * @public */ public globalScope: GlobalScope | null; public readonly nodeToScope: WeakMap; @@ -93,7 +92,6 @@ class ScopeManager { * Get the variables that a given AST node defines. The gotten variables' `def[].node`/`def[].parent` property is the node. * If the node does not define any variable, this returns an empty array. * @param node An AST node to get their variables. - * @public */ public getDeclaredVariables(node: TSESTree.Node): Variable[] { return this.declaredVariables.get(node) ?? []; @@ -106,7 +104,6 @@ class ScopeManager { * @param node An AST node to get their scope. * @param inner If the node has multiple scopes, this returns the outermost scope normally. * If `inner` is `true` then this returns the innermost scope. - * @public */ public acquire(node: TSESTree.Node, inner = false): Scope | null { function predicate(testScope: Scope): boolean { diff --git a/packages/scope-manager/src/referencer/VisitorBase.ts b/packages/scope-manager/src/referencer/VisitorBase.ts index e21bfc030a7..43af065b4c6 100644 --- a/packages/scope-manager/src/referencer/VisitorBase.ts +++ b/packages/scope-manager/src/referencer/VisitorBase.ts @@ -29,7 +29,7 @@ abstract class VisitorBase { /** * Default method for visiting children. * @param node the node whose children should be visited - * @param exclude a list of keys to not visit + * @param excludeArr a list of keys to not visit */ visitChildren( node: T | null | undefined, diff --git a/packages/type-utils/src/predicates.ts b/packages/type-utils/src/predicates.ts index fdc79dc45ac..37658e31b71 100644 --- a/packages/type-utils/src/predicates.ts +++ b/packages/type-utils/src/predicates.ts @@ -6,16 +6,20 @@ import { getTypeFlags, isTypeFlagSet } from './typeFlagUtils'; const log = debug('typescript-eslint:eslint-plugin:utils:types'); +export interface IsNullableTypeOptions { + /** + * Whether the type is a receiving type (i.e. the type of a called function's parameter). + */ + isReceiver?: boolean; + allowUndefined?: boolean; +} + /** * Checks if the given type is (or accepts) nullable - * @param isReceiver true if the type is a receiving type (i.e. the type of a called function's parameter) */ export function isNullableType( type: ts.Type, - { - isReceiver = false, - allowUndefined = true, - }: { isReceiver?: boolean; allowUndefined?: boolean } = {}, + { isReceiver = false, allowUndefined = true }: IsNullableTypeOptions = {}, ): boolean { const flags = getTypeFlags(type); diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index d25c2cd72e0..7ebd5cc9e1c 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -629,7 +629,6 @@ export class Converter { /** * Converts a TypeScript JSX node.tagName into an ESTree node.name * @param node the tagName object from a JSX ts.Node - * @param parent * @returns the converted ESTree name object */ private convertJSXTagName( diff --git a/packages/typescript-estree/src/create-program/createIsolatedProgram.ts b/packages/typescript-estree/src/create-program/createIsolatedProgram.ts index fbe92867dcc..4c15f4a25bb 100644 --- a/packages/typescript-estree/src/create-program/createIsolatedProgram.ts +++ b/packages/typescript-estree/src/create-program/createIsolatedProgram.ts @@ -9,7 +9,6 @@ import { createDefaultCompilerOptionsFromExtra } from './shared'; const log = debug('typescript-eslint:typescript-estree:createIsolatedProgram'); /** - * @param code The code of the file being linted * @returns Returns a new source file and program corresponding to the linted code */ function createIsolatedProgram( diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index 8ff1c76ede2..be28c506d95 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -269,7 +269,6 @@ export function getLocFor( /** * Check whatever node can contain directive - * @param node * @returns returns true if node can contain directive */ export function canContainDirective( @@ -771,10 +770,6 @@ export function nodeHasTokens(n: ts.Node, ast: ts.SourceFile): boolean { /** * Like `forEach`, but suitable for use with numbers and strings (which may be falsy). - * @template T - * @template U - * @param array - * @param callback */ export function firstDefined( array: readonly T[] | undefined, diff --git a/packages/typescript-estree/src/parseSettings/createParseSettings.ts b/packages/typescript-estree/src/parseSettings/createParseSettings.ts index fee7dbc1cb4..49d048391d8 100644 --- a/packages/typescript-estree/src/parseSettings/createParseSettings.ts +++ b/packages/typescript-estree/src/parseSettings/createParseSettings.ts @@ -208,8 +208,6 @@ function enforceCodeString(code: unknown): string { * * Even if jsx option is set in typescript compiler, filename still has to * contain .tsx file extension. - * - * @param options Parser options */ function getFileName(jsx?: boolean): string { return jsx ? 'estree.tsx' : 'estree.ts'; diff --git a/packages/typescript-estree/tests/lib/semanticInfo.test.ts b/packages/typescript-estree/tests/lib/semanticInfo.test.ts index d580249079a..9b6d353d48c 100644 --- a/packages/typescript-estree/tests/lib/semanticInfo.test.ts +++ b/packages/typescript-estree/tests/lib/semanticInfo.test.ts @@ -445,8 +445,6 @@ function testIsolatedFile( /** * Verifies that the type of a TS node is number[] as expected - * @param {ts.TypeChecker} checker - * @param {ts.Node} tsNode */ function checkNumberArrayType(checker: ts.TypeChecker, tsNode: ts.Node): void { const nodeType = checker.getTypeAtLocation(tsNode); diff --git a/packages/typescript-estree/tools/test-utils.ts b/packages/typescript-estree/tools/test-utils.ts index 8c3ab3aae0f..7e37d4bac0c 100644 --- a/packages/typescript-estree/tools/test-utils.ts +++ b/packages/typescript-estree/tools/test-utils.ts @@ -64,7 +64,6 @@ export function formatSnapshotName( /** * Check if file extension is one used for jsx - * @param fileType */ export function isJSXFileType(fileType: string): boolean { if (fileType.startsWith('.')) { diff --git a/yarn.lock b/yarn.lock index 7c39d94cf91..1daeeb30cba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2897,6 +2897,17 @@ __metadata: languageName: node linkType: hard +"@es-joy/jsdoccomment@npm:~0.41.0": + version: 0.41.0 + resolution: "@es-joy/jsdoccomment@npm:0.41.0" + dependencies: + comment-parser: 1.4.1 + esquery: ^1.5.0 + jsdoc-type-pratt-parser: ~4.0.0 + checksum: cfe0714027ff8fa82dad8c84f75af3f6df9d6797d60c289b8d3c259c5375c134bd5ca630beba0daed3adceef01a74f19e05052018f6b66ad6a4f483adf599c39 + languageName: node + linkType: hard + "@esbuild/aix-ppc64@npm:0.19.10": version: 0.19.10 resolution: "@esbuild/aix-ppc64@npm:0.19.10" @@ -5651,6 +5662,7 @@ __metadata: eslint-plugin-eslint-plugin: ^5.1.0 eslint-plugin-import: ^2.27.5 eslint-plugin-jest: ^27.2.2 + eslint-plugin-jsdoc: ^46.9.1 eslint-plugin-jsx-a11y: ^6.7.1 eslint-plugin-react: ^7.32.2 eslint-plugin-react-hooks: ^4.6.0 @@ -6294,6 +6306,13 @@ __metadata: languageName: node linkType: hard +"are-docs-informative@npm:^0.0.2": + version: 0.0.2 + resolution: "are-docs-informative@npm:0.0.2" + checksum: 7a48ca90d66e29afebc4387d7029d86cfe97bad7e796c8e7de01309e02dcfc027250231c02d4ca208d2984170d09026390b946df5d3d02ac638ab35f74501c74 + languageName: node + linkType: hard + "are-we-there-yet@npm:^3.0.0": version: 3.0.0 resolution: "are-we-there-yet@npm:3.0.0" @@ -7665,6 +7684,13 @@ __metadata: languageName: node linkType: hard +"comment-parser@npm:1.4.1": + version: 1.4.1 + resolution: "comment-parser@npm:1.4.1" + checksum: e0f6f60c5139689c4b1b208ea63e0730d9195a778e90dd909205f74f00b39eb0ead05374701ec5e5c29d6f28eb778cd7bc41c1366ab1d271907f1def132d6bf1 + languageName: node + linkType: hard + "common-tags@npm:^1.8.0": version: 1.8.2 resolution: "common-tags@npm:1.8.2" @@ -9421,6 +9447,25 @@ __metadata: languageName: node linkType: hard +"eslint-plugin-jsdoc@npm:^46.9.1": + version: 46.9.1 + resolution: "eslint-plugin-jsdoc@npm:46.9.1" + dependencies: + "@es-joy/jsdoccomment": ~0.41.0 + are-docs-informative: ^0.0.2 + comment-parser: 1.4.1 + debug: ^4.3.4 + escape-string-regexp: ^4.0.0 + esquery: ^1.5.0 + is-builtin-module: ^3.2.1 + semver: ^7.5.4 + spdx-expression-parse: ^4.0.0 + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + checksum: c1307398f9cf79ad1479b7f2c08ffc150d2b4f9747880f6a0de2f34dc1b04ec34d01acbd69d0ed1a4d1e435dba6683bd1446b3ff89a2074e9c739e15d22c228f + languageName: node + linkType: hard + "eslint-plugin-jsx-a11y@npm:^6.7.1": version: 6.8.0 resolution: "eslint-plugin-jsx-a11y@npm:6.8.0" @@ -12674,6 +12719,13 @@ __metadata: languageName: node linkType: hard +"jsdoc-type-pratt-parser@npm:~4.0.0": + version: 4.0.0 + resolution: "jsdoc-type-pratt-parser@npm:4.0.0" + checksum: af0629c9517e484be778d8564440fec8de5b7610e0c9c88a3ba4554321364faf72b46689c8d8845faa12c0718437a9ed97e231977efc0f2d50e8a2dbad807eb3 + languageName: node + linkType: hard + "jsesc@npm:^2.5.1": version: 2.5.2 resolution: "jsesc@npm:2.5.2" @@ -17190,6 +17242,16 @@ __metadata: languageName: node linkType: hard +"spdx-expression-parse@npm:^4.0.0": + version: 4.0.0 + resolution: "spdx-expression-parse@npm:4.0.0" + dependencies: + spdx-exceptions: ^2.1.0 + spdx-license-ids: ^3.0.0 + checksum: 936be681fbf5edeec3a79c023136479f70d6edb3fd3875089ac86cd324c6c8c81add47399edead296d1d0af17ae5ce88c7f88885eb150b62c2ff6e535841ca6a + languageName: node + linkType: hard + "spdx-license-ids@npm:^3.0.0": version: 3.0.13 resolution: "spdx-license-ids@npm:3.0.13"