eslint-plugin-jsdoc 39.2.5 → 39.2.8
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/CONTRIBUTING.md +12 -12
- package/dist/rules/requireJsdoc.js +1 -0
- package/dist/rules/requireJsdoc.js.map +1 -1
- package/package.json +4 -4
package/CONTRIBUTING.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
## Testing changes locally
|
|
4
4
|
|
|
5
5
|
You might try a TDD approach and add tests within the `test` directory,
|
|
6
|
-
to try different configs
|
|
6
|
+
to try different configs you may find it easier to try out changes in
|
|
7
7
|
a separate local directory.
|
|
8
8
|
|
|
9
9
|
You can run [`npm link`](https://docs.npmjs.com/cli/link) for this purpose,
|
|
@@ -18,7 +18,7 @@ npm link ../eslint-plugin-jsdoc
|
|
|
18
18
|
|
|
19
19
|
After running `npm install` to get the latest dependencies and devDependencies,
|
|
20
20
|
you can run the following command to update the `dist` files, with `dist/index.js`
|
|
21
|
-
being the `main`
|
|
21
|
+
being the `main` entry point from `package.json`:
|
|
22
22
|
|
|
23
23
|
```shell
|
|
24
24
|
npm run build
|
|
@@ -33,22 +33,22 @@ items needing fixing.
|
|
|
33
33
|
|
|
34
34
|
## Documentation building
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
To make changes that are reflected in the README, you will need to
|
|
37
37
|
modify files within the `.README` directory. `.README/README.md` contains the
|
|
38
38
|
main README skeleton and details on the project, its global `settings`, etc.,
|
|
39
|
-
while the documentation for specific rules (that will
|
|
39
|
+
while the documentation for specific rules (that will be pulled into the
|
|
40
40
|
README) ought to be modified within the relevant file within `.README/rules`.
|
|
41
41
|
Once these files are modified, you can run `npm run create-readme` to have
|
|
42
42
|
these files integrated into the main `/README.md`. While you should include
|
|
43
|
-
the built file in your PR, you will
|
|
44
|
-
directly to this file as they will be overwritten.
|
|
43
|
+
the built file in your PR, you will not want to make manual changes
|
|
44
|
+
directly to this file, as they will be overwritten.
|
|
45
45
|
|
|
46
46
|
## Testing
|
|
47
47
|
|
|
48
48
|
Tests are expected. Each rule file should be in CamelCase (despite the rule names themselves being hyphenated) and should be added within `test/assertions` and then imported/required by
|
|
49
49
|
`test/rules/index.js`.
|
|
50
50
|
|
|
51
|
-
Each rule file should be an ESM default export of an object
|
|
51
|
+
Each rule file should be an ESM default export of an object that has `valid` and `invalid` array properties containing the tests. Tests of each type should be provided.
|
|
52
52
|
|
|
53
53
|
`parserOptions` will be `ecmaVersion: 6` by default, but tests can override `parserOptions`
|
|
54
54
|
with their own.
|
|
@@ -57,8 +57,8 @@ See ESLint's [RuleTester](https://eslint.org/docs/developer-guide/nodejs-api#rul
|
|
|
57
57
|
for more on the allowable properties (e.g., `code`, `errors` (for invalid rules),
|
|
58
58
|
`options`, `settings`, etc.).
|
|
59
59
|
|
|
60
|
-
Note that besides `npm test
|
|
61
|
-
detailed information
|
|
60
|
+
Note that besides `npm test` there is `npm run test-cov`, which shows more
|
|
61
|
+
detailed coverage information. Coverage should be maintained at 100%, and
|
|
62
62
|
if there are a few guards in place for future use, the code block in question
|
|
63
63
|
can be ignored by being preceded by `/* istanbul ignore next */` (including
|
|
64
64
|
for warnings where the block is never passed over (i.e., the block is always
|
|
@@ -75,7 +75,7 @@ You can further limit this by providing `--invalid` and/or `--valid` flags
|
|
|
75
75
|
with a comma-separated list of 0-based indexes that you wish to include (also
|
|
76
76
|
accepts negative offsets from the end, e.g., `-1` for the last item). For
|
|
77
77
|
example, to check the first and third invalid tests of `check-examples`
|
|
78
|
-
|
|
78
|
+
along with the second valid test, you can run:
|
|
79
79
|
|
|
80
80
|
`npm run --rule=check-examples --invalid=0,2 --valid=1 test-index`.
|
|
81
81
|
|
|
@@ -84,7 +84,7 @@ alon with the second valid test, you can run:
|
|
|
84
84
|
PRs should be mergeable, [rebasing](https://git-scm.com/book/en/v2/Git-Branching-Rebasing)
|
|
85
85
|
first against the latest `master`.
|
|
86
86
|
|
|
87
|
-
The number of commits will ideally be limited
|
|
87
|
+
The number of commits will ideally be limited unless extra commits
|
|
88
88
|
can better show a progression of features.
|
|
89
89
|
|
|
90
90
|
Commit messages should be worded clearly and the reason for any PR made clear
|
|
@@ -96,5 +96,5 @@ We use [semantic-release](https://github.com/semantic-release/semantic-release)
|
|
|
96
96
|
for preparing releases, so the commit messages (or at least the merge that
|
|
97
97
|
brings them into `master`) must follow the
|
|
98
98
|
[AngularJS commit guidelines](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines) with a special format such as `feat: describe new feature`
|
|
99
|
-
|
|
99
|
+
for releases to occur and for the described items to be added
|
|
100
100
|
to the release notes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/rules/requireJsdoc.js"],"names":["OPTIONS_SCHEMA","additionalProperties","properties","checkConstructors","default","type","checkGetters","anyOf","enum","checkSetters","contexts","items","context","inlineCommentBlock","minLineCount","enableFixer","exemptEmptyConstructors","exemptEmptyFunctions","fixerMessage","publicOnly","oneOf","ancestorsOnly","cjs","esm","window","require","ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression","MethodDefinition","getOption","baseObject","option","key","options","getOptions","undefined","baseObj","prop","Object","keys","opt","create","sourceCode","getSourceCode","settings","requireOption","checkJsDoc","info","handler","node","some","count","underMinLine","getText","match","length","contextMinLineCount","find","ctxt","selector","jsDocNode","jsdocUtils","exemptSpeciaMethods","tags","isFunctionContext","isConstructor","functionParameterNames","getFunctionParameterNames","hasReturnValue","fix","fixer","lines","minLines","maxLines","baseNode","decorator","indent","getIndent","text","loc","start","column","insertion","repeat","slice","insertTextBefore","report","end","line","messageId","Boolean","initModuleExports","initWindow","exported","exportParser","isUncommentedExport","hasOption","getContextObject","enforcedContexts","includes","parent","value","meta","docs","category","description","recommended","url","fixable","messages","missingJsDoc","schema"],"mappings":";;;;;;;AAAA;;AAKA;;AACA;;AAGA;;;;AAEA,MAAMA,cAAc,GAAG;AACrBC,EAAAA,oBAAoB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EAOE;AACAvD,UAAAA,UAAU,CAAC;AACTkB,YAAAA,iBAAiB,EAAE;AADV,WAAD,EAEP,IAFO,EAEDf,IAFC,CAAV;AAGD;AACF,OAvEI;;AAyELrB,MAAAA,gBAAgB,CAAEqB,IAAF,EAAQ;AACtB,YAAI,CAAC+C,SAAS,CAAC,kBAAD,CAAd,EAAoC;AAClC;AACD;;AAEDlD,QAAAA,UAAU,CAAC;AACTkB,UAAAA,iBAAiB,EAAE,IADV;AAETL,UAAAA,QAAQ,EAAE;AAFD,SAAD,EAGP,IAHO,EAGDV,IAAI,CAACoD,KAHJ,CAAV;AAID;;AAlFI,KAAP;AAoFD,GA/OY;;AAgPbC,EAAAA,IAAI,EAAE;AACJC,IAAAA,IAAI,EAAE;AACJC,MAAAA,QAAQ,EAAE,kBADN;AAEJC,MAAAA,WAAW,EAAE,wBAFT;AAGJC,MAAAA,WAAW,EAAE,MAHT;AAIJC,MAAAA,GAAG,EAAE;AAJD,KADF;AAQJC,IAAAA,OAAO,EAAE,MARL;AAUJC,IAAAA,QAAQ,EAAE;AACRC,MAAAA,YAAY,EAAE;AADN,KAVN;AAcJC,IAAAA,MAAM,EAAE,CACNlH,cADM,CAdJ;AAkBJK,IAAAA,IAAI,EAAE;AAlBF;AAhPO,C","sourcesContent":["import {\n getJSDocComment,\n getReducedASTNode,\n getDecorator,\n} from '@es-joy/jsdoccomment';\nimport exportParser from '../exportParser';\nimport {\n getSettings,\n} from '../iterateJsdoc';\nimport jsdocUtils from '../jsdocUtils';\n\nconst OPTIONS_SCHEMA = {\n additionalProperties: false,\n properties: {\n checkConstructors: {\n default: true,\n type: 'boolean',\n },\n checkGetters: {\n anyOf: [\n {\n type: 'boolean',\n },\n {\n enum: [\n 'no-setter',\n ],\n type: 'string',\n },\n ],\n default: true,\n },\n checkSetters: {\n anyOf: [\n {\n type: 'boolean',\n },\n {\n enum: [\n 'no-getter',\n ],\n type: 'string',\n },\n ],\n default: true,\n },\n contexts: {\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n context: {\n type: 'string',\n },\n inlineCommentBlock: {\n type: 'boolean',\n },\n minLineCount: {\n type: 'integer',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n enableFixer: {\n default: true,\n type: 'boolean',\n },\n exemptEmptyConstructors: {\n default: false,\n type: 'boolean',\n },\n exemptEmptyFunctions: {\n default: false,\n type: 'boolean',\n },\n fixerMessage: {\n default: '',\n type: 'string',\n },\n minLineCount: {\n type: 'integer',\n },\n publicOnly: {\n oneOf: [\n {\n default: false,\n type: 'boolean',\n },\n {\n additionalProperties: false,\n default: {},\n properties: {\n ancestorsOnly: {\n type: 'boolean',\n },\n cjs: {\n type: 'boolean',\n },\n esm: {\n type: 'boolean',\n },\n window: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n },\n require: {\n additionalProperties: false,\n default: {},\n properties: {\n ArrowFunctionExpression: {\n default: false,\n type: 'boolean',\n },\n ClassDeclaration: {\n default: false,\n type: 'boolean',\n },\n ClassExpression: {\n default: false,\n type: 'boolean',\n },\n FunctionDeclaration: {\n default: true,\n type: 'boolean',\n },\n FunctionExpression: {\n default: false,\n type: 'boolean',\n },\n MethodDefinition: {\n default: false,\n type: 'boolean',\n },\n },\n type: 'object',\n },\n },\n type: 'object',\n};\n\nconst getOption = (context, baseObject, option, key) => {\n if (context.options[0] && option in context.options[0] &&\n // Todo: boolean shouldn't be returning property, but tests currently require\n (typeof context.options[0][option] === 'boolean' ||\n key in context.options[0][option])\n ) {\n return context.options[0][option][key];\n }\n\n return baseObject.properties[key].default;\n};\n\nconst getOptions = (context) => {\n const {\n publicOnly,\n contexts = [],\n exemptEmptyConstructors = true,\n exemptEmptyFunctions = false,\n enableFixer = true,\n fixerMessage = '',\n minLineCount = undefined,\n } = context.options[0] || {};\n\n return {\n contexts,\n enableFixer,\n exemptEmptyConstructors,\n exemptEmptyFunctions,\n fixerMessage,\n minLineCount,\n publicOnly: ((baseObj) => {\n if (!publicOnly) {\n return false;\n }\n\n const properties = {};\n for (const prop of Object.keys(baseObj.properties)) {\n const opt = getOption(context, baseObj, 'publicOnly', prop);\n properties[prop] = opt;\n }\n\n return properties;\n })(OPTIONS_SCHEMA.properties.publicOnly.oneOf[1]),\n require: ((baseObj) => {\n const properties = {};\n for (const prop of Object.keys(baseObj.properties)) {\n const opt = getOption(context, baseObj, 'require', prop);\n properties[prop] = opt;\n }\n\n return properties;\n })(OPTIONS_SCHEMA.properties.require),\n };\n};\n\nexport default {\n create (context) {\n const sourceCode = context.getSourceCode();\n const settings = getSettings(context);\n if (!settings) {\n return {};\n }\n\n const {\n require: requireOption,\n contexts,\n publicOnly,\n exemptEmptyFunctions,\n exemptEmptyConstructors,\n enableFixer,\n fixerMessage,\n minLineCount,\n } = getOptions(context);\n\n const checkJsDoc = (info, handler, node) => {\n if (\n // Optimize\n minLineCount !== undefined || contexts.some(({\n minLineCount: count,\n }) => {\n return count !== undefined;\n })\n ) {\n const underMinLine = (count) => {\n return count !== undefined && count >\n (sourceCode.getText(node).match(/\\n/gu)?.length ?? 0) + 1;\n };\n\n if (underMinLine(minLineCount)) {\n return;\n }\n\n const {\n minLineCount: contextMinLineCount,\n } = contexts.find(({\n context: ctxt,\n }) => {\n return ctxt === (info.selector || node.type);\n }) || {};\n if (underMinLine(contextMinLineCount)) {\n return;\n }\n }\n\n const jsDocNode = getJSDocComment(sourceCode, node, settings);\n\n if (jsDocNode) {\n return;\n }\n\n // For those who have options configured against ANY constructors (or\n // setters or getters) being reported\n if (jsdocUtils.exemptSpeciaMethods(\n {\n tags: [],\n }, node, context, [\n OPTIONS_SCHEMA,\n ],\n )) {\n return;\n }\n\n if (\n // Avoid reporting param-less, return-less functions (when\n // `exemptEmptyFunctions` option is set)\n exemptEmptyFunctions && info.isFunctionContext ||\n\n // Avoid reporting param-less, return-less constructor methods (when\n // `exemptEmptyConstructors` option is set)\n exemptEmptyConstructors && jsdocUtils.isConstructor(node)\n ) {\n const functionParameterNames = jsdocUtils.getFunctionParameterNames(node);\n if (!functionParameterNames.length && !jsdocUtils.hasReturnValue(node)) {\n return;\n }\n }\n\n const fix = (fixer) => {\n // Default to one line break if the `minLines`/`maxLines` settings allow\n const lines = settings.minLines === 0 && settings.maxLines >= 1 ? 1 : settings.minLines;\n let baseNode = getReducedASTNode(node, sourceCode);\n\n const decorator = getDecorator(baseNode);\n if (decorator) {\n baseNode = decorator;\n }\n\n const indent = jsdocUtils.getIndent({\n text: sourceCode.getText(\n baseNode,\n baseNode.loc.start.column,\n ),\n });\n\n const {\n inlineCommentBlock,\n } = contexts.find(({\n context: ctxt,\n }) => {\n return ctxt === node.type;\n }) || {};\n const insertion = (inlineCommentBlock ?\n `/** ${fixerMessage}` :\n `/**\\n${indent}*${fixerMessage}\\n${indent}`) +\n `*/${'\\n'.repeat(lines)}${indent.slice(0, -1)}`;\n\n return fixer.insertTextBefore(baseNode, insertion);\n };\n\n const report = () => {\n const {\n start,\n } = node.loc;\n const loc = {\n end: {\n line: start.line + 1,\n },\n start: node.loc.start,\n };\n context.report({\n fix: enableFixer ? fix : null,\n loc,\n messageId: 'missingJsDoc',\n node,\n });\n };\n\n if (publicOnly) {\n const opt = {\n ancestorsOnly: Boolean(publicOnly?.ancestorsOnly ?? false),\n esm: Boolean(publicOnly?.esm ?? true),\n initModuleExports: Boolean(publicOnly?.cjs ?? true),\n initWindow: Boolean(publicOnly?.window ?? false),\n };\n const exported = exportParser.isUncommentedExport(node, sourceCode, opt, settings);\n\n if (exported) {\n report();\n }\n } else {\n report();\n }\n };\n\n const hasOption = (prop) => {\n return requireOption[prop] || contexts.some((ctxt) => {\n return typeof ctxt === 'object' ? ctxt.context === prop : ctxt === prop;\n });\n };\n\n return {\n ...jsdocUtils.getContextObject(\n jsdocUtils.enforcedContexts(context, []),\n checkJsDoc,\n ),\n ArrowFunctionExpression (node) {\n if (!hasOption('ArrowFunctionExpression')) {\n return;\n }\n\n if (\n [\n 'VariableDeclarator', 'AssignmentExpression', 'ExportDefaultDeclaration',\n ].includes(node.parent.type) ||\n [\n 'Property', 'ObjectProperty', 'ClassProperty', 'PropertyDefinition',\n ].includes(node.parent.type) && node === node.parent.value\n ) {\n checkJsDoc({\n isFunctionContext: true,\n }, null, node);\n }\n },\n\n ClassDeclaration (node) {\n if (!hasOption('ClassDeclaration')) {\n return;\n }\n\n checkJsDoc({\n isFunctionContext: false,\n }, null, node);\n },\n\n ClassExpression (node) {\n if (!hasOption('ClassExpression')) {\n return;\n }\n\n checkJsDoc({\n isFunctionContext: false,\n }, null, node);\n },\n\n FunctionDeclaration (node) {\n if (!hasOption('FunctionDeclaration')) {\n return;\n }\n\n checkJsDoc({\n isFunctionContext: true,\n }, null, node);\n },\n\n FunctionExpression (node) {\n if (!hasOption('FunctionExpression')) {\n return;\n }\n\n if (\n [\n 'VariableDeclarator', 'AssignmentExpression', 'ExportDefaultDeclaration',\n ].includes(node.parent.type) ||\n [\n 'Property', 'ObjectProperty', 'ClassProperty', 'PropertyDefinition',\n ].includes(node.parent.type) && node === node.parent.value\n ) {\n checkJsDoc({\n isFunctionContext: true,\n }, null, node);\n }\n },\n\n MethodDefinition (node) {\n if (!hasOption('MethodDefinition')) {\n return;\n }\n\n checkJsDoc({\n isFunctionContext: true,\n selector: 'MethodDefinition',\n }, null, node.value);\n },\n };\n },\n meta: {\n docs: {\n category: 'Stylistic Issues',\n description: 'Require JSDoc comments',\n recommended: 'true',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-jsdoc',\n },\n\n fixable: 'code',\n\n messages: {\n missingJsDoc: 'Missing JSDoc comment.',\n },\n\n schema: [\n OPTIONS_SCHEMA,\n ],\n\n type: 'suggestion',\n },\n};\n"],"file":"requireJsdoc.js"}
|
|
1
|
+
{"version":3,"sources":["../../src/rules/requireJsdoc.js"],"names":["OPTIONS_SCHEMA","additionalProperties","properties","checkConstructors","default","type","checkGetters","anyOf","enum","checkSetters","contexts","items","context","inlineCommentBlock","minLineCount","enableFixer","exemptEmptyConstructors","exemptEmptyFunctions","fixerMessage","publicOnly","oneOf","ancestorsOnly","cjs","esm","window","require","ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression","MethodDefinition","getOption","baseObject","option","key","options","getOptions","undefined","baseObj","prop","Object","keys","opt","create","sourceCode","getSourceCode","settings","requireOption","checkJsDoc","info","handler","node","some","count","underMinLine","getText","match","length","contextMinLineCount","find","ctxt","selector","jsDocNode","jsdocUtils","exemptSpeciaMethods","tags","isFunctionContext","isConstructor","functionParameterNames","getFunctionParameterNames","hasReturnValue","fix","fixer","lines","minLines","maxLines","baseNode","decorator","indent","getIndent","text","loc","start","column","insertion","repeat","slice","insertTextBefore","report","end","line","messageId","Boolean","initModuleExports","initWindow","exported","exportParser","isUncommentedExport","hasOption","getContextObject","enforcedContexts","includes","parent","value","meta","docs","category","description","recommended","url","fixable","messages","missingJsDoc","schema"],"mappings":";;;;;;;AAAA;;AAKA;;AACA;;AAGA;;;;AAEA,MAAMA,cAAc,GAAG;AACrBC,EAAAA,oBAAoB,EAAE,KADD;AAErBC,EAAAA,UAAU,EAAE;AACVC,IAAAA,iBAAiB,EAAE;AACjBC,MAAAA,OAAO,EAAE,IADQ;AAEjBC,MAAAA,IAAI,EAAE;AAFW,KADT;AAKVC,IAAAA,YAAY,EAAE;AACZC,MAAAA,KAAK,EAAE,CACL;AACEF,QAAAA,IAAI,EAAE;AADR,OADK,EAIL;AACEG,QAAAA,IAAI,EAAE,CACJ,WADI,CADR;AAIEH,QAAAA,IAAI,EAAE;AAJR,OAJK,CADK;AAYZD,MAAAA,OAAO,EAAE;AAZG,KALJ;AAmBVK,IAAAA,YAAY,EAAE;AACZF,MAAAA,KAAK,EAAE,CACL;AACEF,QAAAA,IAAI,EAAE;AADR,OADK,EAIL;AACEG,QAAAA,IAAI,EAAE,CACJ,WADI,CADR;AAIEH,QAAAA,IAAI,EAAE;AAJR,OAJK,CADK;AAYZD,MAAAA,OAAO,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FT;AAGJC,MAAAA,WAAW,EAAE,MAHT;AAIJC,MAAAA,GAAG,EAAE;AAJD,KADF;AAQJC,IAAAA,OAAO,EAAE,MARL;AAUJC,IAAAA,QAAQ,EAAE;AACRC,MAAAA,YAAY,EAAE;AADN,KAVN;AAcJC,IAAAA,MAAM,EAAE,CACNlH,cADM,CAdJ;AAkBJK,IAAAA,IAAI,EAAE;AAlBF;AAjPO,C","sourcesContent":["import {\n getJSDocComment,\n getReducedASTNode,\n getDecorator,\n} from '@es-joy/jsdoccomment';\nimport exportParser from '../exportParser';\nimport {\n getSettings,\n} from '../iterateJsdoc';\nimport jsdocUtils from '../jsdocUtils';\n\nconst OPTIONS_SCHEMA = {\n additionalProperties: false,\n properties: {\n checkConstructors: {\n default: true,\n type: 'boolean',\n },\n checkGetters: {\n anyOf: [\n {\n type: 'boolean',\n },\n {\n enum: [\n 'no-setter',\n ],\n type: 'string',\n },\n ],\n default: true,\n },\n checkSetters: {\n anyOf: [\n {\n type: 'boolean',\n },\n {\n enum: [\n 'no-getter',\n ],\n type: 'string',\n },\n ],\n default: true,\n },\n contexts: {\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n context: {\n type: 'string',\n },\n inlineCommentBlock: {\n type: 'boolean',\n },\n minLineCount: {\n type: 'integer',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n enableFixer: {\n default: true,\n type: 'boolean',\n },\n exemptEmptyConstructors: {\n default: false,\n type: 'boolean',\n },\n exemptEmptyFunctions: {\n default: false,\n type: 'boolean',\n },\n fixerMessage: {\n default: '',\n type: 'string',\n },\n minLineCount: {\n type: 'integer',\n },\n publicOnly: {\n oneOf: [\n {\n default: false,\n type: 'boolean',\n },\n {\n additionalProperties: false,\n default: {},\n properties: {\n ancestorsOnly: {\n type: 'boolean',\n },\n cjs: {\n type: 'boolean',\n },\n esm: {\n type: 'boolean',\n },\n window: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n },\n require: {\n additionalProperties: false,\n default: {},\n properties: {\n ArrowFunctionExpression: {\n default: false,\n type: 'boolean',\n },\n ClassDeclaration: {\n default: false,\n type: 'boolean',\n },\n ClassExpression: {\n default: false,\n type: 'boolean',\n },\n FunctionDeclaration: {\n default: true,\n type: 'boolean',\n },\n FunctionExpression: {\n default: false,\n type: 'boolean',\n },\n MethodDefinition: {\n default: false,\n type: 'boolean',\n },\n },\n type: 'object',\n },\n },\n type: 'object',\n};\n\nconst getOption = (context, baseObject, option, key) => {\n if (context.options[0] && option in context.options[0] &&\n // Todo: boolean shouldn't be returning property, but tests currently require\n (typeof context.options[0][option] === 'boolean' ||\n key in context.options[0][option])\n ) {\n return context.options[0][option][key];\n }\n\n return baseObject.properties[key].default;\n};\n\nconst getOptions = (context) => {\n const {\n publicOnly,\n contexts = [],\n exemptEmptyConstructors = true,\n exemptEmptyFunctions = false,\n enableFixer = true,\n fixerMessage = '',\n minLineCount = undefined,\n } = context.options[0] || {};\n\n return {\n contexts,\n enableFixer,\n exemptEmptyConstructors,\n exemptEmptyFunctions,\n fixerMessage,\n minLineCount,\n publicOnly: ((baseObj) => {\n if (!publicOnly) {\n return false;\n }\n\n const properties = {};\n for (const prop of Object.keys(baseObj.properties)) {\n const opt = getOption(context, baseObj, 'publicOnly', prop);\n properties[prop] = opt;\n }\n\n return properties;\n })(OPTIONS_SCHEMA.properties.publicOnly.oneOf[1]),\n require: ((baseObj) => {\n const properties = {};\n for (const prop of Object.keys(baseObj.properties)) {\n const opt = getOption(context, baseObj, 'require', prop);\n properties[prop] = opt;\n }\n\n return properties;\n })(OPTIONS_SCHEMA.properties.require),\n };\n};\n\nexport default {\n create (context) {\n const sourceCode = context.getSourceCode();\n const settings = getSettings(context);\n if (!settings) {\n return {};\n }\n\n const {\n require: requireOption,\n contexts,\n publicOnly,\n exemptEmptyFunctions,\n exemptEmptyConstructors,\n enableFixer,\n fixerMessage,\n minLineCount,\n } = getOptions(context);\n\n const checkJsDoc = (info, handler, node) => {\n if (\n // Optimize\n minLineCount !== undefined || contexts.some(({\n minLineCount: count,\n }) => {\n return count !== undefined;\n })\n ) {\n const underMinLine = (count) => {\n return count !== undefined && count >\n (sourceCode.getText(node).match(/\\n/gu)?.length ?? 0) + 1;\n };\n\n if (underMinLine(minLineCount)) {\n return;\n }\n\n const {\n minLineCount: contextMinLineCount,\n } = contexts.find(({\n context: ctxt,\n }) => {\n return ctxt === (info.selector || node.type);\n }) || {};\n if (underMinLine(contextMinLineCount)) {\n return;\n }\n }\n\n const jsDocNode = getJSDocComment(sourceCode, node, settings);\n\n if (jsDocNode) {\n return;\n }\n\n // For those who have options configured against ANY constructors (or\n // setters or getters) being reported\n if (jsdocUtils.exemptSpeciaMethods(\n {\n tags: [],\n }, node, context, [\n OPTIONS_SCHEMA,\n ],\n )) {\n return;\n }\n\n if (\n // Avoid reporting param-less, return-less functions (when\n // `exemptEmptyFunctions` option is set)\n exemptEmptyFunctions && info.isFunctionContext ||\n\n // Avoid reporting param-less, return-less constructor methods (when\n // `exemptEmptyConstructors` option is set)\n exemptEmptyConstructors && jsdocUtils.isConstructor(node)\n ) {\n const functionParameterNames = jsdocUtils.getFunctionParameterNames(node);\n if (!functionParameterNames.length && !jsdocUtils.hasReturnValue(node)) {\n return;\n }\n }\n\n const fix = (fixer) => {\n // Default to one line break if the `minLines`/`maxLines` settings allow\n const lines = settings.minLines === 0 && settings.maxLines >= 1 ? 1 : settings.minLines;\n let baseNode = getReducedASTNode(node, sourceCode);\n\n const decorator = getDecorator(baseNode);\n if (decorator) {\n baseNode = decorator;\n }\n\n const indent = jsdocUtils.getIndent({\n text: sourceCode.getText(\n baseNode,\n baseNode.loc.start.column,\n ),\n });\n\n const {\n inlineCommentBlock,\n } = contexts.find(({\n context: ctxt,\n }) => {\n return ctxt === node.type;\n }) || {};\n const insertion = (inlineCommentBlock ?\n `/** ${fixerMessage}` :\n `/**\\n${indent}*${fixerMessage}\\n${indent}`) +\n `*/${'\\n'.repeat(lines)}${indent.slice(0, -1)}`;\n\n return fixer.insertTextBefore(baseNode, insertion);\n };\n\n const report = () => {\n const {\n start,\n } = node.loc;\n const loc = {\n end: {\n column: 0,\n line: start.line + 1,\n },\n start: node.loc.start,\n };\n context.report({\n fix: enableFixer ? fix : null,\n loc,\n messageId: 'missingJsDoc',\n node,\n });\n };\n\n if (publicOnly) {\n const opt = {\n ancestorsOnly: Boolean(publicOnly?.ancestorsOnly ?? false),\n esm: Boolean(publicOnly?.esm ?? true),\n initModuleExports: Boolean(publicOnly?.cjs ?? true),\n initWindow: Boolean(publicOnly?.window ?? false),\n };\n const exported = exportParser.isUncommentedExport(node, sourceCode, opt, settings);\n\n if (exported) {\n report();\n }\n } else {\n report();\n }\n };\n\n const hasOption = (prop) => {\n return requireOption[prop] || contexts.some((ctxt) => {\n return typeof ctxt === 'object' ? ctxt.context === prop : ctxt === prop;\n });\n };\n\n return {\n ...jsdocUtils.getContextObject(\n jsdocUtils.enforcedContexts(context, []),\n checkJsDoc,\n ),\n ArrowFunctionExpression (node) {\n if (!hasOption('ArrowFunctionExpression')) {\n return;\n }\n\n if (\n [\n 'VariableDeclarator', 'AssignmentExpression', 'ExportDefaultDeclaration',\n ].includes(node.parent.type) ||\n [\n 'Property', 'ObjectProperty', 'ClassProperty', 'PropertyDefinition',\n ].includes(node.parent.type) && node === node.parent.value\n ) {\n checkJsDoc({\n isFunctionContext: true,\n }, null, node);\n }\n },\n\n ClassDeclaration (node) {\n if (!hasOption('ClassDeclaration')) {\n return;\n }\n\n checkJsDoc({\n isFunctionContext: false,\n }, null, node);\n },\n\n ClassExpression (node) {\n if (!hasOption('ClassExpression')) {\n return;\n }\n\n checkJsDoc({\n isFunctionContext: false,\n }, null, node);\n },\n\n FunctionDeclaration (node) {\n if (!hasOption('FunctionDeclaration')) {\n return;\n }\n\n checkJsDoc({\n isFunctionContext: true,\n }, null, node);\n },\n\n FunctionExpression (node) {\n if (!hasOption('FunctionExpression')) {\n return;\n }\n\n if (\n [\n 'VariableDeclarator', 'AssignmentExpression', 'ExportDefaultDeclaration',\n ].includes(node.parent.type) ||\n [\n 'Property', 'ObjectProperty', 'ClassProperty', 'PropertyDefinition',\n ].includes(node.parent.type) && node === node.parent.value\n ) {\n checkJsDoc({\n isFunctionContext: true,\n }, null, node);\n }\n },\n\n MethodDefinition (node) {\n if (!hasOption('MethodDefinition')) {\n return;\n }\n\n checkJsDoc({\n isFunctionContext: true,\n selector: 'MethodDefinition',\n }, null, node.value);\n },\n };\n },\n meta: {\n docs: {\n category: 'Stylistic Issues',\n description: 'Require JSDoc comments',\n recommended: 'true',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-jsdoc',\n },\n\n fixable: 'code',\n\n messages: {\n missingJsDoc: 'Missing JSDoc comment.',\n },\n\n schema: [\n OPTIONS_SCHEMA,\n ],\n\n type: 'suggestion',\n },\n};\n"],"file":"requireJsdoc.js"}
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"url": "http://gajus.com"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@es-joy/jsdoccomment": "~0.
|
|
8
|
+
"@es-joy/jsdoccomment": "~0.29.0",
|
|
9
9
|
"comment-parser": "1.3.1",
|
|
10
10
|
"debug": "^4.3.4",
|
|
11
11
|
"escape-string-regexp": "^4.0.0",
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"chai": "^4.3.6",
|
|
33
33
|
"cross-env": "^7.0.3",
|
|
34
34
|
"decamelize": "^5.0.1",
|
|
35
|
-
"eslint": "^8.
|
|
35
|
+
"eslint": "^8.14.0",
|
|
36
36
|
"eslint-config-canonical": "~33.0.1",
|
|
37
37
|
"gitdown": "^3.1.5",
|
|
38
38
|
"glob": "^8.0.1",
|
|
39
39
|
"husky": "^7.0.4",
|
|
40
40
|
"jsdoc-type-pratt-parser": "^3.0.1",
|
|
41
|
-
"lint-staged": "^12.
|
|
41
|
+
"lint-staged": "^12.4.0",
|
|
42
42
|
"lodash.defaultsdeep": "^4.6.1",
|
|
43
43
|
"mocha": "^9.2.2",
|
|
44
44
|
"nyc": "^15.1.0",
|
|
@@ -117,5 +117,5 @@
|
|
|
117
117
|
"test-cov": "cross-env TIMING=1 nyc --reporter text npm run test-no-cov",
|
|
118
118
|
"test-index": "npm run test-no-cov -- test/rules/index.js"
|
|
119
119
|
},
|
|
120
|
-
"version": "39.2.
|
|
120
|
+
"version": "39.2.8"
|
|
121
121
|
}
|