Skip to content

typescript mode does not recognize /** @type {{[key: string]: string}} */ #796

@thernstig

Description

@thernstig

Expected behavior

This should be valid (it is called an index signature https://www.typescriptlang.org/docs/handbook/2/objects.html#index-signatures).

/** @type {{[key: string]: string}} */
const obj = {};
obj.a = 'foo';
obj.b = 5;

Actual behavior

It is not as it gives the error Syntax error in type: {[key: string]: string}

ESLint Config

  "settings": {
    "jsdoc": {
      "mode": "typescript",
    }
  }

I am unsure if this should have been written at https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues, because the repo hardly has any activity at all.

Environment

  • Node version: v14.17.6
  • ESLint version: v7.32.0
  • eslint-plugin-jsdoc version: 36.1.0

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions