@siemens/eslint-plugin-defaultvalue 1.0.2 → 1.1.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/README.md +0 -13
- package/lib/rules/default-value.js +9 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,16 +33,3 @@ export default [
|
|
|
33
33
|
}
|
|
34
34
|
];
|
|
35
35
|
```
|
|
36
|
-
|
|
37
|
-
### Removing not resolved and setter @defaultValue annotations
|
|
38
|
-
|
|
39
|
-
To automatically remove not resolvable and setter @defaultValue annotations, use the following configuration:
|
|
40
|
-
|
|
41
|
-
```js
|
|
42
|
-
...,
|
|
43
|
-
rules: {
|
|
44
|
-
...,
|
|
45
|
-
'defaultvalue/tsdoc-defaultValue-annotation': ['error', 'removeAll', 1000]
|
|
46
|
-
}
|
|
47
|
-
...
|
|
48
|
-
```
|
|
@@ -143,8 +143,16 @@ const extractCallExpression = (callExpression, sourceCode, readonly) => {
|
|
|
143
143
|
// This will never have a defaultValue.
|
|
144
144
|
return undefined;
|
|
145
145
|
}
|
|
146
|
+
// Should not be documented.
|
|
147
|
+
if (readonly) {
|
|
148
|
+
return undefined;
|
|
149
|
+
}
|
|
146
150
|
return sourceCode.getText(callExpression);
|
|
147
151
|
default:
|
|
152
|
+
// Should not be documented.
|
|
153
|
+
if (readonly) {
|
|
154
|
+
return undefined;
|
|
155
|
+
}
|
|
148
156
|
return sourceCode.getText(callExpression);
|
|
149
157
|
}
|
|
150
158
|
};
|
|
@@ -192,12 +200,7 @@ export default createRule({
|
|
|
192
200
|
docs: {
|
|
193
201
|
description: 'enforce correct @defaultValue TSDoc annotation'
|
|
194
202
|
},
|
|
195
|
-
schema: [
|
|
196
|
-
{
|
|
197
|
-
type: 'string',
|
|
198
|
-
enum: ['removeAll', 'default']
|
|
199
|
-
}
|
|
200
|
-
],
|
|
203
|
+
schema: [],
|
|
201
204
|
fixable: 'code',
|
|
202
205
|
messages: {
|
|
203
206
|
incorrectDefaultValueAnnotation: 'Incorrect @defaultValue TSDoc annotation: {{ message }}',
|
package/package.json
CHANGED