@agilebot/eslint-plugin 0.8.1 → 0.8.3
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 +4 -3
- package/dist/index.mjs +2644 -0
- package/package.json +12 -4
package/dist/index.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license @agilebot/eslint-plugin v0.8.
|
2
|
+
* @license @agilebot/eslint-plugin v0.8.3
|
3
3
|
*
|
4
4
|
* Copyright (c) Agilebot, Inc. and its affiliates.
|
5
5
|
*
|
@@ -12,6 +12,7 @@ var utils = require('@typescript-eslint/utils');
|
|
12
12
|
var fs = require('node:fs');
|
13
13
|
var path = require('node:path');
|
14
14
|
var eslintUtils = require('@agilebot/eslint-utils');
|
15
|
+
var Components = require('eslint-plugin-react/lib/util/Components.js');
|
15
16
|
|
16
17
|
function _interopNamespaceDefault(e) {
|
17
18
|
var n = Object.create(null);
|
@@ -32,6 +33,7 @@ function _interopNamespaceDefault(e) {
|
|
32
33
|
|
33
34
|
var fs__namespace = /*#__PURE__*/_interopNamespaceDefault(fs);
|
34
35
|
var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
|
36
|
+
var Components__namespace = /*#__PURE__*/_interopNamespaceDefault(Components);
|
35
37
|
|
36
38
|
const docBaseUrl = 'https://github.com/sh-agilebot/frontend-toolkit/blob/master/packages/eslint-plugin/src/rules/';
|
37
39
|
const hasDocs = typeof ["enforce-mui-icon-alias","intl-id-missing","intl-id-prefix","intl-no-default","react-better-exhaustive-deps"] !== 'undefined' ?
|
@@ -2054,7 +2056,6 @@ function isUseEffectEventIdentifier(node) {
|
|
2054
2056
|
return false;
|
2055
2057
|
}
|
2056
2058
|
|
2057
|
-
const Components = require('eslint-plugin-react/lib/util/Components');
|
2058
2059
|
const RULE_NAME$5 = 'react-hook-use-ref';
|
2059
2060
|
var reactHookUseRef = createRule({
|
2060
2061
|
name: RULE_NAME$5,
|
@@ -2071,7 +2072,7 @@ var reactHookUseRef = createRule({
|
|
2071
2072
|
}
|
2072
2073
|
},
|
2073
2074
|
defaultOptions: [],
|
2074
|
-
create:
|
2075
|
+
create: Components__namespace["default"].detect((context, component, util) => ({
|
2075
2076
|
CallExpression(node) {
|
2076
2077
|
const isImmediateReturn = node.parent && node.parent.type === utils.AST_NODE_TYPES.ReturnStatement;
|
2077
2078
|
if (isImmediateReturn || !util.isReactHookCall(node, ['useRef'])) {
|