@blumintinc/eslint-plugin-blumint 1.20.28 → 1.20.29

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.28',
226
+ version: '1.20.29',
227
227
  },
228
228
  parseOptions: {
229
229
  ecmaVersion: 2020,
@@ -83,6 +83,11 @@ const renameWouldCollide = (variable, newName) => {
83
83
  }
84
84
  return false;
85
85
  };
86
+ // `undefined`, `NaN` and `Infinity` parse as identifiers but denote primitive
87
+ // values rather than a binding being aliased, so they stay subject to the
88
+ // naming check exactly like the literals they stand in for. Every other bare
89
+ // identifier initializer is an alias (see `isBindingAlias`).
90
+ const PRIMITIVE_VALUE_GLOBALS = new Set(['undefined', 'NaN', 'Infinity']);
86
91
  // Next.js recognizes these export names by their literal identifier, so
87
92
  // renaming them to UPPER_SNAKE_CASE silently breaks the framework contract
88
93
  // (e.g. `export const config` controls the API-route body parser / runtime).
@@ -139,6 +144,26 @@ exports.default = (0, createRule_1.createRule)({
139
144
  }
140
145
  return false;
141
146
  };
147
+ /**
148
+ * A bare identifier initializer (`export const toUsernameSlugStamp =
149
+ * toKvStamp;`) aliases an existing binding instead of declaring a
150
+ * configuration value, so the rule's premise does not hold: the alias
151
+ * inherits whatever convention its target follows, and a callable — the
152
+ * dominant case, since aliasing a re-exported function is the idiom — is
153
+ * always camelCase. Renaming one is also destructive, because the point of
154
+ * such a re-export is preserving a name importers depend on and a
155
+ * single-file fixer cannot rewrite them (Issue #1418).
156
+ *
157
+ * The check unwraps assertions so a type-pinned alias (`x as Foo`,
158
+ * `x as const`) is treated the same as the bare form. A `MemberExpression`
159
+ * (`Foo.bar`) is deliberately not covered — it keeps whatever behavior
160
+ * `isDynamicValue` already gives it.
161
+ */
162
+ const isBindingAlias = (node) => {
163
+ const target = unwrapAssertions(node);
164
+ return (target.type === utils_1.AST_NODE_TYPES.Identifier &&
165
+ !PRIMITIVE_VALUE_GLOBALS.has(target.name));
166
+ };
142
167
  const describeValueKind = (node) => {
143
168
  const target = unwrapAssertions(node);
144
169
  if (target.type === utils_1.AST_NODE_TYPES.ArrayExpression) {
@@ -209,8 +234,9 @@ exports.default = (0, createRule_1.createRule)({
209
234
  }
210
235
  const { name } = declaration.id;
211
236
  const init = declaration.init;
212
- // Skip if no initializer or if it's a dynamic value or class instance
213
- if (!init || isDynamicValue(init)) {
237
+ // Skip if no initializer, if it's a dynamic value or class instance,
238
+ // or if it merely aliases another binding
239
+ if (!init || isDynamicValue(init) || isBindingAlias(init)) {
214
240
  return;
215
241
  }
216
242
  const sourceCode = context.sourceCode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blumintinc/eslint-plugin-blumint",
3
- "version": "1.20.28",
3
+ "version": "1.20.29",
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.29",
4
+ "date": "2026-07-30T08:31:47.570Z",
5
+ "rules": [
6
+ {
7
+ "name": "global-const-style",
8
+ "changeType": "fix",
9
+ "issues": [
10
+ 1418
11
+ ],
12
+ "summary": "exempt bare-identifier binding aliases (closes #1418)"
13
+ }
14
+ ]
15
+ },
2
16
  {
3
17
  "version": "1.20.28",
4
18
  "date": "2026-07-30T07:59:36.776Z",