eslint-plugin-crisp 1.4.21 → 1.5.1
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/package.json +6 -5
- package/recommended-vue.js +1 -0
- package/recommended.js +1 -0
- package/rules/jsdoc-align-params.js +14 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-crisp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "Custom ESLint Rules for Crisp",
|
|
5
5
|
"author": "Crisp IM SAS",
|
|
6
6
|
"main": "index.js",
|
|
@@ -16,14 +16,15 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"doctrine": "3.0.0",
|
|
18
18
|
"lodash-es": "4.17.21",
|
|
19
|
-
"eslint-plugin-jsdoc": "50.8.0"
|
|
19
|
+
"eslint-plugin-jsdoc": "50.8.0",
|
|
20
|
+
"typescript": "5.9.2",
|
|
21
|
+
"typescript-eslint": "8.41.0"
|
|
20
22
|
},
|
|
21
23
|
"peerDependencies": {
|
|
22
24
|
"eslint": "9.39.1",
|
|
23
25
|
"eslint-plugin-vue": "10.8.0",
|
|
24
26
|
"eslint-plugin-vue-pug": "1.0.0-alpha.5",
|
|
25
|
-
"globals": "15.15.0"
|
|
26
|
-
"typescript-eslint": "8.41.0"
|
|
27
|
+
"globals": "15.15.0"
|
|
27
28
|
},
|
|
28
29
|
"keywords": [
|
|
29
30
|
"eslint",
|
|
@@ -31,4 +32,4 @@
|
|
|
31
32
|
"vue"
|
|
32
33
|
],
|
|
33
34
|
"license": "MIT"
|
|
34
|
-
}
|
|
35
|
+
}
|
package/recommended-vue.js
CHANGED
package/recommended.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const SCOPE_REGEX = /^\s*\*\s*@(public|private|protected)/;
|
|
2
|
+
const INTERNAL_REGEX = /^\s*\*\s*@internal/;
|
|
2
3
|
const GENERATOR_REGEX = /^\s*\*\s*@generator/;
|
|
3
4
|
const CLASS_REGEX = /^\s*\*\s*@class\b/;
|
|
4
5
|
const CLASSDESC_REGEX = /^\s*\*\s*@classdesc\s*(.*)/;
|
|
@@ -15,6 +16,7 @@ function parseJSDoc(jsdoc) {
|
|
|
15
16
|
let classDescription = "";
|
|
16
17
|
let description = "";
|
|
17
18
|
let scope = "";
|
|
19
|
+
let internal = false;
|
|
18
20
|
let generator = false;
|
|
19
21
|
|
|
20
22
|
for (let i = 1; i < lines.length; i++) {
|
|
@@ -33,6 +35,7 @@ function parseJSDoc(jsdoc) {
|
|
|
33
35
|
// If the line matches any of the other regexes, break out of the loop
|
|
34
36
|
if (
|
|
35
37
|
line.match(SCOPE_REGEX) ||
|
|
38
|
+
line.match(INTERNAL_REGEX) ||
|
|
36
39
|
line.match(PARAM_REGEX) ||
|
|
37
40
|
line.match(RETURN_REGEX) ||
|
|
38
41
|
line.match(YIELD_REGEX)
|
|
@@ -88,13 +91,19 @@ function parseJSDoc(jsdoc) {
|
|
|
88
91
|
scope = scopeMatch[1];
|
|
89
92
|
}
|
|
90
93
|
|
|
94
|
+
if (line.match(INTERNAL_REGEX)) {
|
|
95
|
+
internal = true;
|
|
96
|
+
}
|
|
97
|
+
|
|
91
98
|
const generatorMatch = line.match(GENERATOR_REGEX);
|
|
92
99
|
if (generatorMatch) {
|
|
93
100
|
generator = true;
|
|
94
101
|
}
|
|
95
102
|
}
|
|
96
103
|
|
|
97
|
-
return {
|
|
104
|
+
return {
|
|
105
|
+
description, scope, internal, params, returnLine, yieldLine, generator
|
|
106
|
+
};
|
|
98
107
|
}
|
|
99
108
|
|
|
100
109
|
function formatJSDoc(parsedJSDoc, indentation=0) {
|
|
@@ -123,6 +132,10 @@ function formatJSDoc(parsedJSDoc, indentation=0) {
|
|
|
123
132
|
jsdoc += indent + "* @" + parsedJSDoc.scope + "\n";
|
|
124
133
|
}
|
|
125
134
|
|
|
135
|
+
if (parsedJSDoc.internal) {
|
|
136
|
+
jsdoc += indent + "* @internal\n";
|
|
137
|
+
}
|
|
138
|
+
|
|
126
139
|
if (parsedJSDoc.generator) {
|
|
127
140
|
jsdoc += indent + "* @generator\n";
|
|
128
141
|
}
|