Skip to content

Commit bd90d9b

Browse files
committed
chore: update jsdoccomment demonstrating alpha.2 fix and workaround for #509
1 parent f5c9a43 commit bd90d9b

File tree

3 files changed

+35
-5
lines changed

3 files changed

+35
-5
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8505,6 +8505,14 @@ function quux () {
85058505

85068506
}
85078507
// Message: Rule `no-restricted-syntax` is missing a `context` option.
8508+
8509+
/**
8510+
* @param opt_a
8511+
* @param opt_b
8512+
*/
8513+
function a () {}
8514+
// "jsdoc/no-restricted-syntax": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock:has(JsdocTag[name=/opt_/])","context":"FunctionDeclaration","message":"Only allowing names not matching `/^opt_/i`."}]}]
8515+
// Message: Only allowing names not matching `/^opt_/i`.
85088516
````
85098517

85108518
The following patterns are not considered problems:

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"url": "http://gajus.com"
66
},
77
"dependencies": {
8-
"@es-joy/jsdoccomment": "^0.8.0-alpha.1",
8+
"@es-joy/jsdoccomment": "^0.8.0-alpha.2",
99
"comment-parser": "1.1.5",
1010
"debug": "^4.3.1",
1111
"esquery": "^1.4.0",
@@ -19,14 +19,14 @@
1919
"devDependencies": {
2020
"@babel/cli": "^7.14.3",
2121
"@babel/core": "^7.14.3",
22-
"@babel/eslint-parser": "^7.14.3",
22+
"@babel/eslint-parser": "^7.14.4",
2323
"@babel/node": "^7.14.2",
2424
"@babel/plugin-syntax-class-properties": "^7.12.13",
2525
"@babel/plugin-transform-flow-strip-types": "^7.13.0",
26-
"@babel/preset-env": "^7.14.2",
26+
"@babel/preset-env": "^7.14.4",
2727
"@babel/register": "^7.13.16",
2828
"@hkdobrev/run-if-changed": "^0.3.1",
29-
"@typescript-eslint/parser": "^4.24.0",
29+
"@typescript-eslint/parser": "^4.25.0",
3030
"babel-plugin-add-module-exports": "^1.0.4",
3131
"babel-plugin-istanbul": "^6.0.0",
3232
"chai": "^4.3.4",
@@ -42,7 +42,7 @@
4242
"open-editor": "^3.0.0",
4343
"rimraf": "^3.0.2",
4444
"semantic-release": "^17.4.3",
45-
"typescript": "^4.2.4"
45+
"typescript": "^4.3.2"
4646
},
4747
"engines": {
4848
"node": ">=12"

test/rules/assertions/noRestrictedSyntax.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,28 @@ export default {
115115
},
116116
],
117117
},
118+
{
119+
code: `
120+
/**
121+
* @param opt_a
122+
* @param opt_b
123+
*/
124+
function a () {}
125+
`,
126+
errors: [{
127+
line: 2,
128+
message: 'Only allowing names not matching `/^opt_/i`.',
129+
}],
130+
options: [{
131+
contexts: [
132+
{
133+
comment: 'JsdocBlock:has(JsdocTag[name=/opt_/])',
134+
context: 'FunctionDeclaration',
135+
message: 'Only allowing names not matching `/^opt_/i`.',
136+
},
137+
],
138+
}],
139+
},
118140
],
119141
valid: [
120142
{

0 commit comments

Comments
 (0)