@blumintinc/eslint-plugin-blumint 1.20.40 → 1.20.41
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/lib/index.js +1 -1
- package/lib/rules/no-async-foreach.d.ts +1 -1
- package/lib/rules/no-async-foreach.js +4 -2
- package/lib/rules/no-useless-fragment.d.ts +1 -2
- package/lib/rules/no-useless-fragment.js +4 -2
- package/lib/rules/prefer-fragment-shorthand.d.ts +1 -3
- package/lib/rules/prefer-fragment-shorthand.js +4 -2
- package/lib/rules/require-memo.d.ts +1 -1
- package/lib/rules/require-memo.js +4 -2
- package/lib/utils/createRule.js +4 -1
- package/package.json +1 -1
- package/release-manifest.json +38 -0
package/lib/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
-
export declare const noAsyncForEach: TSESLint.RuleModule<
|
|
2
|
+
export declare const noAsyncForEach: TSESLint.RuleModule<"noAsyncForEach", [], TSESLint.RuleListener>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.noAsyncForEach = void 0;
|
|
4
4
|
const utils_1 = require("@typescript-eslint/utils");
|
|
5
|
+
const createRule_1 = require("../utils/createRule");
|
|
5
6
|
const getNodeStart = (node) => node?.range?.[0] ?? Number.POSITIVE_INFINITY;
|
|
6
7
|
const getFunctionDescription = (node, fallbackName) => {
|
|
7
8
|
const declaredName = (node.type === utils_1.AST_NODE_TYPES.FunctionDeclaration ||
|
|
@@ -200,7 +201,8 @@ const analyzeCallbackAsyncStatus = (callback, scope) => {
|
|
|
200
201
|
const lastWrite = relevantWrites.reduce((latest, current) => !latest || current.start > latest.start ? current : latest, null);
|
|
201
202
|
return lastWrite && lastWrite.isAsync ? lastWrite.info : null;
|
|
202
203
|
};
|
|
203
|
-
exports.noAsyncForEach = {
|
|
204
|
+
exports.noAsyncForEach = (0, createRule_1.createRule)({
|
|
205
|
+
name: 'no-async-foreach',
|
|
204
206
|
create(context) {
|
|
205
207
|
const sourceCode = getSourceCode(context);
|
|
206
208
|
return {
|
|
@@ -236,5 +238,5 @@ exports.noAsyncForEach = {
|
|
|
236
238
|
schema: [],
|
|
237
239
|
},
|
|
238
240
|
defaultOptions: [],
|
|
239
|
-
};
|
|
241
|
+
});
|
|
240
242
|
//# sourceMappingURL=no-async-foreach.js.map
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const noUselessFragment: TSESLint.RuleModule<'noUselessFragment', []>;
|
|
1
|
+
export declare const noUselessFragment: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"noUselessFragment", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.noUselessFragment = void 0;
|
|
4
|
+
const createRule_1 = require("../utils/createRule");
|
|
4
5
|
/**
|
|
5
6
|
* Normalizes JSX child node types into short descriptors used inside lint messages.
|
|
6
7
|
* Keeps message phrasing consistent regardless of the specific child node shape.
|
|
@@ -21,7 +22,8 @@ const describeChild = (child) => {
|
|
|
21
22
|
return 'child node';
|
|
22
23
|
}
|
|
23
24
|
};
|
|
24
|
-
exports.noUselessFragment = {
|
|
25
|
+
exports.noUselessFragment = (0, createRule_1.createRule)({
|
|
26
|
+
name: 'no-useless-fragment',
|
|
25
27
|
create(context) {
|
|
26
28
|
return {
|
|
27
29
|
JSXFragment(node) {
|
|
@@ -78,5 +80,5 @@ exports.noUselessFragment = {
|
|
|
78
80
|
fixable: 'code',
|
|
79
81
|
},
|
|
80
82
|
defaultOptions: [],
|
|
81
|
-
};
|
|
83
|
+
});
|
|
82
84
|
//# sourceMappingURL=no-useless-fragment.js.map
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const preferFragmentShorthand: TSESLint.RuleModule<'preferShorthand', [
|
|
3
|
-
]>;
|
|
1
|
+
export declare const preferFragmentShorthand: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"preferShorthand", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.preferFragmentShorthand = void 0;
|
|
4
|
-
|
|
4
|
+
const createRule_1 = require("../utils/createRule");
|
|
5
|
+
exports.preferFragmentShorthand = (0, createRule_1.createRule)({
|
|
6
|
+
name: 'prefer-fragment-shorthand',
|
|
5
7
|
create(context) {
|
|
6
8
|
return {
|
|
7
9
|
JSXElement(node) {
|
|
@@ -38,5 +40,5 @@ exports.preferFragmentShorthand = {
|
|
|
38
40
|
fixable: 'code',
|
|
39
41
|
},
|
|
40
42
|
defaultOptions: [],
|
|
41
|
-
};
|
|
43
|
+
});
|
|
42
44
|
//# sourceMappingURL=prefer-fragment-shorthand.js.map
|
|
@@ -3,4 +3,4 @@ export type NodeWithParent = TSESTree.Node & {
|
|
|
3
3
|
parent: NodeWithParent;
|
|
4
4
|
};
|
|
5
5
|
export type ComponentNode = TSESTree.ArrowFunctionExpression | TSESTree.FunctionExpression | TSESTree.FunctionDeclaration;
|
|
6
|
-
export declare const requireMemo: TSESLint.RuleModule<
|
|
6
|
+
export declare const requireMemo: TSESLint.RuleModule<"requireMemo", [], TSESLint.RuleListener>;
|
|
@@ -5,6 +5,7 @@ exports.requireMemo = void 0;
|
|
|
5
5
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
6
6
|
const utils_1 = require("@typescript-eslint/utils");
|
|
7
7
|
const ASTHelpers_1 = require("../utils/ASTHelpers");
|
|
8
|
+
const createRule_1 = require("../utils/createRule");
|
|
8
9
|
const isComponentExplicitlyUnmemoized = (componentName) => componentName.toLowerCase().includes('unmemoized');
|
|
9
10
|
// React's universal convention: only PascalCase-initial identifiers are
|
|
10
11
|
// treated as components. camelCase names are render-prop callbacks or plain
|
|
@@ -238,7 +239,8 @@ function calculateImportPath(currentFilePath) {
|
|
|
238
239
|
const depth = parts.length - (srcIndex + 1) - 1;
|
|
239
240
|
return depth > 0 ? '../'.repeat(depth) + 'util/memo' : './util/memo';
|
|
240
241
|
}
|
|
241
|
-
exports.requireMemo = {
|
|
242
|
+
exports.requireMemo = (0, createRule_1.createRule)({
|
|
243
|
+
name: 'require-memo',
|
|
242
244
|
create: (context) => ({
|
|
243
245
|
ArrowFunctionExpression(node) {
|
|
244
246
|
checkFunction(context, node);
|
|
@@ -265,5 +267,5 @@ exports.requireMemo = {
|
|
|
265
267
|
fixable: 'code',
|
|
266
268
|
},
|
|
267
269
|
defaultOptions: [],
|
|
268
|
-
};
|
|
270
|
+
});
|
|
269
271
|
//# sourceMappingURL=require-memo.js.map
|
package/lib/utils/createRule.js
CHANGED
|
@@ -2,5 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createRule = void 0;
|
|
4
4
|
const utils_1 = require("@typescript-eslint/utils");
|
|
5
|
-
|
|
5
|
+
// A repo-relative path needs GitHub's `/blob/<branch>/` segment to resolve;
|
|
6
|
+
// without it every rule's `meta.docs.url` 404s, breaking the doc link the IDE
|
|
7
|
+
// renders on hover. Pinned to `main` because that is the released branch.
|
|
8
|
+
exports.createRule = utils_1.ESLintUtils.RuleCreator((name) => `https://github.com/BluMintInc/eslint-custom-rules/blob/main/docs/rules/${name}.md`);
|
|
6
9
|
//# sourceMappingURL=createRule.js.map
|
package/package.json
CHANGED
package/release-manifest.json
CHANGED
|
@@ -1,4 +1,42 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "1.20.41",
|
|
4
|
+
"date": "2026-07-31T01:39:15.741Z",
|
|
5
|
+
"rules": [
|
|
6
|
+
{
|
|
7
|
+
"name": "no-async-foreach",
|
|
8
|
+
"changeType": "fix",
|
|
9
|
+
"issues": [
|
|
10
|
+
1480
|
|
11
|
+
],
|
|
12
|
+
"summary": "build via createRule so it ships a docs URL (closes #1480)"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "no-useless-fragment",
|
|
16
|
+
"changeType": "fix",
|
|
17
|
+
"issues": [
|
|
18
|
+
1481
|
|
19
|
+
],
|
|
20
|
+
"summary": "build via createRule so it ships a docs URL (closes #1481)"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "prefer-fragment-shorthand",
|
|
24
|
+
"changeType": "fix",
|
|
25
|
+
"issues": [
|
|
26
|
+
1482
|
|
27
|
+
],
|
|
28
|
+
"summary": "build via createRule so it ships a docs URL (closes #1482)"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "require-memo",
|
|
32
|
+
"changeType": "fix",
|
|
33
|
+
"issues": [
|
|
34
|
+
1483
|
|
35
|
+
],
|
|
36
|
+
"summary": "build via createRule so it ships a docs URL (closes #1483)"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
},
|
|
2
40
|
{
|
|
3
41
|
"version": "1.20.40",
|
|
4
42
|
"date": "2026-07-30T23:29:30.176Z",
|