mm_eslint 1.3.1 → 1.3.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/detector.js +6 -0
- package/package.json +1 -1
package/detector.js
CHANGED
|
@@ -670,6 +670,12 @@ Detector.prototype._getPropType = function (val_node, prop_name, parent_node) {
|
|
|
670
670
|
val_node.name &&
|
|
671
671
|
val_node.name[0] === val_node.name[0].toUpperCase()
|
|
672
672
|
) {
|
|
673
|
+
// 检查是否是特殊全局变量(如__dirname、__filename、process等)
|
|
674
|
+
var special_globals = ['__dirname', '__filename', 'process', 'console', 'module', 'exports', 'require', 'global'];
|
|
675
|
+
if (special_globals.includes(val_node.name)) {
|
|
676
|
+
return 'value'; // 特殊全局变量应该识别为属性值
|
|
677
|
+
}
|
|
678
|
+
|
|
673
679
|
// 检查是否是类名引用(通常类名使用PascalCase)
|
|
674
680
|
return 'class'; // 属性类类型
|
|
675
681
|
}
|