@blumintinc/eslint-plugin-blumint 1.20.73 → 1.20.74

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.73',
226
+ version: '1.20.74',
227
227
  },
228
228
  parseOptions: {
229
229
  ecmaVersion: 2020,
@@ -3,6 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utils_1 = require("@typescript-eslint/utils");
4
4
  const createRule_1 = require("../utils/createRule");
5
5
  const isUpperSnakeCase = (str) => /^[A-Z][A-Z0-9_]*$/.test(str);
6
+ /**
7
+ * Converts an identifier to UPPER_SNAKE_CASE by splitting on case *boundaries*.
8
+ *
9
+ * Idempotence is a correctness requirement, not a nicety: `--fix` re-lints its
10
+ * own output up to ten times per file, and a sibling rule can rewrite the same
11
+ * identifier in between (`enforce-react-type-naming` lowercases it), so a
12
+ * converter that re-separates what it already separated compounds every pass
13
+ * and writes an ever-growing, corrupted identifier into source (Issue #1605).
14
+ * Splitting on boundaries also keeps acronym runs intact, so `HTTPServer` reads
15
+ * as `HTTP_SERVER` rather than `H_T_T_P_SERVER`.
16
+ *
17
+ * The leading underscore is dropped because `_PRIVATE_THING` fails
18
+ * `isUpperSnakeCase`, which would leave the rule demanding a rename it can
19
+ * never satisfy.
20
+ */
21
+ const toUpperSnakeCase = (name) => name
22
+ .replace(/([a-z0-9])([A-Z])/g, '$1_$2')
23
+ .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')
24
+ .toUpperCase()
25
+ .replace(/^_/, '');
6
26
  // Jest mock handles produced by an `as` cast to a `jest.Mock*` type are
7
27
  // stateful test doubles that are reassigned/mutated through
8
28
  // `.mockImplementation()`, `.mockReturnValue()`, etc. They are not immutable
@@ -328,10 +348,7 @@ exports.default = (0, createRule_1.createRule)({
328
348
  // the `mockedX` idiom is intentional. The exemption gates only this
329
349
  // rename check — the `as const` logic above is untouched.
330
350
  if (!isUpperSnakeCase(name) && !isJestMockCast(init)) {
331
- const newName = name
332
- .replace(/([A-Z])/g, '_$1')
333
- .toUpperCase()
334
- .replace(/^_/, '');
351
+ const newName = toUpperSnakeCase(name);
335
352
  const idNode = declaration.id;
336
353
  context.report({
337
354
  node: declaration,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blumintinc/eslint-plugin-blumint",
3
- "version": "1.20.73",
3
+ "version": "1.20.74",
4
4
  "description": "Custom eslint rules for use within BluMint",
5
5
  "author": {
6
6
  "name": "Brodie McGuire",
@@ -1,4 +1,18 @@
1
1
  [
2
+ {
3
+ "version": "1.20.74",
4
+ "date": "2026-08-02T06:07:00.009Z",
5
+ "rules": [
6
+ {
7
+ "name": "global-const-style",
8
+ "changeType": "fix",
9
+ "issues": [
10
+ 1605
11
+ ],
12
+ "summary": "split the rename on case boundaries so it is idempotent (closes #1605)"
13
+ }
14
+ ]
15
+ },
2
16
  {
3
17
  "version": "1.20.73",
4
18
  "date": "2026-08-02T05:14:39.301Z",