question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ESLint doesn't recognize doc comments as a use of a type

See original GitHub issue

Tell us about your environment

  • ESLint Version: v6.8.0
  • Node Version: v8.11.3
  • npm Version: v5.6.0

What parser (default, Babel-ESLint, etc.) are you using? default

Please show your full configuration:

Configuration
module.exports = {
    "extends": "standard",
    "rules": {    
        "semi": [2, "always"],
        "indent": [2, 4],
        "no-return-await": 0,
        "space-before-function-paren": [2, {
            "named": "never",
            "anonymous": "never",
            "asyncArrow": "always"
        }],
        "template-curly-spacing": [2, "always"]
    }
};

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

const { TurnContext } = require('botbuilder');
/**
 *
 * @param {TurnContext} turnContext on turn context object.
 */
async run(turnContext) {}

eslint test.js

What did you expect to happen? ESLint should recognize that the types I’m importing are used in doc comments

What actually happened? Please include the actual, raw output from ESLint.

6:66  error  'TurnContext' is assigned a value but never used        no-unused-vars

Are you willing to submit a pull request to fix this bug? Maybe

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kaicataldocommented, Feb 4, 2020

Is the JSDoc plugin meant to be used on top of ESLint or instead of?

Assuming you mean using a JSDoc plugin rule in addition to no-unused-vars in ESLint core, it should be possible to use it in addition. This should be doable similarly to how eslint-plugin-react marks import React from "react" as used in the jsx-uses-react rule.

Docs are here and the rule source code can be found here.

0reactions
eslint-deprecated[bot]commented, Mar 6, 2020

It looks like the conversation is stalled here. As this is a question rather than an action item, I’m closing the issue. If you still need help, please send a message to our mailing list or chatroom. Thanks! [//]: # (auto-close)

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I configure ESLint to check for TypeScript class ...
Firstly, I should note that eslint-plugin-jsdoc 's rules are ... the TypeScript docs that @type is used instead--to check that @type has a ......
Read more >
Working with Rules - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
eslint-config-ash-nazg - npm
An expansion and tweaking of the "standard" config style for ESLint. Latest version: 34.6.0, last published: 13 days ago.
Read more >
How to use ESLint with TypeScript | Khalil Stemmler
ESLint is a JavaScript linter that you can use to lint either TypeScript or JavaScript code. In this post, we'll walk through how...
Read more >
VS Code ESLint extension - Visual Studio Marketplace
If you are new to ESLint check the documentation. The extension uses the ESLint library installed in the opened workspace folder. If the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found