@mimik/eslint-plugin-document-env 2.0.0 → 2.0.2
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/.eslintrc +34 -0
- package/README.md +8 -10
- package/index.js +1 -1
- package/package.json +17 -26
- package/rollup.config.js +0 -14
package/.eslintrc
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"env": {
|
|
3
|
+
"node": true
|
|
4
|
+
},
|
|
5
|
+
"parserOptions": {
|
|
6
|
+
"ecmaVersion": 2020
|
|
7
|
+
},
|
|
8
|
+
"extends": "airbnb",
|
|
9
|
+
"rules": {
|
|
10
|
+
"import/no-extraneous-dependencies": ["error", {"devDependencies": true}],
|
|
11
|
+
"brace-style": [1, "stroustrup", {"allowSingleLine": true}],
|
|
12
|
+
"no-confusing-arrow": [0], // arrow isnt confusing
|
|
13
|
+
"max-len": [1, 180, { "ignoreComments": true }],
|
|
14
|
+
"linebreak-style": 0,
|
|
15
|
+
"quotes": [1, "single"],
|
|
16
|
+
"semi": [1, "always"],
|
|
17
|
+
"no-process-env": ["error"]
|
|
18
|
+
},
|
|
19
|
+
"settings":{
|
|
20
|
+
"react": {
|
|
21
|
+
"version": "detect"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"globals": {
|
|
25
|
+
"module": true,
|
|
26
|
+
"require": true,
|
|
27
|
+
"const": false,
|
|
28
|
+
"it": false,
|
|
29
|
+
"describe": false,
|
|
30
|
+
"before": true,
|
|
31
|
+
"after": true,
|
|
32
|
+
"JSON": true
|
|
33
|
+
}
|
|
34
|
+
}
|
package/README.md
CHANGED
|
@@ -6,17 +6,15 @@
|
|
|
6
6
|
npm install @mimik/eslint-plugin-document-env
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
In your
|
|
10
|
-
|
|
11
|
-
```js
|
|
12
|
-
import processDoc from '@mimik/eslint-plugin-document-env';
|
|
9
|
+
In your `.eslintrc`:
|
|
13
10
|
|
|
11
|
+
```json
|
|
14
12
|
{
|
|
15
|
-
plugins:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
rules: {
|
|
19
|
-
|
|
13
|
+
"plugins": [
|
|
14
|
+
"@mimik/document-env"
|
|
15
|
+
],
|
|
16
|
+
"rules": {
|
|
17
|
+
"@mimik/document-env/validate-document-env": 2
|
|
20
18
|
}
|
|
21
19
|
}
|
|
22
20
|
```
|
|
@@ -26,7 +24,7 @@ An [eslint](https://github.com/eslint/eslint) plugin that ...
|
|
|
26
24
|
|
|
27
25
|
### `document-env/validate-document-env`
|
|
28
26
|
|
|
29
|
-
Verifies that when an environment variable is used, there is a
|
|
27
|
+
Verifies that when an environment variable is used, there is a document ation about it after the following header:
|
|
30
28
|
* | Env variable name | Description | Default | Comments |
|
|
31
29
|
* | ----------------- | ----------- | ------- | -------- |
|
|
32
30
|
|
package/index.js
CHANGED
|
@@ -19,7 +19,7 @@ const plugin = {
|
|
|
19
19
|
let propName = node.parent.property.name;
|
|
20
20
|
|
|
21
21
|
if (!propName) propName = context.getSourceCode().text.substring(node.parent.property.start, node.parent.property.end);
|
|
22
|
-
const reg = new RegExp(`^ \\* \\| (${propName.replace(/[|\\{}()[\]^$+*?.]/gu, '\\$&')}) \\| *([^\\|]*)
|
|
22
|
+
const reg = new RegExp(`^ \\* \\| (${propName.replace(/[|\\{}()[\]^$+*?.]/gu, '\\$&')}) \\| *([^\\|]*)`, 'mgu');
|
|
23
23
|
|
|
24
24
|
allComments.forEach((comment) => {
|
|
25
25
|
if (!foundDocument && comment.type === 'Block' && comment.value.includes(HEADER) && comment.value.includes(LINE)) {
|
package/package.json
CHANGED
|
@@ -1,47 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mimik/eslint-plugin-document-env",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "validation of environement variable documentation",
|
|
5
|
-
"main": "./
|
|
5
|
+
"main": "./index.js",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
"scripts": {
|
|
8
|
+
"lint": "eslint . --no-error-on-unmatched-pattern",
|
|
9
|
+
"test": "echo \"Error: no test specified\" && exit 0",
|
|
10
|
+
"prepublishOnly": "npm run lint && npm run test"
|
|
11
|
+
},
|
|
12
|
+
"husky": {
|
|
13
|
+
"hooks": {
|
|
14
|
+
"pre-commit": "npm run commit-ready",
|
|
15
|
+
"pre-push": "npm run test"
|
|
12
16
|
}
|
|
13
17
|
},
|
|
14
18
|
"keywords": [
|
|
19
|
+
"mimik",
|
|
15
20
|
"eslint",
|
|
16
21
|
"eslint-plugin",
|
|
17
22
|
"eslintplugin",
|
|
18
23
|
"process.env"
|
|
19
24
|
],
|
|
20
|
-
"license": "MIT",
|
|
21
|
-
"files": [
|
|
22
|
-
"README.md",
|
|
23
|
-
"*.js"
|
|
24
|
-
],
|
|
25
25
|
"author": "mimik technology inc <support@mimik.com> (https://developer.mimik.com/)",
|
|
26
|
+
"license": "MIT",
|
|
26
27
|
"repository": {
|
|
27
28
|
"type": "git",
|
|
28
29
|
"url": "https://bitbucket.org/mimiktech/eslit-plugin-document-env"
|
|
29
30
|
},
|
|
30
|
-
"scripts": {
|
|
31
|
-
"lint": "eslint . --no-error-on-unmatched-pattern",
|
|
32
|
-
"test": "echo \"Error: no test specified\" && exit 0",
|
|
33
|
-
"prepublishOnly": "npm run lint && npm run test && npm run build",
|
|
34
|
-
"build": "rollup -c"
|
|
35
|
-
},
|
|
36
31
|
"devDependencies": {
|
|
37
|
-
"@eslint/js": "9.
|
|
38
|
-
"@
|
|
39
|
-
"
|
|
40
|
-
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
41
|
-
"@rollup/plugin-terser": "0.4.4",
|
|
42
|
-
"@stylistic/eslint-plugin": "2.12.1",
|
|
43
|
-
"eslint": "9.17.0",
|
|
32
|
+
"@eslint/js": "9.20.0",
|
|
33
|
+
"@stylistic/eslint-plugin": "3.1.0",
|
|
34
|
+
"eslint": "9.20.1",
|
|
44
35
|
"eslint-plugin-import": "2.31.0",
|
|
45
|
-
"
|
|
36
|
+
"husky": "9.1.7"
|
|
46
37
|
}
|
|
47
38
|
}
|
package/rollup.config.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import commonjs from '@rollup/plugin-commonjs';
|
|
2
|
-
import resolve from '@rollup/plugin-node-resolve';
|
|
3
|
-
import terser from '@rollup/plugin-terser';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
input: './index.js', // Entry point
|
|
7
|
-
output: [
|
|
8
|
-
{
|
|
9
|
-
file: './dist/index.cjs.js',
|
|
10
|
-
format: 'cjs',
|
|
11
|
-
},
|
|
12
|
-
],
|
|
13
|
-
plugins: [resolve(), commonjs(), terser()],
|
|
14
|
-
};
|