@blumintinc/eslint-plugin-blumint 1.20.187 → 1.20.188
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/require-memo.js +12 -1
- package/package.json +1 -1
- package/release-manifest.json +14 -0
package/lib/index.js
CHANGED
|
@@ -838,7 +838,18 @@ function calculateImportPath(currentFilePath) {
|
|
|
838
838
|
return 'src/util/memo';
|
|
839
839
|
// Split the current file path into parts and normalize
|
|
840
840
|
const parts = currentFilePath.split(/[\\/]/); // Handle both Unix and Windows paths
|
|
841
|
-
|
|
841
|
+
/**
|
|
842
|
+
* The source root is the `src` NEAREST the file, not the first one in the
|
|
843
|
+
* path. `context.getFilename()` is always absolute under every real ESLint
|
|
844
|
+
* entry point, so the absolute prefix is part of the path being searched: a
|
|
845
|
+
* checkout under a directory named `src` (`~/src/proj/src/components/Foo.tsx`)
|
|
846
|
+
* would otherwise anchor on that outer segment and emit a specifier that walks
|
|
847
|
+
* out of the project entirely.
|
|
848
|
+
*
|
|
849
|
+
* Directory segments only — a file that is itself named `src` names no
|
|
850
|
+
* directory the import could be relative to.
|
|
851
|
+
*/
|
|
852
|
+
const srcIndex = parts.slice(0, -1).lastIndexOf('src');
|
|
842
853
|
if (srcIndex === -1) {
|
|
843
854
|
// If we're not in a src directory, use absolute path
|
|
844
855
|
return 'src/util/memo';
|
package/package.json
CHANGED
package/release-manifest.json
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "1.20.188",
|
|
4
|
+
"date": "2026-08-29T07:11:55.294Z",
|
|
5
|
+
"rules": [
|
|
6
|
+
{
|
|
7
|
+
"name": "require-memo",
|
|
8
|
+
"changeType": "fix",
|
|
9
|
+
"issues": [
|
|
10
|
+
2207
|
|
11
|
+
],
|
|
12
|
+
"summary": "anchor the memo import on the nearest src, not the first (closes #2207)"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
},
|
|
2
16
|
{
|
|
3
17
|
"version": "1.20.187",
|
|
4
18
|
"date": "2026-08-28T10:18:26.589Z",
|