@agilebot/eslint-plugin 0.7.0 → 0.7.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/dist/index.js +11 -12
- package/package.json +2 -2
package/dist/index.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license @agilebot/eslint-plugin v0.7.
|
2
|
+
* @license @agilebot/eslint-plugin v0.7.2
|
3
3
|
*
|
4
4
|
* Copyright (c) Agilebot, Inc. and its affiliates.
|
5
5
|
*
|
@@ -36,7 +36,7 @@ var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
|
|
36
36
|
const docBaseUrl = 'https://github.com/sh-agilebot/frontend-toolkit/blob/master/packages/eslint-plugin/src/rules/';
|
37
37
|
const hasDocs = typeof ["enforce-mui-icon-alias","intl-id-missing","intl-id-prefix","intl-no-default","react-better-exhaustive-deps"] !== 'undefined' ?
|
38
38
|
["enforce-mui-icon-alias","intl-id-missing","intl-id-prefix","intl-no-default","react-better-exhaustive-deps"] : [];
|
39
|
-
const createRule = utils.ESLintUtils.RuleCreator(name => hasDocs.includes(name) ? "".concat(docBaseUrl).concat(name, ".md") : "".concat(docBaseUrl).concat(name, ".test.
|
39
|
+
const createRule = utils.ESLintUtils.RuleCreator(name => hasDocs.includes(name) ? "".concat(docBaseUrl).concat(name, ".md") : "".concat(docBaseUrl).concat(name, ".test.js"));
|
40
40
|
|
41
41
|
const RULE_NAME$i = 'enforce-mui-icon-alias';
|
42
42
|
var enforceMuiIconAlias = createRule({
|
@@ -2890,19 +2890,18 @@ var varNaming = createRule({
|
|
2890
2890
|
if (node.id.parent && node.id.parent.init) {
|
2891
2891
|
let calleeName;
|
2892
2892
|
let shouldCheckReact = false;
|
2893
|
+
let initNode;
|
2893
2894
|
if (node.id.parent.init.type === 'CallExpression') {
|
2894
|
-
|
2895
|
-
if (node.id.parent.init.callee.type === 'Identifier') {
|
2896
|
-
calleeName = node.id.parent.init.callee.name;
|
2897
|
-
} else if (node.id.parent.init.callee.type === 'MemberExpression') {
|
2898
|
-
calleeName = node.id.parent.init.callee.property.name;
|
2899
|
-
}
|
2895
|
+
initNode = node.id.parent.init;
|
2900
2896
|
} else if (node.id.parent.init.type === 'TSAsExpression' && node.id.parent.init.expression && node.id.parent.init.expression.callee) {
|
2897
|
+
initNode = node.id.parent.init.expression;
|
2898
|
+
}
|
2899
|
+
if (initNode) {
|
2901
2900
|
shouldCheckReact = true;
|
2902
|
-
if (
|
2903
|
-
calleeName =
|
2904
|
-
} else if (
|
2905
|
-
calleeName =
|
2901
|
+
if (initNode.callee.type === 'Identifier') {
|
2902
|
+
calleeName = initNode.callee.name;
|
2903
|
+
} else if (initNode.callee.type === 'MemberExpression') {
|
2904
|
+
calleeName = initNode.callee.property.name;
|
2906
2905
|
}
|
2907
2906
|
}
|
2908
2907
|
if (calleeName) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@agilebot/eslint-plugin",
|
3
|
-
"version": "0.7.
|
3
|
+
"version": "0.7.2",
|
4
4
|
"description": "Agilebot's ESLint plugin",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -21,7 +21,7 @@
|
|
21
21
|
"@eslint/compat": "^1.2.3",
|
22
22
|
"@typescript-eslint/utils": "~8.15.0",
|
23
23
|
"eslint-plugin-react": "^7.37.2",
|
24
|
-
"@agilebot/eslint-utils": "0.7.
|
24
|
+
"@agilebot/eslint-utils": "0.7.2"
|
25
25
|
},
|
26
26
|
"peerDependencies": {
|
27
27
|
"eslint": "^8.57.0 || ^9.0.0"
|