@blumintinc/eslint-plugin-blumint 1.20.186 → 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 CHANGED
@@ -223,7 +223,7 @@ function noFrontendImportsFromFunctionsPatterns(pattern) {
223
223
  module.exports = {
224
224
  meta: {
225
225
  name: '@blumintinc/eslint-plugin-blumint',
226
- version: '1.20.186',
226
+ version: '1.20.188',
227
227
  },
228
228
  parseOptions: {
229
229
  ecmaVersion: 2020,
@@ -214,16 +214,15 @@ const containsJsxInObject = (node) => {
214
214
  const containsJsxInSwitchStatement = (node) => {
215
215
  for (const switchCase of node.cases) {
216
216
  for (const statement of switchCase.consequent) {
217
- if (statement.type === utils_1.AST_NODE_TYPES.ReturnStatement &&
218
- statement.argument) {
219
- if (isJsxElement(statement.argument)) {
220
- return true;
221
- }
222
- }
223
- if (statement.type === utils_1.AST_NODE_TYPES.BlockStatement) {
224
- if (containsJsxInBlockStatement(statement)) {
225
- return true;
226
- }
217
+ // Braces on a `case` clause carry no meaning for this question, so the
218
+ // two spellings must agree. `case 1: { S }` reaches S through
219
+ // containsJsxInBlockStatement -> containsJsxInStatement; evaluating the
220
+ // identical predicate on an unbraced `case 1: S` is what makes the pair
221
+ // agree. Matching only ReturnStatement and BlockStatement here left a JSX
222
+ // return one level inside a try/catch/finally, a loop, a label or a
223
+ // nested switch invisible while its braced twin reported (#2206).
224
+ if (containsJsxInStatement(statement)) {
225
+ return true;
227
226
  }
228
227
  }
229
228
  }
@@ -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
- const srcIndex = parts.indexOf('src');
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blumintinc/eslint-plugin-blumint",
3
- "version": "1.20.186",
3
+ "version": "1.20.188",
4
4
  "description": "Custom eslint rules for use within BluMint",
5
5
  "author": {
6
6
  "name": "Brodie McGuire",
@@ -1,4 +1,32 @@
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
+ },
16
+ {
17
+ "version": "1.20.187",
18
+ "date": "2026-08-28T10:18:26.589Z",
19
+ "rules": [
20
+ {
21
+ "name": "react-usememo-should-be-component",
22
+ "changeType": "fix",
23
+ "issues": [
24
+ 2206
25
+ ],
26
+ "summary": "read an unbraced case consequent through the same predicate as a braced one (closes #2206)"
27
+ }
28
+ ]
29
+ },
2
30
  {
3
31
  "version": "1.20.186",
4
32
  "date": "2026-08-28T09:27:29.922Z",