@playstack/lint
Deterministic ESLint rules for portable cores, event ownership, browser extensions, and semantic design tokens.
Free. MIT licensed. Check preview availability before installing. See package access.
@playstack/lint catches integration-boundary mistakes that can be identified statically. It complements repository conventions, type-level validation, and playstack doctor; it does not replace them.
Install and configure
The plugin supports ESLint ^9.0.0 || ^10.0.0, all six rules and the four presets from both ESM and CommonJS configs. Use a Node version supported by the ESLint major you select; the broader Playstack engine range does not override a tool's own engine requirements.
npm install --save-dev @playstack/lint eslintimport { configs } from '@playstack/lint'
export default [
configs.recommended,
{
...configs.extension,
files: ['apps/extension/src/background/**/*.{ts,tsx}'],
},
{
...configs.chakra,
files: ['packages/playstack-ui/src/**/*.{ts,tsx}'],
rules: {
...configs.chakra.rules,
'@playstack/semantic-tokens-only': ['error', { tokens: ['fg.default', 'bg.canvas', 'border.default'] }],
},
},
]extension and chakra deliberately omit files; consumers must scope them to the surfaces where those contracts apply. Use configs.all only when every source file belongs to all three domains.
Presets and rules
| Preset | Rules | Boundary |
|---|---|---|
recommended | no-process-env-in-core, no-consumer-internal-handler | Keeps portable core configuration explicit and transactional handlers package-owned. |
extension | no-worker-memory-state, no-worker-long-timer, no-remote-code | Enforces disposable MV3 worker state and bundled executable code. |
chakra | semantic-tokens-only | Restricts selected style properties to an explicit semantic-token vocabulary. |
all | All six rules | Combines the presets without assigning file scopes. |
no-worker-long-timer reports dynamic delays and literal delays over 10 seconds by default. Configure maxDelayMs only when the extension has a documented lifecycle reason; longer work should use persisted intent and the alarms API.
semantic-tokens-only accepts tokens and properties allowlists. This lets an application own its theme vocabulary rather than inheriting hardcoded visual values from Playstack.
CLI composition
npx playstack lint init --diff
npx playstack lint initThe Playstack CLI can materialize a managed flat-config fragment from playstack.json. Direct ESLint composition remains supported when the application needs a custom file layout.
Rules expose no fixes unless a transformation can preserve semantics; the initial rule set reports only.
API entry points and requirements
Reference snapshot: @playstack/lint@0.1.0-beta.1. Import only the entry point your runtime needs. Paths below are relative to the installed package; use Go to Definition in your editor to inspect exact parameters, return types and overloads. Do not import the declaration-file paths directly.
| Public entry point | Declaration file |
|---|---|
@playstack/lint | ./dist/index.d.ts |
@playstack/lint/package.json | No TypeScript declaration (asset or metadata export). |
Node.js engine requirement: >=20. This is not a claim that every entry point works in browsers or Workers.
Peer dependencies
Keep existing framework versions that satisfy these ranges. Install optional peers only when using the corresponding adapter. The package manager resolves ordinary dependencies separately.
| Peer | Compatible range | When needed |
|---|---|---|
eslint | ^9.0.0 || ^10.0.0 | Required by the package. |
For a complete first program, start with Getting started. For API lookup and partial-example conventions, see Reading the reference. Provider failures, lifecycle requirements and application responsibilities remain described in the guide above; types alone do not establish production safety.