From 921cedd7e39f98d1e906c5e7b4e97ac84e3ac5ff Mon Sep 17 00:00:00 2001 From: Brett Zamir Date: Sun, 19 Mar 2023 00:51:13 -0700 Subject: [PATCH] docs: `recommended-typescript` --- .README/README.md | 31 +++++++++++++++++++++++++++++++ README.md | 31 +++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/.README/README.md b/.README/README.md index 05ee2ed8f..0141860f7 100644 --- a/.README/README.md +++ b/.README/README.md @@ -116,6 +116,37 @@ as failing errors, you may use the "recommended-error" config: } ``` +If you plan to use TypeScript syntax (and not just "typescript" +`mode` to indicate the JSDoc flavor is TypeScript), you can configure +the following: + +```javascript +{ + "rules": { + "jsdoc/no-types": 1, + "jsdoc/require-param-type": 0, + "jsdoc/require-property-type": 0, + "jsdoc/require-returns-type": 0, + } +} +``` + +...or just use: + +```json +{ + "extends": ["plugin:jsdoc/recommended-typescript"] +} +``` + +...or to report with failing errors instead of mere warnings: + +```json +{ + "extends": ["plugin:jsdoc/recommended-typescript-error"] +} +``` + ## Options Rules may, as per the [ESLint user guide](https://eslint.org/docs/user-guide/configuring), have their own individual options. In `eslint-plugin-jsdoc`, a few options, diff --git a/README.md b/README.md index b508c35d4..f1dd7f3d3 100644 --- a/README.md +++ b/README.md @@ -188,6 +188,37 @@ as failing errors, you may use the "recommended-error" config: } ``` +If you plan to use TypeScript syntax (and not just "typescript" +`mode` to indicate the JSDoc flavor is TypeScript), you can configure +the following: + +```javascript +{ + "rules": { + "jsdoc/no-types": 1, + "jsdoc/require-param-type": 0, + "jsdoc/require-property-type": 0, + "jsdoc/require-returns-type": 0, + } +} +``` + +...or just use: + +```json +{ + "extends": ["plugin:jsdoc/recommended-typescript"] +} +``` + +...or to report with failing errors instead of mere warnings: + +```json +{ + "extends": ["plugin:jsdoc/recommended-typescript-error"] +} +``` + ## Options