Registry / testing / eslint-plugin-pinia

eslint-plugin-pinia

JSON →
library0.4.2jsnpmunverified

An ESLint plugin that enforces best practices for writing Pinia stores in Vue.js applications. Current stable version is 0.4.2, released in November 2025, with a focus on store structure and common pitfalls. It provides a recommended configuration that includes rules like never-export-initialized-store, no-duplicate-store-ids, no-return-global-properties, and no-store-to-refs-in-store, plus optional rules like prefer-single-store-per-file. Ships TypeScript types, requires ESLint >=8.0.0 and @typescript-eslint/utils >=7.5, and supports both legacy ESLint config and flat config.

testing
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ESM only; package has no default export in CJS. Use import for both flat and legacy configs.

import pinia from 'eslint-plugin-pinia'

In flat config, use 'recommended-flat' not 'recommended'. The 'recommended' key is for legacy .eslintrc.

pinia.configs["recommended-flat"]

In flat config, use 'all-flat'. The 'all' key is for legacy .eslintrc.

pinia.configs["all-flat"]

Shows how to import and configure the plugin in ESLint flat config, including rules and recommended preset.

import pinia from 'eslint-plugin-pinia'; export default [ { plugins: { pinia }, rules: { "pinia/no-duplicate-store-ids": "error", "pinia/no-store-to-refs-in-store": "error" } } ]; // Also use the recommended flat config: export default [ pinia.configs["recommended-flat"] ];
Debug
Known footguns
gotchaFlat config users must use 'recommended-flat' or 'all-flat' config keys, not 'recommended' or 'all'.
deprecatedLegacy .eslintrc format (like 'extends': ['plugin:pinia/recommended']) is deprecated but still supported.
gotchaThe rule 'prefer-single-store-per-file' is disabled by default, but users may expect it to be active.
breakingRequires ESLint >= 8.0.0 and Node >= 18. Older ESLint versions are not supported.
gotchaUsing storeToRefs inside a store definition is flagged by rule no-store-to-refs-in-store, which is in the recommended set.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
10 hits · last 30 days
gptbot
4
ahrefsbot
4
script
1
Resources