mm_eslint 1.0.3 → 1.0.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.
Files changed (2) hide show
  1. package/index.js +3 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -126,6 +126,8 @@ class Detector {
126
126
  "UPPERCASE",
127
127
  "UPPER_SNAKE_CASE",
128
128
  "PascalCase",
129
+ "camelCase",
130
+ "_camelCase"
129
131
  ],
130
132
  strong: true, // 强验证模式:根据属性值类型智能判断;false:弱验证模式:只需符合变量名或常量名规则
131
133
  },
@@ -830,7 +832,7 @@ Detector.prototype._isConstWithName = function (
830
832
  const is_val_const = this._isValConst(val_node, prop_name);
831
833
 
832
834
  if (is_inst_data_name && is_prim_const) {
833
- return is_val_const ? true : false;
835
+ return false; // 实例数据的属性名,即使值是基本类型,也不应视为常量
834
836
  }
835
837
 
836
838
  if (is_upper_name && (is_prim_const || is_cfg_obj)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_eslint",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "ESLint plugin for naming conventions - PascalCase, camelCase, snake_case, and UPPER_SNAKE_CASE naming rules",
5
5
  "main": "index.js",
6
6
  "keywords": [