@blumintinc/eslint-plugin-blumint

中文文档
1.23.0发布于 2026/09/30ISCTypeScriptCommonJS构建来源已验证近 30 天下载 1867

Custom eslint rules for use within BluMint

此软件包已被标记为弃用

No longer published. These rules moved into BluMint's internal monorepo; existing versions keep working.

原始使用文档
文档目录4 节
  1. Installation
  2. Usage
  3. Autonomous maintenance
  4. Rules

@blumintinc/eslint-plugin-blumint

Custom eslint rules for use at BluMint

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install @blumintinc/eslint-plugin-blumint:

npm install @blumintinc/eslint-plugin-blumint --save-dev

Usage

Add @blumintinc/blumint to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "@blumintinc/blumint"
    ]
}

Then configure the rules you want to use under the rules section.

{
    "rules": {
        "blumint/rule-name": "error"
    }
}

Or use the recommended config:

{
    "extends": ["some-other-plugin", "plugin:@blumintinc/blumint/recommended"]
}

Autonomous maintenance

This repo is maintained by an autonomous loop, not a human cutting releases on demand. See .claude/skills/repo-maintenance/SKILL.md for the operating model. Two contracts make it safe and self-healing:

  • The maintainer (/maintainer, backed by scripts/maintainer.ts) is the sole operator: it drains the open-issue queue (bugs before features, oldest first), self-merges fixes to develop, and on an empty queue promotes develop → main (firing the release) then fast-forwards develop.
  • release-manifest.json is a strict, published version → fixed-rules map (scripts/generate-release-manifest.js, a @semantic-release/exec prepareCmd) so consumers re-enable disabled rules by exact rule name — never by parsing the changelog. It's only reliable because every fix/feat commit's scope must be a real rule name: enforced by the blumint-rule-scope commitlint rule and the validate-commit-scopes CI gate. One rule per fix/feat commit.

On publish, scripts/dispatch-agora-release.js fires a repository_dispatch to agora, which bumps its pin and re-enables the now-fixed rules (FP-audited). The full closed loop is documented in agora's .claude/skills/eslint-autonomy/SKILL.md.

Rules

💼 Configurations enabled in.
🚫 Configurations disabled in.
✅ Set in the recommended configuration.
🔧 Automatically fixable by the --fix CLI option.
💡 Manually fixable by editor suggestions.
💭 Requires type information.

Name                                         Description💼🚫🔧💡💭
array-methods-this-contextPrevent misuse of Array methods in OOP✅
avoid-utils-directoryEnforce using util/ instead of utils/ directory✅
class-methods-read-top-to-bottomEnforces a top-to-bottom class layout so callers lead into the helpers they rely on.✅🔧
consistent-callback-namingEnforce consistent naming conventions for callback props and functions✅🔧
dynamic-https-errorsKeep HttpsError messages static and move request-specific details to the third argument so error identifiers remain stable and debugging context is preserved.✅
enforce-assert-safe-object-keyEnforce the use of assertSafe(id) when accessing object properties with computed keys that involve string interpolation or explicit string conversion.✅🔧
enforce-assert-throwsEnforce that functions with an assert prefix must throw an error or call process.exit(1), and functions that call assert-prefixed methods should themselves be assert-prefixed✅
enforce-boolean-naming-prefixesEnforce consistent naming conventions for boolean values by requiring approved prefixes✅
enforce-callable-typesEnforce Props and Response type exports in callable functions✅
enforce-callback-memoEnforce useCallback for inline functions and useMemo for objects/arrays containing functions in JSX props to prevent unnecessary re-renders. This improves React component performance by ensuring stable function references across renders and memoizing complex objects.✅
enforce-centralized-mock-firestoreEnforce usage of centralized mockFirestore from predefined location✅🔧
enforce-cloud-function-id-lengthEnsures .f.ts file paths generate Firebase Cloud Function IDs within the 62-character limit✅
enforce-console-errorEnforce proper logging for useAlertDialog based on severity. When severity is "error", console.error must be included. When severity is "warning", console.warn must be included. This ensures all user-facing errors and warnings are properly logged to observability systems.✅
enforce-css-media-queriesEnforce CSS media queries over JS breakpoints✅
enforce-date-ttimeEnforce that any generic type parameter named TTime is explicitly set to Date in frontend code✅🔧
enforce-dynamic-file-namingEnforce .dynamic.ts(x) file naming when @blumintinc/blumint/enforce-dynamic-imports or @blumintinc/blumint/require-dynamic-firebase-imports rule is disabled
enforce-dynamic-firebase-importsRequire firebaseCloud modules to be loaded via dynamic import so Firebase code stays out of the initial bundle and only loads when needed.✅🔧💡
enforce-dynamic-importsEnforce dynamic imports for external libraries by default to optimize bundle size, unless explicitly ignored✅
enforce-early-destructuringHoist object destructuring out of React hooks so dependency arrays track the fields in use instead of the entire object.✅🔧
enforce-empty-object-checkEnsure object existence checks also guard against empty objects so that empty payloads are treated like missing data.✅🔧
enforce-exported-function-typesEnforce exporting types for function props and return values✅🔧
enforce-f-extension-for-entry-pointsEnforce .f.ts extension for entry points✅
enforce-fieldpath-syntax-in-docsetterEnforce the use of Firestore FieldPath syntax when passing documentData into DocSetter. Instead of using nested object syntax, developers should use dot notation for deeply nested fields.✅🔧
enforce-firestore-doc-ref-genericEnforce generic argument for Firestore DocumentReference, CollectionReference and CollectionGroup✅
enforce-firestore-facadeEnforce usage of Firestore facades instead of direct Firestore methods✅
enforce-firestore-path-utilsEnforce usage of utility functions for Firestore paths to ensure type safety, maintainability, and consistent path construction. This prevents errors from manual string concatenation and makes path changes easier to manage.✅
enforce-firestore-rules-get-accessEnsure Firestore security rules use .get() with a default value instead of direct field access comparisons (e.g., resource.data.fieldX.fieldY != null).✅🔧
enforce-firestore-set-mergeEnforce using set() with { merge: true } instead of update() for Firestore operations to ensure consistent behavior. The update() method fails if the document does not exist, while set() with { merge: true } creates the document if needed and safely merges fields, making it more reliable and predictable.✅🔧
enforce-global-constantsEnforce global static constants for React components/hooks✅🔧
enforce-id-capitalizationEnforce the use of "ID" instead of "id" in user-facing text✅🔧
enforce-identifiable-firestore-typeEnforce that Firestore type definitions extend Identifiable and match their folder name✅
enforce-is-prefix-validatorsEnforce the is (or other allowed predicate) prefix for exported validators in /validators//*.ts files✅
enforce-m3-sentence-caseEnforce Material Design 3 sentence-case capitalisation for user-facing text — flag Title Case and ALL CAPS strings in JSX text and configured string props.✅💡
enforce-memoize-asyncEnforce @Memoize() decorator on async methods with 0-1 parameters to cache results and prevent redundant API calls or expensive computations. Without memoization, repeated calls trigger redundant requests or expensive computations, increasing latency. @Memoize() caches results by parameter, ensuring subsequent calls with identical inputs return immediately.✅🔧
enforce-memoize-gettersEnforce @Memoize() decorator on private class getters to avoid re-instantiation and preserve state across accesses.✅🔧
enforce-microdiffEnforce using microdiff for object and array comparison operations✅🔧
enforce-mock-firestoreEnforce using the standardized mockFirestore utility instead of manual Firestore mocking or third-party mocks. This ensures consistent test behavior across the codebase, reduces boilerplate, and provides type-safe mocking of Firestore operations.✅
enforce-mui-rounded-iconsEnforce the use of -Rounded variant for MUI icons✅🔧
enforce-object-literal-as-constEnforce that object literals returned from functions should be marked with as const to ensure type safety and immutability.✅🔧
enforce-positive-namingEnforce positive naming for boolean variables and avoid negations✅
enforce-props-argument-nameAuthoritative rule: parameters with types ending in "Props" should be named "props" (or prefixed variants when multiple Props params exist)✅🔧
enforce-props-naming-consistencyPrefer naming single "Props"-typed parameters as "props"; enforcement defers to enforce-props-argument-name for multi-Props cases✅🔧
enforce-querykey-tsEnforce using centralized router state key constants from queryKeys.ts for useRouterState key parameter✅🔧
enforce-react-type-namingEnforce naming conventions for React types✅🔧
enforce-realtimedb-path-utilsEnforce usage of utility functions for Realtime Database paths✅
enforce-render-hits-memoizationEnforce proper memoization and usage of useRenderHits and renderHits✅
enforce-safe-stringifyEnforce using safe-stable-stringify instead of JSON.stringify to handle circular references and ensure deterministic output. JSON.stringify can throw errors on circular references and produce inconsistent output for objects with the same properties in different orders. safe-stable-stringify handles these cases safely.✅💡
enforce-serializable-paramsEnforce serializable parameters for Firebase callable/HTTPS functions.✅
enforce-single-exported-unit-per-fileEnforce that a .tsx/.jsx file exports at most one React component and any file exports at most one class✅
enforce-singular-type-namesEnforce TypeScript type names to be singular✅
enforce-snapshot-state-narrowingEnforce correct narrowing of FirestoreSnapshotState variables. Falsy/truthy checks are semantic bugs because all string states are truthy; raw typeof narrowing to data bypasses the isSnapshotReady abstraction.✅💡
enforce-stable-hash-spread-propsRequire stableHash wrapping when spread props rest objects are used in React hook dependency arrays to avoid re-renders triggered by new object references on every render.✅🔧
enforce-storage-contextRequire storage access to go through the LocalStorage and SessionStorage context providers instead of direct browser APIs✅
enforce-timestamp-nowEnforce the use of Timestamp.now() for getting the current timestamp in backend code. This rule prevents using alternatives like Timestamp.fromDate(new Date()) or other date creation patterns that could lead to inconsistency.✅🔧
enforce-transform-memoizationEnforce memoization of transformValue and transformOnChange in adaptValue✅
enforce-types-directory-placementEnforce that type-only files (containing only type/interface/enum declarations) live under the canonical types directory✅
enforce-typescript-markdown-code-blocksEnsure Markdown fenced code blocks without a language specifier default to typescript for consistent highlighting.✅🔧
enforce-unique-cursor-headersEnsure files have exactly one cursor header containing required tags (e.g., @fileoverview) before any code✅🔧
enforce-use-flex-gap-on-wrapRequire useFlexGap on a MUI Stack that wraps and passes spacing, because margin-based spacing leaves the wrapped line with no row gap and a phantom leading indent✅🔧
enforce-verb-noun-namingEnforce verb phrases for functions and methods✅
ensure-pointer-events-noneEnsure pointer-events: none is added to non-interactive pseudo-elements✅🔧
export-if-in-doubtAll top-level variable declarations, type definitions, and functions should be exported✅
extract-global-constantsExtract static constants and functions to the global scope when possible, and enforce type narrowing with as const for numeric literals in loops✅
fast-deep-equal-over-microdiffEnforce using fast-deep-equal for equality checks instead of microdiff✅🔧
firestore-transaction-reads-before-writesEnforce that all Firestore transaction read operations are performed before any write operations✅
flatten-push-callsConsolidate consecutive push calls on the same array into a single push with multiple arguments.✅🔧
generic-starts-with-tEnforce TypeScript generic type parameters to start with T so they stand out from runtime values.✅
global-const-styleEnforce UPPER_SNAKE_CASE and as const for global static constants✅🔧
jsdoc-above-fieldRequire JSDoc blocks to sit above fields instead of trailing inline so IDE hovers surface the documentation.✅🔧
key-only-outermost-elementEnforce that only the outermost element in list rendering has a key prop✅🔧
logical-top-to-bottom-groupingEnforce logical top-to-bottom grouping of related statements✅🔧
memo-compare-deeply-complex-propsSuggest compareDeeply for memoized components that receive object/array props to avoid shallow comparison re-renders.✅🔧💭
memo-nested-react-componentsDisallow React components defined in render bodies, hooks, or passed as props✅
memoize-root-level-hocsPrevent creating Higher-Order Components at the root level of React components/hooks without wrapping them in useMemo to keep wrapped component identities stable across renders.✅
no-always-true-false-conditionsDetect conditions that are always truthy or always falsy✅
no-array-length-in-depsDetects array.length entries in React hook dependency arrays because length ignores content changes; auto-fixes by memoizing stableHash(array) with useMemo and depending on the hash instead.✅🔧
no-async-array-filterDisallow async callbacks in Array.filter(). Async predicates return Promises that are always truthy to the filter, so no element is ever removed. Resolve async checks first (Promise.all + map) or use a synchronous predicate to decide which items to keep.✅
no-async-foreachDisallow async callbacks to Array.forEach✅
no-circular-referencesDisallow circular references in objects✅
no-class-instance-destructuringDisallow destructuring of class instances to prevent loss of this context✅🔧
no-complex-cloud-paramsDisallow passing complex objects to cloud functions✅
no-compositing-layer-propsDiscourage CSS properties that force GPU compositing layers (e.g., transform, filter, will-change). Extra layers consume GPU memory and split rendering work, which slows scrolling and animation when sprinkled across a page. The rule inspects inline style objects and MUI sx props so layer promotion stays intentional rather than incidental.✅
no-conditional-literals-in-jsxDisallow conditional string literals beside other JSX text to avoid fragmented text nodes, translation issues, and hydration mismatches.✅
no-console-errorDisallow console.error so errors flow through structured handling (HttpsError/useErrorAlert on frontend, structured loggers on backend).✅
no-curly-brackets-around-commented-propertiesDisallow curly-brace blocks that only wrap commented-out members inside type declarations✅🔧
no-direct-function-statePrevent passing a function directly to a useState setter — React will invoke it as a functional updater instead of storing it. Wrap in a thunk: setState(() => fn).✅🔧
no-empty-dependency-use-callbacksDiscourage useCallback([]) or useLatestCallback around static functions. Static callbacks do not need hook machinery—extract them to module-level utilities for clarity and to avoid unnecessary hook overhead.✅🔧
no-entire-object-hook-depsAvoid using entire objects in React hook dependency arrays.✅🔧💭
no-excessive-parent-chainDiscourage excessive use of the ref.parent property chain in Firestore and RealtimeDB change handlers💡
no-explicit-return-typeDisallow explicit return type annotations on functions when TypeScript can infer them. This reduces code verbosity and maintenance burden while leveraging TypeScript's powerful type inference. Exceptions are made for type guard functions (using the is keyword), recursive functions, overloaded functions, interface methods, and abstract methods where explicit types improve clarity.✅🔧
no-fill-template-mutationDisallow mutating the return value of fillTemplate() via string concatenation, template literals, or string method calls. The filled Algolia filter must be used verbatim so matchesTemplate() can regex-match it; post-fill modification silently breaks realtime hash parity.✅
no-filter-without-returnDisallow Array.filter callbacks without an explicit return (if part of a block statement)✅
no-firestore-jest-mockPrevent importing firestore-jest-mock in test files✅🔧
no-firestore-object-arraysDisallow arrays of object types in Firestore models. Prefer Record maps keyed by id with an index field, or subcollections/arrays of IDs.✅
no-handler-suffixDisallow the generic "handler" suffix in callback names so names explain the action they perform✅
no-harness-coupled-disablesDisallow eslint-disable justifications that reference the agent development harness (worktree, cwd, stop-hook, claude) instead of the code’s own semantics.✅
no-hungarianDisallow Hungarian notation in locally declared variables, types, and classes✅
no-inline-component-propPrevent inline function components defined in render from being passed to component-type props like CatalogWrapper to avoid remounts and UI flashes.✅
no-jsx-in-hooksPrevent hooks from returning JSX✅
no-jsx-whitespace-literalDisallow the use of {" "} elements in JSX code✅
no-margin-propertiesPrevent margin properties (margin, marginLeft, marginRight, marginTop, marginBottom, mx, my, etc.) in MUI styling because margins fight container-controlled spacing, double gutters, and misaligned breakpoints; keep spacing centralized with padding, gap, or spacing props instead.✅
no-memoize-on-staticPrevent using @Memoize() decorator on static methods✅
no-misleading-boolean-prefixesReserve boolean-style prefixes (is/has/should) for functions that actually return boolean values to avoid misleading call sites.✅
no-misused-switch-casePrevent misuse of logical OR (||) in switch case statements, which can lead to confusing and error-prone code. Instead of using OR operators in case expressions, use multiple case statements in sequence to handle multiple values. This improves code readability and follows the standard switch-case pattern.✅
no-mixed-firestore-transactionsPrevent mixing transactional and non-transactional Firestore operations within a transaction✅
no-mock-firebase-adminPrevent direct mocking of firebaseAdmin; use shared test helpers instead✅
no-object-values-on-stringsDisallow Object.values() on strings as it treats strings as arrays of characters, which is likely unintended behavior.✅
no-overridable-method-calls-in-constructorDisallow calling overridable methods in constructors to prevent unexpected behavior✅
no-passthrough-gettersAvoid getter methods that only re-expose nested properties on constructor-injected objects without adding behavior✅
no-portal-inside-tooltipDisallow portal-rendering components (Dialog, Drawer, Menu, Popover, Portal, Modal) inside Tooltip wrapper components. React Portals preserve React-tree event bubbling, so a portal nested under a Tooltip leaves the tooltip orphaned over the modal.✅
no-redundant-annotation-assertionDisallow combining a type annotation with an identical type assertion on the same value. Keep a single source of truth to avoid redundant type declarations that can drift apart.✅🔧💭
no-redundant-boolean-callback-propsDisallow redundant boolean props that duplicate the semantic meaning of optional callback props, violating the Interface Segregation Principle.✅
no-redundant-param-typesDisallow redundant parameter type annotations✅🔧
no-redundant-this-paramsDisallow passing class instance members (this.foo) into class instance methods; access the member from this inside the method instead.✅
no-redundant-usecallback-wrapperPrevent wrapping already memoized/stable callbacks from hooks/contexts in an extra useCallback()✅🔧
no-render-function-componentsDisallow declaring a local render* function that returns JSX and consuming it as a plain function (direct call or array-iteration callback); author it as a real component rendered with JSX instead✅
no-res-error-status-in-onrequestForbid sending 4xx/5xx Express responses inside onRequest handlers; throw structured HttpsError instances instead so the wrapper can format, log, and map errors consistently.✅
no-restricted-properties-fixDisallow certain properties on certain objects, with special handling for Object.keys() and Object.values()
[no-satisfies-in-frontend-bund

版本与发布记录

@blumintinc/eslint-plugin-blumint 共发布 355 个版本,首次发布于 2023/05/17;过去 12 个月发布了 284 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.23.0latest2026/09/301 个月前
1.22.02026/09/271 个月前
1.21.182026/09/082 个月前
1.21.172026/09/072 个月前
1.21.162026/09/072 个月前
1.21.152026/09/072 个月前

关于 @blumintinc/eslint-plugin-blumint 的常见问题

@blumintinc/eslint-plugin-blumint 是什么?

Custom eslint rules for use within BluMint注意:该包已被作者标记为弃用——No longer published. These rules moved into BluMint's internal monorepo; existing versions keep working.

如何安装 @blumintinc/eslint-plugin-blumint?

在项目目录运行 npm install @blumintinc/eslint-plugin-blumint,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:eslint(>=7 <9)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@blumintinc/eslint-plugin-blumint 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@blumintinc/eslint-plugin-blumint 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@blumintinc/eslint-plugin-blumint 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@blumintinc/eslint-plugin-blumint 可以商用吗?

@blumintinc/eslint-plugin-blumint 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@blumintinc/eslint-plugin-blumint 的下载量有多少?

根据 npm 官方下载统计,@blumintinc/eslint-plugin-blumint 在 2026/10/09 – 2026/11/07 这 30 天内被下载 1,867 次,日均约 62 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@blumintinc/eslint-plugin-blumint 还在维护吗?

最新版本 1.23.0 发布于 2026/09/30(1 个月前);至今共发布 355 个版本,其中过去 12 个月发布了 284 个;首次发布于 2023/05/17。作者已将其标记为弃用,新项目建议寻找替代方案。