eslint-plugin-jsdoc 44.0.1 → 44.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/WarnSettings.js +10 -2
- package/dist/WarnSettings.js.map +1 -1
- package/dist/bin/generateRule.js +47 -12
- package/dist/bin/generateRule.js.map +1 -1
- package/dist/bin/gitdown.d.ts +12 -0
- package/dist/generateRule.js +47 -12
- package/dist/generateRule.js.map +1 -1
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/dist/iterateJsdoc.js +0 -1
- package/dist/iterateJsdoc.js.map +1 -1
- package/dist/rules/noUndefinedTypes.js +13 -3
- package/dist/rules/noUndefinedTypes.js.map +1 -1
- package/dist/rules/validTypes.js +2 -1
- package/dist/rules/validTypes.js.map +1 -1
- package/docs/rules/no-undefined-types.md +21 -3
- package/docs/rules/valid-types.md +4 -0
- package/package.json +9 -6
- package/tsconfig.json +19 -0
|
@@ -55,11 +55,18 @@ array's items will be considered as defined for the purposes of that tag.
|
|
|
55
55
|
<a name="no-undefined-types-options"></a>
|
|
56
56
|
## Options
|
|
57
57
|
|
|
58
|
-
An option object may have the following
|
|
58
|
+
An option object may have the following keys:
|
|
59
59
|
|
|
60
60
|
- `definedTypes` - This array can be populated to indicate other types which
|
|
61
61
|
are automatically considered as defined (in addition to globals, etc.).
|
|
62
62
|
Defaults to an empty array.
|
|
63
|
+
- `markVariablesAsUsed` - Whether to mark variables as used for the purposes
|
|
64
|
+
of the `no-unused-vars` rule when they are not found to be undefined.
|
|
65
|
+
Defaults to `true`. May be set to `false` to enforce a practice of not
|
|
66
|
+
importing types unless used in code.
|
|
67
|
+
- `disableReporting` - Whether to disable reporting of errors. Defaults to
|
|
68
|
+
`false`. This may be set to `true` in order to take advantage of only
|
|
69
|
+
marking defined variables as used.
|
|
63
70
|
|
|
64
71
|
<a name="user-content-no-undefined-types-context-and-settings"></a>
|
|
65
72
|
<a name="no-undefined-types-context-and-settings"></a>
|
|
@@ -72,7 +79,7 @@ An option object may have the following key:
|
|
|
72
79
|
|Aliases|`constructor`, `const`, `extends`, `var`, `arg`, `argument`, `prop`, `return`, `exception`, `yield`|
|
|
73
80
|
|Closure-only|`package`, `private`, `protected`, `public`, `static`|
|
|
74
81
|
|Recommended|true|
|
|
75
|
-
|Options|`definedTypes`|
|
|
82
|
+
|Options|`definedTypes`, `markVariablesAsUsed`, `disableReporting`|
|
|
76
83
|
|Settings|`preferredTypes`, `mode`, `structuredTags`|
|
|
77
84
|
|
|
78
85
|
|
|
@@ -354,7 +361,7 @@ import {MyType} from 'my-library';
|
|
|
354
361
|
* @param {object<string, number>} foo
|
|
355
362
|
* @param {Array<string>} baz
|
|
356
363
|
*/
|
|
357
|
-
|
|
364
|
+
function quux(foo, bar, baz) {
|
|
358
365
|
|
|
359
366
|
}
|
|
360
367
|
|
|
@@ -727,5 +734,16 @@ class Foo {
|
|
|
727
734
|
}
|
|
728
735
|
}
|
|
729
736
|
// Settings: {"jsdoc":{"mode":"typescript"}}
|
|
737
|
+
|
|
738
|
+
import {MyType} from 'my-library';
|
|
739
|
+
|
|
740
|
+
/**
|
|
741
|
+
* @param {MyType} foo - Bar.
|
|
742
|
+
* @param {AnUndefinedType} bar
|
|
743
|
+
*/
|
|
744
|
+
function quux(foo, bar) {
|
|
745
|
+
|
|
746
|
+
}
|
|
747
|
+
// "jsdoc/no-undefined-types": ["error"|"warn", {"disableReporting":true}]
|
|
730
748
|
````
|
|
731
749
|
|
package/package.json
CHANGED
|
@@ -24,20 +24,22 @@
|
|
|
24
24
|
"@babel/plugin-transform-flow-strip-types": "^7.21.0",
|
|
25
25
|
"@babel/preset-env": "^7.21.5",
|
|
26
26
|
"@babel/register": "^7.21.0",
|
|
27
|
-
"@es-joy/jsdoc-eslint-parser": "^0.
|
|
27
|
+
"@es-joy/jsdoc-eslint-parser": "^0.19.0",
|
|
28
28
|
"@hkdobrev/run-if-changed": "^0.3.1",
|
|
29
29
|
"@semantic-release/commit-analyzer": "^9.0.2",
|
|
30
30
|
"@semantic-release/github": "^8.0.7",
|
|
31
31
|
"@semantic-release/npm": "^10.0.3",
|
|
32
|
-
"@
|
|
32
|
+
"@types/eslint": "^8.37.0",
|
|
33
|
+
"@types/node": "^20.1.1",
|
|
34
|
+
"@typescript-eslint/parser": "^5.59.5",
|
|
33
35
|
"babel-plugin-add-module-exports": "^1.0.4",
|
|
34
36
|
"babel-plugin-istanbul": "^6.1.1",
|
|
35
37
|
"camelcase": "^6.3.0",
|
|
36
38
|
"chai": "^4.3.7",
|
|
37
39
|
"cross-env": "^7.0.3",
|
|
38
40
|
"decamelize": "^5.0.1",
|
|
39
|
-
"eslint-config-canonical": "~33.0.1",
|
|
40
41
|
"eslint": "^8.39.0",
|
|
42
|
+
"eslint-config-canonical": "~33.0.1",
|
|
41
43
|
"gitdown": "^3.1.5",
|
|
42
44
|
"glob": "^10.2.2",
|
|
43
45
|
"husky": "^8.0.3",
|
|
@@ -107,9 +109,10 @@
|
|
|
107
109
|
"package-lock.json": "npm run install-offline"
|
|
108
110
|
},
|
|
109
111
|
"scripts": {
|
|
112
|
+
"tsc": "tsc",
|
|
110
113
|
"build": "rimraf ./dist && cross-env NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps --ignore ./src/bin/*.js --no-copy-ignored",
|
|
111
|
-
"check-
|
|
112
|
-
"create-
|
|
114
|
+
"check-docs": "babel-node ./src/bin/generateDocs.js --check",
|
|
115
|
+
"create-docs": "babel-node ./src/bin/generateDocs.js",
|
|
113
116
|
"create-rule": "babel-node ./src/bin/generateRule.js",
|
|
114
117
|
"install-offline": "pnpm install --prefer-offline --no-audit",
|
|
115
118
|
"lint": "npm run lint-arg -- .",
|
|
@@ -121,5 +124,5 @@
|
|
|
121
124
|
"test-cov": "cross-env TIMING=1 nyc --reporter text npm run test-no-cov",
|
|
122
125
|
"test-index": "npm run test-no-cov -- test/rules/index.js"
|
|
123
126
|
},
|
|
124
|
-
"version": "44.0
|
|
127
|
+
"version": "44.1.0"
|
|
125
128
|
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"lib": ["es2022"],
|
|
4
|
+
"moduleResolution": "node",
|
|
5
|
+
"module": "esnext",
|
|
6
|
+
"allowJs": true,
|
|
7
|
+
"checkJs": true,
|
|
8
|
+
"noEmit": true,
|
|
9
|
+
"declaration": true,
|
|
10
|
+
"declarationMap": true,
|
|
11
|
+
"allowSyntheticDefaultImports": true,
|
|
12
|
+
"strict": true,
|
|
13
|
+
"target": "es6",
|
|
14
|
+
"outDir": "dist"
|
|
15
|
+
},
|
|
16
|
+
// Restore to `src/**/*.js` as ready
|
|
17
|
+
"include": ["src/bin/*.js", "src/bin/gitdown.d.ts"],
|
|
18
|
+
"exclude": ["node_modules"]
|
|
19
|
+
}
|