eslint-plugin-jsdoc
Advanced tools
Comparing version 44.2.7 to 45.0.0
@@ -200,2 +200,3 @@ "use strict"; | ||
'jsdoc/no-types': warnOrError, | ||
'jsdoc/no-undefined-types': 'off', | ||
'jsdoc/require-param-type': 'off', | ||
@@ -209,2 +210,19 @@ 'jsdoc/require-property-type': 'off', | ||
/** | ||
* @param {"warn"|"error"} warnOrError | ||
* @returns {import('eslint').ESLint.ConfigData} | ||
*/ | ||
const createRecommendedTypeScriptFlavorRuleset = warnOrError => { | ||
const ruleset = createRecommendedRuleset(warnOrError); | ||
return { | ||
...ruleset, | ||
rules: { | ||
...ruleset.rules, | ||
/* eslint-disable indent -- Extra indent to avoid use by auto-rule-editing */ | ||
'jsdoc/no-undefined-types': 'off' | ||
/* eslint-enable indent */ | ||
} | ||
}; | ||
}; | ||
/* istanbul ignore if -- TS */ | ||
@@ -218,2 +236,4 @@ if (!index.configs) { | ||
index.configs['recommended-typescript-error'] = createRecommendedTypeScriptRuleset('error'); | ||
index.configs['recommended-typescript-flavor'] = createRecommendedTypeScriptFlavorRuleset('warn'); | ||
index.configs['recommended-typescript-flavor-error'] = createRecommendedTypeScriptFlavorRuleset('error'); | ||
var _default = index; | ||
@@ -220,0 +240,0 @@ exports.default = _default; |
@@ -135,3 +135,3 @@ { | ||
}, | ||
"version": "44.2.7" | ||
"version": "45.0.0" | ||
} |
@@ -134,24 +134,30 @@ <a name="user-content-eslint-plugin-jsdoc"></a> | ||
If you plan to use TypeScript syntax (and not just "typescript" | ||
`mode` to indicate the JSDoc flavor is TypeScript), you can configure | ||
the following: | ||
`mode` to indicate the JSDoc flavor is TypeScript), you can use: | ||
```javascript | ||
```json | ||
{ | ||
"rules": { | ||
"jsdoc/no-types": 1, | ||
"jsdoc/require-param-type": 0, | ||
"jsdoc/require-property-type": 0, | ||
"jsdoc/require-returns-type": 0, | ||
} | ||
"extends": ["plugin:jsdoc/recommended-typescript"] | ||
} | ||
``` | ||
...or just use: | ||
...or to report with failing errors instead of mere warnings: | ||
```json | ||
{ | ||
"extends": ["plugin:jsdoc/recommended-typescript"] | ||
"extends": ["plugin:jsdoc/recommended-typescript-error"] | ||
} | ||
``` | ||
If you are not using TypeScript syntax (your source files are still `.js` files) | ||
but you are using the TypeScript flavor within JSDoc (i.e., the default | ||
"typescript" `mode` in `eslint-plugin-jsdoc`) and you are perhaps using | ||
`allowJs` and `checkJs` options of TypeScript's `tsconfig.json`), you may | ||
use: | ||
```json | ||
{ | ||
"extends": ["plugin:jsdoc/recommended-typescript-flavor"] | ||
} | ||
``` | ||
...or to report with failing errors instead of mere warnings: | ||
@@ -161,3 +167,3 @@ | ||
{ | ||
"extends": ["plugin:jsdoc/recommended-typescript-error"] | ||
"extends": ["plugin:jsdoc/recommended-typescript-flavor-error"] | ||
} | ||
@@ -164,0 +170,0 @@ ``` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2003638
14026
276