revert: remove jsdoc inferrable types
Removed js/jsdoc inferrable types option, as unfortunately eslint-plugin-jsdoc doesn't has a built-in rule for it. Maybe in the future a custom rule addressing this can be created.
This commit is contained in:
54
packages/core/src/types.d.ts
vendored
54
packages/core/src/types.d.ts
vendored
@@ -74,19 +74,9 @@ export interface Config {
|
||||
* See {@link https://typescript-eslint.io/rules/no-inferrable-types typescript-eslint documentation }
|
||||
* for more info.
|
||||
* ---
|
||||
* *Note: The JSDocs examples are with invalid {@link https://jsdoc.app/tags-type.html JSDoc (at)type}
|
||||
* syntax unfortunately, as using it would break this documentation display.*
|
||||
* ---
|
||||
* **Option: `never`** (default)
|
||||
* Types are always explicit in Javascript (using JSDocs) and Typescript
|
||||
* Types are always explicit in Typescript
|
||||
*
|
||||
* @example ```js
|
||||
// Javascript
|
||||
//** type {number} *
|
||||
const id = 10;
|
||||
//** type {string} *
|
||||
const name = 'foo';
|
||||
```
|
||||
* @example ```ts
|
||||
// Typescript
|
||||
const id: number = 10;
|
||||
@@ -94,49 +84,13 @@ export interface Config {
|
||||
```
|
||||
* ---
|
||||
* **Option: `always`**
|
||||
* Types are always inferred in Javascript and Typescript
|
||||
* Types are always inferred in Typescript
|
||||
*
|
||||
* @example ```js
|
||||
// Javascript
|
||||
const id = 10;
|
||||
const name = 'foo';
|
||||
```
|
||||
* @example ```ts
|
||||
// Typescript
|
||||
const id = 10;
|
||||
const name = 'foo';
|
||||
```
|
||||
* ---
|
||||
* **Option: `ts-never`**
|
||||
* Types are always explicit in Typescript, but inferred in Javascript
|
||||
*
|
||||
* @example ```js
|
||||
// Javascript
|
||||
const id = 10;
|
||||
const name = 'foo';
|
||||
```
|
||||
* @example ```ts
|
||||
// Typescript
|
||||
const id: number = 10;
|
||||
const name: string = 'foo';
|
||||
```
|
||||
* ---
|
||||
* **Option: `js-never`** (default)
|
||||
* Types are always explicit in Javascript (with JSDocs), but inferred in Typescript
|
||||
*
|
||||
* @example ```js
|
||||
// Javascript
|
||||
//** type {number} *
|
||||
const id = 10;
|
||||
//** type {string} *
|
||||
const name = 'foo';
|
||||
```
|
||||
* @example ```ts
|
||||
// Typescript
|
||||
const id = 10;
|
||||
const name = 'foo';
|
||||
```
|
||||
* ---
|
||||
*/
|
||||
inferrableTypes?: inferrableTypesOptions
|
||||
}
|
||||
@@ -146,7 +100,7 @@ export interface Config {
|
||||
}
|
||||
|
||||
export type inferrableTypesOptions = [
|
||||
'never' | 'always' | 'ts-never' | 'js-never',
|
||||
'never' | 'always',
|
||||
{
|
||||
/** @see {@link https://typescript-eslint.io/rules/no-inferrable-types#ignoreparameters} */
|
||||
parameters?: boolean
|
||||
@@ -155,4 +109,4 @@ export type inferrableTypesOptions = [
|
||||
/** @see {@link https://typescript-eslint.io/rules/explicit-function-return-type} */
|
||||
returnValues?: boolean
|
||||
},
|
||||
] | 'never' | 'always' | 'ts-never' | 'js-never';
|
||||
] | 'never' | 'always';
|
||||
|
||||
Reference in New Issue
Block a user