eslint-docgen 0.7.0 → 0.7.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 +12 -0
- package/package.json +3 -3
- package/src/fix.js +2 -2
package/README.md
CHANGED
|
@@ -25,6 +25,18 @@ To build your documentation, run your rule tests with the `DOCGEN` environment v
|
|
|
25
25
|
DOCGEN=1 mocha tests/rules/
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
+
You could add this to your package.json to make it available as `npm run doc`, e.g.
|
|
29
|
+
```jsonc
|
|
30
|
+
{
|
|
31
|
+
//
|
|
32
|
+
"scripts": {
|
|
33
|
+
//
|
|
34
|
+
"doc": "rm -rf docs/rules && DOCGEN=1 mochan tests/rules/"
|
|
35
|
+
}
|
|
36
|
+
//
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
28
40
|
Documentation will be built using **rule metadata** and **test data** passed to `RuleTester`:
|
|
29
41
|
|
|
30
42
|
#### `rule.meta.docs.description`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-docgen",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Automatically generate ESLint plugin documentation from rule metadata and test cases.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"chalk": "^4.1.2",
|
|
27
|
-
"ejs": "^3.1.
|
|
27
|
+
"ejs": "^3.1.8",
|
|
28
28
|
"eslint": ">=8.0.0",
|
|
29
29
|
"import-fresh": "^3.3.0",
|
|
30
|
-
"jsonschema": "^1.4.
|
|
30
|
+
"jsonschema": "^1.4.1",
|
|
31
31
|
"merge-options": "^3.0.4",
|
|
32
32
|
"mkdirp": "^1.0.4",
|
|
33
33
|
"pkg-dir": "^5.0.0",
|
package/src/fix.js
CHANGED
|
@@ -37,8 +37,8 @@ async function lintFix( code, testerConfig ) {
|
|
|
37
37
|
|
|
38
38
|
// TODO
|
|
39
39
|
// istanbul ignore next
|
|
40
|
-
if (
|
|
41
|
-
linter.defineParser(
|
|
40
|
+
if ( typeof mergedConfig.parser === 'string' ) {
|
|
41
|
+
linter.defineParser( mergedConfig.parser, require( mergedConfig.parser ) );
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
const result = linter.verifyAndFix( code, mergedConfig );
|