mm_eslint 1.4.3 → 1.4.5

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 ADDED
@@ -0,0 +1,336 @@
1
+ # MM ESLint Plugin
2
+
3
+ 基于个人命名规范的ESLint插件,支持类名、类实例名、函数名、参数名、变量名、常量名等命名规范检测。
4
+
5
+ [![npm version](https://img.shields.io/npm/v/mm_eslint.svg)](https://www.npmjs.com/package/mm_eslint)
6
+ [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)
7
+ [![Node.js Version](https://img.shields.io/badge/node-%3E%3D12.0.0-brightgreen.svg)](https://nodejs.org/)
8
+
9
+ ## 功能特性
10
+
11
+ - ✅ **类名检测** - 大驼峰命名法(PascalCase)
12
+ - ✅ **类实例名检测** - 小驼峰命名法(camelCase)
13
+ - ✅ **函数名检测** - 小驼峰命名法(camelCase)
14
+ - ✅ **参数名检测** - 小写蛇形命名法(snake_case)
15
+ - ✅ **变量名检测** - 小写蛇形命名法(snake_case)
16
+ - ✅ **常量名检测** - 大写蛇形命名法(UPPER_SNAKE_CASE)
17
+ - ✅ **长度限制** - 所有命名长度限制在1-20字符
18
+ - ✅ **单词长度限制** - 每个单词限制在最大8字符
19
+ - ✅ **禁止废话词** - 避免使用Manager、Handler等冗余词汇
20
+ - ✅ **命名推荐功能** - 推荐更短的替代名称,同时保持语义不变
21
+
22
+ ## 实际支持的规则
23
+
24
+ 插件实际支持以下ESLint规则:
25
+ - `mm_eslint/class-name` - 类名检测
26
+ - `mm_eslint/class-instance-name` - 类实例名检测
27
+ - `mm_eslint/function-name` - 函数名检测
28
+ - `mm_eslint/param-name` - 参数名检测
29
+ - `mm_eslint/variable-name` - 变量名检测
30
+ - `mm_eslint/constant-name` - 常量名检测
31
+
32
+ ## 安装
33
+
34
+ ### npm安装
35
+
36
+ ```bash
37
+ npm install mm_eslint --save-dev
38
+ ```
39
+
40
+ ### 本地安装
41
+
42
+ 如果您想使用本地版本,可以将插件文件复制到项目中:
43
+
44
+ ```bash
45
+ # 复制插件文件到您的项目
46
+ cp mm_eslint/index.js your-project/eslint-plugins/
47
+ ```
48
+
49
+ ## 快速开始
50
+
51
+ ### 1. 基本配置
52
+
53
+ 在您的ESLint配置文件中引入插件:
54
+
55
+ ```javascript
56
+ // eslint.config.js
57
+ const mmEslint = require('mm_eslint');
58
+
59
+ module.exports = [
60
+ {
61
+ files: ['**/*.js'],
62
+ plugins: {
63
+ mm_eslint: {
64
+ rules: mmEslint
65
+ }
66
+ },
67
+ rules: {
68
+ // 命名规范插件规则
69
+ 'mm_eslint/class-name': 'error',
70
+ 'mm_eslint/class-instance-name': 'error',
71
+ 'mm_eslint/function-name': 'error',
72
+ 'mm_eslint/param-name': 'warn',
73
+ 'mm_eslint/variable-name': 'warn',
74
+ 'mm_eslint/constant-name': 'error',
75
+
76
+ // 禁用与命名规范插件冲突的默认规则
77
+ camelcase: 'off',
78
+ 'id-match': 'off',
79
+ 'new-cap': 'off',
80
+ 'id-length': 'off',
81
+ },
82
+ },
83
+ ];
84
+ ```
85
+
86
+ ### 2. 命令行使用
87
+
88
+ ```bash
89
+ # 验证单个文件
90
+ npx eslint your-file.js
91
+
92
+ # 验证所有JS文件
93
+ npx eslint "**/*.js"
94
+
95
+ # 验证并自动修复
96
+ npx eslint --fix your-file.js
97
+ ```
98
+
99
+ ## 命名规范规则
100
+
101
+ ### 类名规则(class-name)
102
+
103
+ - **级别**: error
104
+ - **要求**: 大驼峰命名法(PascalCase)
105
+ - **长度**: 1-20字符
106
+ - **单词长度**: 每个单词≤8字符
107
+ - **示例**: `User`, `DbConn`
108
+ - **错误示例**: `user`, `user_manager`, `UserManager`
109
+
110
+ ### 类实例名规则(class-instance-name)
111
+
112
+ - **级别**: error
113
+ - **要求**: 小驼峰命名法(camelCase)
114
+ - **长度**: 1-20字符
115
+ - **单词长度**: 每个单词≤8字符
116
+ - **示例**: `userInstance`, `dbConn`
117
+ - **错误示例**: `UserInstance`, `db_conn`, `DB_CONN`
118
+
119
+ ### 函数名规则(function-name)
120
+
121
+ - **级别**: error
122
+ - **要求**: 小驼峰命名法(camelCase)
123
+ - **长度**: 1-20字符
124
+ - **单词长度**: 每个单词≤8字符
125
+ - **示例**: `get`, `getName`, `process`
126
+ - **错误示例**: `Get`, `get_name`, `PROCESS`
127
+
128
+ ### 参数名规则(param-name)
129
+
130
+ - **级别**: warn
131
+ - **要求**: 小写蛇形命名法(snake_case)
132
+ - **长度**: 1-20字符
133
+ - **示例**: `user_name`, `max_count`
134
+ - **错误示例**: `userName`, `maxCount`, `MAX_COUNT`
135
+
136
+ ### 变量名规则(variable-name)
137
+
138
+ - **级别**: warn
139
+ - **要求**: 小写蛇形命名法(snake_case)
140
+ - **长度**: 1-20字符
141
+ - **示例**: `user_count`, `max_retry`
142
+ - **错误示例**: `userCount`, `maxRetry`, `MAX_RETRY`
143
+
144
+ ### 常量名规则(constant-name)
145
+
146
+ - **级别**: error
147
+ - **要求**: 大写蛇形命名法(UPPER_SNAKE_CASE)
148
+ - **长度**: 1-20字符
149
+ - **示例**: `MAX_RETRY`, `DEFAULT_TIMEOUT`
150
+ - **错误示例**: `maxRetry`, `defaultTimeout`, `DefaultTimeout`
151
+
152
+ ## 错误示例
153
+
154
+ ```javascript
155
+ // ❌ 错误的命名示例
156
+ class user {} // 类名应该使用 PascalCase
157
+ class user_manager {} // 类名应该使用 PascalCase
158
+ class UserManager {} // 类名应该使用 PascalCase
159
+
160
+ const userInstance = new User(); // 类实例名应该使用 camelCase
161
+ const UserInstance = new User(); // 类实例名应该使用 camelCase
162
+
163
+ function GetUser() {} // 函数名应该使用 camelCase
164
+ function get_user() {} // 函数名应该使用 camelCase
165
+
166
+ function process(userName) {} // 参数名应该使用 snake_case
167
+ const maxRetry = 5; // 变量名应该使用 snake_case
168
+ const defaultTimeout = 1000; // 常量名应该使用 UPPER_SNAKE_CASE
169
+
170
+ // ✅ 正确的命名示例
171
+ class User {}
172
+ class DbConn {}
173
+
174
+ const userInstance = new User();
175
+ const dbConn = new DbConn();
176
+
177
+ function getUser() {}
178
+ function process() {}
179
+
180
+ function process(user_name) {}
181
+ const max_retry = 5;
182
+ const DEFAULT_TIMEOUT = 1000;
183
+ ```
184
+
185
+ ## 单词长度验证
186
+
187
+ 插件验证复合名称中的每个单词不超过8个字符:
188
+
189
+ - **有效**: `UserService`("User"=4, "Service"=7)
190
+ - **无效**: `UserConfiguration`("Configuration"=13 > 8)
191
+ - **有效**: `getUser`("get"=3, "User"=4)
192
+ - **无效**: `getConfiguration`("Configuration"=13 > 8)
193
+
194
+ ## 禁止的冗余词汇
195
+
196
+ 插件会自动检测并禁止使用以下冗余词汇:
197
+
198
+ **类名禁止词**: manager, handler, processor, controller, service, provider, factory, builder, adapter, decorator, proxy, facade, mediator, observer, strategy, command, visitor, iterator, template, flyweight, memento, interpreter, model, view, route, router, component, widget, panel, dialog, window, form, field, property, entity
199
+
200
+ **函数名禁止词**: data, result, output, input, param, params, parameter, parameters, value, values, item, items, process, processor, provider, builder, adapter, decorator, proxy, facade, mediator, observer, strategy, command, visitor, iterator, template, flyweight, memento, interpreter, temp, tmp, temporary, cached, buffered, idx, counter, with
201
+
202
+ **变量名禁止词**: object, array, map, set, collection, container, instance, data, item, items, element, elements, entry, entries, temp, tmp, temporary, cached, buffer, buffered, input, output, result, destination, index, idx, counter, length, total, sum, pointer, reference, ref, handle, handler, entity, column, property, attribute, manager, processor, controller, service, middleware, component, provider
203
+
204
+ ## 命名推荐功能
205
+
206
+ 插件包含智能命名推荐系统,建议使用更短的替代名称,同时保持语义不变。
207
+
208
+ ### 核心原则
209
+
210
+ 核心原则是**"缩短命名而不改变语义"**。推荐系统:
211
+ - 推荐更短的单词,同时保持相同含义
212
+ - 避免会改变功能的概念性变化
213
+ - 确保推荐词始终比原词短
214
+ - 保留编程特定术语和概念差异
215
+
216
+ ### 可用推荐
217
+
218
+ 插件为常见编程操作提供推荐:
219
+
220
+ | 原词 | 推荐词 | 描述 |
221
+ | ------------ | -------- | ---------- |
222
+ | `calculate` | `calc` | 数学运算 |
223
+ | `generate` | `gen` | 数据生成 |
224
+ | `initialize` | `init` | 初始化操作 |
225
+ | `execute` | `exec` | 命令执行 |
226
+ | `process` | `run` | 数据处理 |
227
+ | `retrieve` | `load` | 数据加载 |
228
+ | `persist` | `save` | 数据存储 |
229
+ | `compare` | `cmp` | 比较操作 |
230
+ | `duplicate` | `copy` | 数据复制 |
231
+ | `transfer` | `move` | 数据移动 |
232
+ | `convert` | `to` | 类型转换 |
233
+ | `verify` | `check` | 验证检查 |
234
+ | `construct` | `create` | 对象创建 |
235
+ | `handle` | `run` | 事件处理 |
236
+
237
+ ### 示例
238
+
239
+ ```javascript
240
+ // ❌ 原词(较长名称)
241
+ function calculateTotal() {}
242
+ function generateUserData() {}
243
+ function initializeSystem() {}
244
+ function executeCommand() {}
245
+ function processData() {}
246
+
247
+ // ✅ 推荐词(较短名称)
248
+ function calcTotal() {}
249
+ function genUserData() {}
250
+ function initSystem() {}
251
+ function execCommand() {}
252
+ function runData() {}
253
+ ```
254
+
255
+ ### 带推荐的错误消息
256
+
257
+ 启用推荐功能后,ESLint将建议替代名称:
258
+
259
+ ```bash
260
+ # ESLint输出示例
261
+ function calculateTotal() {}
262
+ # ^ 建议使用'calc'替代'calculate'以获得更短的命名
263
+ ```
264
+
265
+ ## 开发
266
+
267
+ ### 项目结构
268
+
269
+ ```
270
+ mm_eslint/
271
+ ├── index.js # 主插件文件
272
+ ├── config.js # 配置管理
273
+ ├── detector.js # 命名检测器
274
+ ├── validator.js # 验证器
275
+ ├── corrector.js # 命名修正器
276
+ ├── tip.js # 提示信息
277
+ ├── util.js # 工具函数
278
+ ├── handler.js # 规则处理器
279
+ ├── fix.js # 自动修复功能
280
+ ├── package.json # npm配置
281
+ ├── eslint.config.js # ESLint配置示例
282
+ ├── README.md # 中文说明文档
283
+ ├── README_EN.md # 英文说明文档
284
+ ├── LICENSE # 许可证
285
+ └── tests/ # 测试文件
286
+ ├── success/ # 正确示例
287
+ ├── error/ # 错误示例
288
+ └── scence/ # 场景测试
289
+ ```
290
+
291
+ ### 运行测试
292
+
293
+ ```bash
294
+ # 运行单元测试
295
+ npm test
296
+
297
+ # 运行ESLint检查
298
+ npm run lint
299
+ ```
300
+
301
+ ## 许可证
302
+
303
+ ISC License
304
+
305
+ ## 贡献
306
+
307
+ 欢迎提交Issue和Pull Request来改进这个插件。
308
+
309
+ ## 更新日志
310
+
311
+ ### v1.4.4
312
+ - 更新插件名称和规则前缀为 `mm_eslint`
313
+ - 优化模块结构和文件组织
314
+ - 增强测试覆盖率和错误处理
315
+ - 改进文档和示例
316
+
317
+ ### v1.4.3
318
+ - 优化模块结构和文件组织
319
+ - 增强测试覆盖率和错误处理
320
+ - 改进文档和示例
321
+
322
+ ### v1.2.0
323
+ - 模块化重构版,职责分离
324
+ - 增强配置管理
325
+ - 改进命名检测算法
326
+
327
+ ### v1.1.0
328
+ - 添加单词长度验证(每个单词最大8字符)
329
+ - 添加入参名和属性名检测
330
+ - 增强配置,包含完整的ESLint规则
331
+
332
+ ### v1.0.0
333
+ - 初始版本发布
334
+ - 支持类名、函数名、变量名、常量名、私有成员命名规范检测
335
+ - 支持长度限制和单个单词优先规则
336
+ - 支持禁止废话词检测
package/README_EN.md ADDED
@@ -0,0 +1,336 @@
1
+ # MM ESLint Plugin
2
+
3
+ ESLint plugin for personal naming conventions - supports PascalCase, camelCase, snake_case, and UPPER_SNAKE_CASE naming rules.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/mm_eslint.svg)](https://www.npmjs.com/package/mm_eslint)
6
+ [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)
7
+ [![Node.js Version](https://img.shields.io/badge/node-%3E%3D12.0.0-brightgreen.svg)](https://nodejs.org/)
8
+
9
+ ## Features
10
+
11
+ - ✅ **Class Name Detection** - PascalCase naming convention
12
+ - ✅ **Class Instance Name Detection** - camelCase naming convention
13
+ - ✅ **Function Name Detection** - camelCase naming convention
14
+ - ✅ **Parameter Name Detection** - snake_case naming convention
15
+ - ✅ **Variable Name Detection** - snake_case naming convention
16
+ - ✅ **Constant Name Detection** - UPPER_SNAKE_CASE naming convention
17
+ - ✅ **Length Limitation** - All names limited to 1-20 characters
18
+ - ✅ **Word Length Limitation** - Each word limited to maximum 8 characters
19
+ - ✅ **Redundant Word Prevention** - Avoids redundant words like Manager, Handler
20
+ - ✅ **Name Recommendation** - Recommends shorter alternative names while preserving semantics
21
+
22
+ ## Actual Supported Rules
23
+
24
+ The plugin actually supports the following ESLint rules:
25
+ - `mm_eslint/class-name` - Class name detection
26
+ - `mm_eslint/class-instance-name` - Class instance name detection
27
+ - `mm_eslint/function-name` - Function name detection
28
+ - `mm_eslint/param-name` - Parameter name detection
29
+ - `mm_eslint/variable-name` - Variable name detection
30
+ - `mm_eslint/constant-name` - Constant name detection
31
+
32
+ ## Installation
33
+
34
+ ### npm Installation
35
+
36
+ ```bash
37
+ npm install mm_eslint --save-dev
38
+ ```
39
+
40
+ ### Local Installation
41
+
42
+ If you want to use a local version, you can copy the plugin files to your project:
43
+
44
+ ```bash
45
+ # Copy plugin files to your project
46
+ cp mm_eslint/index.js your-project/eslint-plugins/
47
+ ```
48
+
49
+ ## Quick Start
50
+
51
+ ### 1. Basic Configuration
52
+
53
+ Import the plugin in your ESLint configuration file:
54
+
55
+ ```javascript
56
+ // eslint.config.js
57
+ const mmEslint = require('mm_eslint');
58
+
59
+ module.exports = [
60
+ {
61
+ files: ['**/*.js'],
62
+ plugins: {
63
+ mm_eslint: {
64
+ rules: mmEslint
65
+ }
66
+ },
67
+ rules: {
68
+ // Naming convention plugin rules
69
+ 'mm_eslint/class-name': 'error',
70
+ 'mm_eslint/class-instance-name': 'error',
71
+ 'mm_eslint/function-name': 'error',
72
+ 'mm_eslint/param-name': 'warn',
73
+ 'mm_eslint/variable-name': 'warn',
74
+ 'mm_eslint/constant-name': 'error',
75
+
76
+ // Disable default rules conflicting with naming convention plugin
77
+ camelcase: 'off',
78
+ 'id-match': 'off',
79
+ 'new-cap': 'off',
80
+ 'id-length': 'off',
81
+ },
82
+ },
83
+ ];
84
+ ```
85
+
86
+ ### 2. Command Line Usage
87
+
88
+ ```bash
89
+ # Validate single file
90
+ npx eslint your-file.js
91
+
92
+ # Validate all JS files
93
+ npx eslint "**/*.js"
94
+
95
+ # Validate and auto-fix
96
+ npx eslint --fix your-file.js
97
+ ```
98
+
99
+ ## Naming Convention Rules
100
+
101
+ ### Class Name Rule (class-name)
102
+
103
+ - **Level**: error
104
+ - **Requirement**: PascalCase naming convention
105
+ - **Length**: 1-20 characters
106
+ - **Word Length**: Each word ≤8 characters
107
+ - **Example**: `User`, `DbConn`
108
+ - **Error Example**: `user`, `user_manager`, `UserManager`
109
+
110
+ ### Class Instance Name Rule (class-instance-name)
111
+
112
+ - **Level**: error
113
+ - **Requirement**: camelCase naming convention
114
+ - **Length**: 1-20 characters
115
+ - **Word Length**: Each word ≤8 characters
116
+ - **Example**: `userInstance`, `dbConn`
117
+ - **Error Example**: `UserInstance`, `db_conn`, `DB_CONN`
118
+
119
+ ### Function Name Rule (function-name)
120
+
121
+ - **Level**: error
122
+ - **Requirement**: camelCase naming convention
123
+ - **Length**: 1-20 characters
124
+ - **Word Length**: Each word ≤8 characters
125
+ - **Example**: `get`, `getName`, `process`
126
+ - **Error Example**: `Get`, `get_name`, `PROCESS`
127
+
128
+ ### Parameter Name Rule (param-name)
129
+
130
+ - **Level**: warn
131
+ - **Requirement**: snake_case naming convention
132
+ - **Length**: 1-20 characters
133
+ - **Example**: `user_name`, `max_count`
134
+ - **Error Example**: `userName`, `maxCount`, `MAX_COUNT`
135
+
136
+ ### Variable Name Rule (variable-name)
137
+
138
+ - **Level**: warn
139
+ - **Requirement**: snake_case naming convention
140
+ - **Length**: 1-20 characters
141
+ - **Example**: `user_count`, `max_retry`
142
+ - **Error Example**: `userCount`, `maxRetry`, `MAX_RETRY`
143
+
144
+ ### Constant Name Rule (constant-name)
145
+
146
+ - **Level**: error
147
+ - **Requirement**: UPPER_SNAKE_CASE naming convention
148
+ - **Length**: 1-20 characters
149
+ - **Example**: `MAX_RETRY`, `DEFAULT_TIMEOUT`
150
+ - **Error Example**: `maxRetry`, `defaultTimeout`, `DefaultTimeout`
151
+
152
+ ## Error Examples
153
+
154
+ ```javascript
155
+ // ❌ Incorrect naming examples
156
+ class user {} // Class name should use PascalCase
157
+ class user_manager {} // Class name should use PascalCase
158
+ class UserManager {} // Class name should use PascalCase
159
+
160
+ const userInstance = new User(); // Class instance name should use camelCase
161
+ const UserInstance = new User(); // Class instance name should use camelCase
162
+
163
+ function GetUser() {} // Function name should use camelCase
164
+ function get_user() {} // Function name should use camelCase
165
+
166
+ function process(userName) {} // Parameter name should use snake_case
167
+ const maxRetry = 5; // Variable name should use snake_case
168
+ const defaultTimeout = 1000; // Constant name should use UPPER_SNAKE_CASE
169
+
170
+ // ✅ Correct naming examples
171
+ class User {}
172
+ class DbConn {}
173
+
174
+ const userInstance = new User();
175
+ const dbConn = new DbConn();
176
+
177
+ function getUser() {}
178
+ function process() {}
179
+
180
+ function process(user_name) {}
181
+ const max_retry = 5;
182
+ const DEFAULT_TIMEOUT = 1000;
183
+ ```
184
+
185
+ ## Word Length Validation
186
+
187
+ The plugin validates that each word in compound names does not exceed 8 characters:
188
+
189
+ - **Valid**: `UserService` ("User"=4, "Service"=7)
190
+ - **Invalid**: `UserConfiguration` ("Configuration"=13 > 8)
191
+ - **Valid**: `getUser` ("get"=3, "User"=4)
192
+ - **Invalid**: `getConfiguration` ("Configuration"=13 > 8)
193
+
194
+ ## Prohibited Redundant Words
195
+
196
+ The plugin automatically detects and prohibits the use of the following redundant words:
197
+
198
+ **Class Name Prohibited Words**: manager, handler, processor, controller, service, provider, factory, builder, adapter, decorator, proxy, facade, mediator, observer, strategy, command, visitor, iterator, template, flyweight, memento, interpreter, model, view, route, router, component, widget, panel, dialog, window, form, field, property, entity
199
+
200
+ **Function Name Prohibited Words**: data, result, output, input, param, params, parameter, parameters, value, values, item, items, process, processor, provider, builder, adapter, decorator, proxy, facade, mediator, observer, strategy, command, visitor, iterator, template, flyweight, memento, interpreter, temp, tmp, temporary, cached, buffered, idx, counter, with
201
+
202
+ **Variable Name Prohibited Words**: object, array, map, set, collection, container, instance, data, item, items, element, elements, entry, entries, temp, tmp, temporary, cached, buffer, buffered, input, output, result, destination, index, idx, counter, length, total, sum, pointer, reference, ref, handle, handler, entity, column, property, attribute, manager, processor, controller, service, middleware, component, provider
203
+
204
+ ## Name Recommendation Feature
205
+
206
+ The plugin includes an intelligent name recommendation system that suggests shorter alternative names while preserving semantics.
207
+
208
+ ### Core Principle
209
+
210
+ The core principle is **"shorten names without changing semantics"**. The recommendation system:
211
+ - Recommends shorter words while maintaining the same meaning
212
+ - Avoids conceptual changes that would alter functionality
213
+ - Ensures recommended words are always shorter than the original
214
+ - Preserves programming-specific terminology and conceptual differences
215
+
216
+ ### Available Recommendations
217
+
218
+ The plugin provides recommendations for common programming operations:
219
+
220
+ | Original Word | Recommended | Description |
221
+ | ------------- | ----------- | ----------- |
222
+ | `calculate` | `calc` | Math operations |
223
+ | `generate` | `gen` | Data generation |
224
+ | `initialize` | `init` | Initialization operations |
225
+ | `execute` | `exec` | Command execution |
226
+ | `process` | `run` | Data processing |
227
+ | `retrieve` | `load` | Data loading |
228
+ | `persist` | `save` | Data storage |
229
+ | `compare` | `cmp` | Comparison operations |
230
+ | `duplicate` | `copy` | Data duplication |
231
+ | `transfer` | `move` | Data transfer |
232
+ | `convert` | `to` | Type conversion |
233
+ | `verify` | `check` | Verification checks |
234
+ | `construct` | `create` | Object creation |
235
+ | `handle` | `run` | Event handling |
236
+
237
+ ### Examples
238
+
239
+ ```javascript
240
+ // ❌ Original words (longer names)
241
+ function calculateTotal() {}
242
+ function generateUserData() {}
243
+ function initializeSystem() {}
244
+ function executeCommand() {}
245
+ function processData() {}
246
+
247
+ // ✅ Recommended words (shorter names)
248
+ function calcTotal() {}
249
+ function genUserData() {}
250
+ function initSystem() {}
251
+ function execCommand() {}
252
+ function runData() {}
253
+ ```
254
+
255
+ ### Error Messages with Recommendations
256
+
257
+ When the recommendation feature is enabled, ESLint will suggest alternative names:
258
+
259
+ ```bash
260
+ # ESLint output example
261
+ function calculateTotal() {}
262
+ # ^ Suggestion: Use 'calc' instead of 'calculate' for shorter naming
263
+ ```
264
+
265
+ ## Development
266
+
267
+ ### Project Structure
268
+
269
+ ```
270
+ mm_eslint/
271
+ ├── index.js # Main plugin file
272
+ ├── config.js # Configuration management
273
+ ├── detector.js # Naming detector
274
+ ├── validator.js # Validator
275
+ ├── corrector.js # Name corrector
276
+ ├── tip.js # Tip messages
277
+ ├── util.js # Utility functions
278
+ ├── handler.js # Rule handler
279
+ ├── fix.js # Auto-fix functionality
280
+ ├── package.json # npm configuration
281
+ ├── eslint.config.js # ESLint configuration example
282
+ ├── README.md # Chinese documentation
283
+ ├── README_EN.md # English documentation
284
+ ├── LICENSE # License
285
+ └── tests/ # Test files
286
+ ├── success/ # Correct examples
287
+ ├── error/ # Error examples
288
+ └── scence/ # Scenario tests
289
+ ```
290
+
291
+ ### Running Tests
292
+
293
+ ```bash
294
+ # Run unit tests
295
+ npm test
296
+
297
+ # Run ESLint checks
298
+ npm run lint
299
+ ```
300
+
301
+ ## License
302
+
303
+ ISC License
304
+
305
+ ## Contributing
306
+
307
+ Issues and Pull Requests are welcome to improve this plugin.
308
+
309
+ ## Changelog
310
+
311
+ ### v1.4.4
312
+ - Updated plugin name and rule prefix to `mm_eslint`
313
+ - Optimized module structure and file organization
314
+ - Enhanced test coverage and error handling
315
+ - Improved documentation and examples
316
+
317
+ ### v1.4.3
318
+ - Optimized module structure and file organization
319
+ - Enhanced test coverage and error handling
320
+ - Improved documentation and examples
321
+
322
+ ### v1.2.0
323
+ - Modular refactoring version, separation of responsibilities
324
+ - Enhanced configuration management
325
+ - Improved naming detection algorithm
326
+
327
+ ### v1.1.0
328
+ - Added word length validation (max 8 characters per word)
329
+ - Added parameter name and property name detection
330
+ - Enhanced configuration with complete ESLint rules
331
+
332
+ ### v1.0.0
333
+ - Initial version release
334
+ - Support for class, function, variable, constant, and private member naming conventions
335
+ - Support for length limitations and single word priority rules
336
+ - Support for redundant word prevention