crabatool 1.0.88 → 1.0.90
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/package.json +1 -1
- package/tool/checkjs.js +7 -6
package/package.json
CHANGED
package/tool/checkjs.js
CHANGED
|
@@ -272,12 +272,13 @@ async function eslintCheck(content) {
|
|
|
272
272
|
}
|
|
273
273
|
|
|
274
274
|
// 自动添加js里面namespace的全局对象,业务就不用配置了
|
|
275
|
-
var
|
|
276
|
-
if (
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
275
|
+
var strs = content.match(/Type\.registerNamespace\((.*?)\)/g);
|
|
276
|
+
if (strs && strs.length > 0) {
|
|
277
|
+
strs.forEach((str) => {
|
|
278
|
+
var names = str.substring(24, str.length - 2).split('.');
|
|
279
|
+
var namespace = names[0];
|
|
280
|
+
options.overrideConfig.globals[namespace] = 'readonly';
|
|
281
|
+
});
|
|
281
282
|
}
|
|
282
283
|
|
|
283
284
|
var lint = new eslint.ESLint(options);
|