Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noMissingSyntax.js')
-rw-r--r--tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noMissingSyntax.js20
1 files changed, 6 insertions, 14 deletions
diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noMissingSyntax.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noMissingSyntax.js
index d1408b2aaa4..8e135899dc0 100644
--- a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noMissingSyntax.js
+++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noMissingSyntax.js
@@ -38,8 +38,6 @@ var _default = (0, _iterateJsdoc.default)(({
sourceCode,
state
}) => {
- var _foundContext$context;
-
if (!context.options[0]) {
// Handle error later
return;
@@ -55,7 +53,7 @@ var _default = (0, _iterateJsdoc.default)(({
visitorKeys: sourceCode.visitorKeys
})) && comment === cntxt.comment;
});
- const contextStr = typeof foundContext === 'object' ? (_foundContext$context = foundContext.context) !== null && _foundContext$context !== void 0 ? _foundContext$context : 'any' : foundContext;
+ const contextStr = typeof foundContext === 'object' ? foundContext.context ?? 'any' : foundContext;
setDefaults(state);
incrementSelector(state, contextStr, comment);
}, {
@@ -84,20 +82,14 @@ var _default = (0, _iterateJsdoc.default)(({
} = context.options[0]; // Report when MISSING
contexts.some(cntxt => {
- var _cntxt$context, _cntxt$comment, _cntxt$minimum;
-
- const contextStr = typeof cntxt === 'object' ? (_cntxt$context = cntxt.context) !== null && _cntxt$context !== void 0 ? _cntxt$context : 'any' : cntxt;
- const comment = (_cntxt$comment = cntxt === null || cntxt === void 0 ? void 0 : cntxt.comment) !== null && _cntxt$comment !== void 0 ? _cntxt$comment : '';
+ const contextStr = typeof cntxt === 'object' ? cntxt.context ?? 'any' : cntxt;
+ const comment = (cntxt === null || cntxt === void 0 ? void 0 : cntxt.comment) ?? '';
const contextKey = contextStr === 'any' ? undefined : contextStr;
- if ((!state.selectorMap[contextKey] || !state.selectorMap[contextKey][comment] || state.selectorMap[contextKey][comment] < ((_cntxt$minimum = cntxt === null || cntxt === void 0 ? void 0 : cntxt.minimum) !== null && _cntxt$minimum !== void 0 ? _cntxt$minimum : 1)) && (contextStr !== 'any' || Object.values(state.selectorMap).every(cmmnt => {
- var _cntxt$minimum2;
-
- return !cmmnt[comment] || cmmnt[comment] < ((_cntxt$minimum2 = cntxt === null || cntxt === void 0 ? void 0 : cntxt.minimum) !== null && _cntxt$minimum2 !== void 0 ? _cntxt$minimum2 : 1);
+ if ((!state.selectorMap[contextKey] || !state.selectorMap[contextKey][comment] || state.selectorMap[contextKey][comment] < ((cntxt === null || cntxt === void 0 ? void 0 : cntxt.minimum) ?? 1)) && (contextStr !== 'any' || Object.values(state.selectorMap).every(cmmnt => {
+ return !cmmnt[comment] || cmmnt[comment] < ((cntxt === null || cntxt === void 0 ? void 0 : cntxt.minimum) ?? 1);
}))) {
- var _cntxt$message;
-
- const message = (_cntxt$message = cntxt === null || cntxt === void 0 ? void 0 : cntxt.message) !== null && _cntxt$message !== void 0 ? _cntxt$message : 'Syntax is required: {{context}}' + (comment ? ' with {{comment}}' : '');
+ const message = (cntxt === null || cntxt === void 0 ? void 0 : cntxt.message) ?? 'Syntax is required: {{context}}' + (comment ? ' with {{comment}}' : '');
context.report({
data: {
comment,