mm_ip 1.0.1 → 1.0.3

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 CHANGED
@@ -1,6 +1,8 @@
1
1
  # mm_ip
2
2
 
3
- [English](README_EN.md) | [中文](README.md)
3
+ **Language:** [中文](./README.md) | [English](./README_EN.md)
4
+
5
+ ---
4
6
 
5
7
  一个功能强大的IP管理模块,支持白名单、黑名单管理、IP请求频率监控、违规记录和持久化存储。
6
8
 
package/README_EN.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # mm_ip
2
2
 
3
- [English](README_EN.md) | [中文](README.md)
3
+ **Language:** [中文](./README.md) | [English](./README_EN.md)
4
+
5
+ ---
4
6
 
5
7
  A powerful IP management module that supports whitelist, blacklist management, IP request frequency monitoring, violation records, and persistent storage.
6
8
 
@@ -8,20 +8,20 @@
8
8
  "black_time": [
9
9
  [
10
10
  "172.16.0.2",
11
- 1765261940971
11
+ 1765868172389
12
12
  ],
13
13
  [
14
14
  "192.168.100.2",
15
- 1765262134846
15
+ 1765868205392
16
16
  ],
17
17
  [
18
18
  "192.168.200.2",
19
- 1765262135900
19
+ 1765868206419
20
20
  ],
21
21
  [
22
22
  "192.168.200.3",
23
- 1765262135908
23
+ 1765868206425
24
24
  ]
25
25
  ],
26
- "timestamp": 1765262142949
26
+ "timestamp": 1765868213494
27
27
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "violation_count": [],
3
3
  "violation_time": [],
4
- "timestamp": 1765262142949
4
+ "timestamp": 1765868213494
5
5
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "white": [],
3
- "timestamp": 1765262142949
3
+ "timestamp": 1765868213494
4
4
  }
@@ -0,0 +1,68 @@
1
+ const jsdoc = require('eslint-plugin-jsdoc');
2
+
3
+ module.exports = [
4
+ {
5
+ files: ['lib/**/*.js'],
6
+ languageOptions: {
7
+ ecmaVersion: 2020,
8
+ sourceType: 'script'
9
+ },
10
+ plugins: {
11
+ jsdoc: jsdoc
12
+ },
13
+ rules: {
14
+ // JSDoc相关规则 - 设置为error级别强制要求
15
+ 'jsdoc/require-jsdoc': ['error', {
16
+ require: {
17
+ FunctionDeclaration: true,
18
+ MethodDefinition: true,
19
+ ClassDeclaration: true,
20
+ ArrowFunctionExpression: true
21
+ }
22
+ }],
23
+ 'jsdoc/check-param-names': 'off',
24
+ 'jsdoc/check-tag-names': 'off',
25
+ 'jsdoc/check-types': 'off',
26
+ 'jsdoc/require-param': 'off',
27
+ 'jsdoc/require-param-description': 'off',
28
+ 'jsdoc/require-returns': 'off',
29
+ 'jsdoc/require-returns-description': 'off',
30
+
31
+ // 基础语法规则
32
+ 'no-unused-vars': ['error', { args: 'none', vars: 'all' }],
33
+ 'no-console': 'warn',
34
+
35
+ // 代码风格规则
36
+ 'indent': ['error', 2],
37
+ 'quotes': ['error', 'single'],
38
+ 'semi': ['error', 'always'],
39
+ 'comma-dangle': ['error', 'never'],
40
+ 'no-trailing-spaces': 'error',
41
+ 'eol-last': 'error',
42
+ 'max-len': ['error', { code: 100 }],
43
+ 'max-lines-per-function': ['error', { max: 40 }],
44
+ 'complexity': ['error', 12],
45
+ 'max-depth': ['error', 4],
46
+ 'max-params': ['error', 4],
47
+
48
+ // 命名规则
49
+ 'id-length': ['error', {
50
+ min: 1,
51
+ max: 20,
52
+ properties: 'always'
53
+ }]
54
+ }
55
+ },
56
+ {
57
+ files: ['test/**/*.js'],
58
+ languageOptions: {
59
+ ecmaVersion: 2020,
60
+ sourceType: 'script'
61
+ },
62
+ rules: {
63
+ // 测试文件中允许使用console
64
+ 'no-console': 'off',
65
+ 'no-unused-vars': 'off'
66
+ }
67
+ }
68
+ ];