@agilebot/eslint-plugin 0.5.6 → 0.6.1

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/dist/index.js +12 -9
  2. package/package.json +5 -6
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @agilebot/eslint-plugin v0.5.6
2
+ * @license @agilebot/eslint-plugin v0.6.1
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"] : [];
@@ -1022,7 +1018,7 @@ var reactBetterExhaustiveDeps = {
1022
1018
  } else if (Array.isArray(staticParts)) {
1023
1019
  if (id.type === 'ArrayPattern' && id.elements.length <= staticParts.length && Array.isArray(resolved.identifiers)) {
1024
1020
  const idx = id.elements.indexOf(resolved.identifiers[0]);
1025
- if (idx >= 0) {
1021
+ if (idx !== -1) {
1026
1022
  return staticParts[idx];
1027
1023
  }
1028
1024
  }
@@ -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
- calleeName = node.id.parent.init.callee.name;
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
- calleeName = node.id.parent.init.expression.callee.name;
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.5.6",
3
+ "version": "0.6.1",
4
4
  "description": "Agilebot's ESLint plugin",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -18,11 +18,10 @@
18
18
  "node": "^18.18.0 || >=20.0.0"
19
19
  },
20
20
  "dependencies": {
21
- "@eslint/compat": "^1.2.1",
22
- "@typescript-eslint/utils": "~8.7.0",
23
- "eslint-plugin-deprecation": "^3.0.0",
21
+ "@eslint/compat": "^1.2.3",
22
+ "@typescript-eslint/utils": "~8.15.0",
24
23
  "eslint-plugin-react": "^7.37.2",
25
- "@agilebot/eslint-utils": "0.5.6"
24
+ "@agilebot/eslint-utils": "0.6.1"
26
25
  },
27
26
  "peerDependencies": {
28
27
  "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0"
@@ -35,7 +34,7 @@
35
34
  "@types/estree": "^1.0.5",
36
35
  "color-name": "^2.0.0",
37
36
  "eslint-vitest-rule-tester": "^0.6.1",
38
- "typescript-eslint": "~8.7.0"
37
+ "typescript-eslint": "~8.15.0"
39
38
  },
40
39
  "scripts": {
41
40
  "build": "rollup -c rollup.config.mjs",