tsdoc icon indicating copy to clipboard operation
tsdoc copied to clipboard

ESLint flat configurations?

Open Scc33 opened this issue 1 year ago • 4 comments

ESLint v9 has rolled out flat configs.

I didn't see this plugin listed in their tracker (https://github.com/eslint/eslint/issues/18093) nor do I see any documentation for how to use this plugin in a flat config.

Was wondering if that was supported by this project or if there are plans to support it.

Scc33 avatar Apr 09 '24 21:04 Scc33

Clearly documentation needs to be updated to cover for eslint v9. I do have a WIP on https://github.com/ansible/vscode-ansible/pull/1223 which enables tsdoc plugin and one rule but I am wondering which is correct way to do it.

My expectation was that I would not need to define the extra tsdoc/syntax rule in order to enable it and instead of make use of extends to enable them.

ssbarnea avatar Apr 12 '24 11:04 ssbarnea

It's possible to enable like below:

import tsdoceslint from "eslint-plugin-tsdoc"

// ...

    plugins : {
        "tsdoc": tsdoceslint
    },
    rules : {
        "tsdoc/syntax": "warn",
    },

/// ...

However it's not possible to disable a single rule as eslint-plugin-tsdoc is expecting "ignore" but the new format requires "off" or 0

e.g. Still warns for the extra rule in the VSCode ESLint extension and when running ESLint

rules : {
    "tsdoc/syntax": "warn",
    "tsdoc/tsdoc-reference-missing-hash": [ "off" ]
},

e.g. Does not warn for the extra rule in the VSCode ESlint extension but ESLint refuses to run with the error below

rules : {
    "tsdoc/syntax": "warn",
    "tsdoc/tsdoc-reference-missing-hash": [ "ignore" ]
},
Configuration for rule "tsdoc/tsdoc-reference-missing-hash" is invalid. Expected severity of "off", 0, "warn", 1, "error", or 2.

You passed '"ignore"'.

blipk avatar Sep 08 '24 04:09 blipk

What's the correct way to use this with ESLint 9?

beorn avatar Oct 27 '24 21:10 beorn