@agilebot/eslint-plugin 0.5.5 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +11 -8
- package/package.json +2 -3
package/dist/index.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license @agilebot/eslint-plugin v0.
|
2
|
+
* @license @agilebot/eslint-plugin v0.6.0
|
3
3
|
*
|
4
4
|
* Copyright (c) Agilebot, Inc. and its affiliates.
|
5
5
|
*
|
@@ -8,7 +8,6 @@
|
|
8
8
|
*/
|
9
9
|
'use strict';
|
10
10
|
|
11
|
-
var compat = require('@eslint/compat');
|
12
11
|
var utils = require('@typescript-eslint/utils');
|
13
12
|
var fs = require('node:fs');
|
14
13
|
var path = require('node:path');
|
@@ -34,9 +33,6 @@ function _interopNamespaceDefault(e) {
|
|
34
33
|
var fs__namespace = /*#__PURE__*/_interopNamespaceDefault(fs);
|
35
34
|
var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
|
36
35
|
|
37
|
-
const rule = require('eslint-plugin-deprecation/dist/rules/deprecation')["default"];
|
38
|
-
const compatRule = compat.fixupRule(rule);
|
39
|
-
|
40
36
|
const docBaseUrl = 'https://github.com/sh-agilebot/frontend-toolkit/blob/master/packages/eslint-plugin/src/rules/';
|
41
37
|
const hasDocs = typeof ["enforce-mui-icon-alias","intl-id-missing","intl-id-prefix","intl-no-default","react-better-exhaustive-deps"] !== 'undefined' ?
|
42
38
|
["enforce-mui-icon-alias","intl-id-missing","intl-id-prefix","intl-no-default","react-better-exhaustive-deps"] : [];
|
@@ -2896,10 +2892,18 @@ var varNaming = createRule({
|
|
2896
2892
|
let shouldCheckReact = false;
|
2897
2893
|
if (node.id.parent.init.type === 'CallExpression') {
|
2898
2894
|
shouldCheckReact = true;
|
2899
|
-
|
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
|
+
}
|
2900
2900
|
} else if (node.id.parent.init.type === 'TSAsExpression' && node.id.parent.init.expression && node.id.parent.init.expression.callee) {
|
2901
2901
|
shouldCheckReact = true;
|
2902
|
-
|
2902
|
+
if (node.id.parent.init.expression.callee.type === 'Identifier') {
|
2903
|
+
calleeName = node.id.parent.init.expression.callee.name;
|
2904
|
+
} else if (node.id.parent.init.expression.callee.type === 'MemberExpression') {
|
2905
|
+
calleeName = node.id.parent.init.expression.callee.property.name;
|
2906
|
+
}
|
2903
2907
|
}
|
2904
2908
|
if (calleeName) {
|
2905
2909
|
for (const excludeRegex of excludeFuncs) {
|
@@ -2929,7 +2933,6 @@ var varNaming = createRule({
|
|
2929
2933
|
|
2930
2934
|
var ruleFiles = /*#__PURE__*/Object.freeze({
|
2931
2935
|
__proto__: null,
|
2932
|
-
rules_deprecation: compatRule,
|
2933
2936
|
rules_enforce_mui_icon_alias: enforceMuiIconAlias,
|
2934
2937
|
rules_import_monorepo: importMonorepo,
|
2935
2938
|
rules_intl_id_missing: intlIdMissing,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@agilebot/eslint-plugin",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.6.0",
|
4
4
|
"description": "Agilebot's ESLint plugin",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -20,9 +20,8 @@
|
|
20
20
|
"dependencies": {
|
21
21
|
"@eslint/compat": "^1.2.1",
|
22
22
|
"@typescript-eslint/utils": "~8.7.0",
|
23
|
-
"eslint-plugin-deprecation": "^3.0.0",
|
24
23
|
"eslint-plugin-react": "^7.37.2",
|
25
|
-
"@agilebot/eslint-utils": "0.
|
24
|
+
"@agilebot/eslint-utils": "0.6.0"
|
26
25
|
},
|
27
26
|
"peerDependencies": {
|
28
27
|
"eslint": "^7.0.0 || ^8.0.0 || ^9.0.0"
|