Interpretive guidance for JavaScript/TypeScript code quality using biome (modern) or eslint+prettier (traditional). Use when linting JS/TS files, configuring JS/TS tools, troubleshooting lint errors, or understanding tool selection.
Inherits all available tools
Additional assets for this skill
This skill inherits all available tools. When active, it can use any tool Claude has access to.
biome-reference.mddefault-biome.jsondefault-eslint.config.jsdefault-prettier.jsoneslint-reference.mdprettier-reference.mdThis skill teaches how to apply JavaScript and TypeScript linting and formatting tools effectively using mr-sparkle's tool selection system. It provides guidance on what the tools do, when each tool group is used, and how our configuration balances modern unified tooling with traditional setups.
Claude knows how to use biome, eslint, and prettier. Fetch these docs only when you need:
Reference URLs:
Key principle: Prefer modern unified tooling (biome) when project has it configured; fall back to traditional tools (eslint+prettier) when they're configured; default to biome if no configuration exists.
What this means:
Decision test: Does the project have explicit tool configuration? Use configured tools. Otherwise use biome.
The linting system uses group-based priority selection for JS/TS files:
Priority 1: biome (if project has biome config)
↓
Priority 2: eslint + prettier (if project has their configs)
↓
Fallback: biome (with default config)
Detection logic:
package.json, pyproject.toml, or .git)default-biome.jsonAll tools in winning group run sequentially (e.g., if eslint config exists, runs eslint → prettier).
From official docs:
biome check --fix (linting + formatting in one pass)Configuration locations:
biome.json or biome.jsonc (dedicated config)When biome shines:
Basic configuration pattern:
{
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"semicolons": "asNeeded"
}
}
}
Key configuration areas:
linter.rules - Enable/disable rule groups (recommended, suspicious, complexity, etc.)formatter - Global formatting options (indents, line width)javascript.formatter - JS-specific formatting (quotes, semicolons)typescript - TypeScript-specific optionsSee biome-reference.md for common rule categories and default-biome.json for our opinionated defaults.
From official docs:
ESLint:
eslint --fix <file>Prettier:
prettier --write <file>Configuration locations:
ESLint (modern flat config - recommended):
eslint.config.js (or .mjs, .cjs)ESLint (legacy):
.eslintrc (or .eslintrc.js, .eslintrc.json, .eslintrc.yaml)Prettier:
.prettierrc (or .prettierrc.js, .prettierrc.json, .prettierrc.yaml)prettier.config.js (or .cjs, .mjs)When traditional tools make sense:
Running order matters:
Why this order: ESLint fixes code issues first, then Prettier formats the result.
Critical: ESLint and Prettier must be configured to work together:
eslint-config-prettier to disable conflicting ESLint formatting rules$ lint.py file.js
# Runs: biome check --fix
# Uses: default-biome.json from skill directory
# Project has biome.json
$ lint.py file.ts
# Runs: biome check --fix
# Uses: project's biome.json config
# Project has .eslintrc.json or .prettierrc
$ lint.py file.jsx
# Runs: eslint --fix, prettier --write
# Uses: project's existing configs
# Project has both biome.json and .eslintrc
$ lint.py file.ts
# Runs: biome only (first group with config wins)
Minimal (uses defaults):
{
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
"linter": {
"enabled": true
},
"formatter": {
"enabled": true
}
}
Typical project:
{
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noExplicitAny": "warn"
}
}
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"semicolons": "asNeeded"
}
}
}
See default-biome.json for our opinionated baseline configuration.
Minimal:
// eslint.config.js
export default [
{
rules: {
"no-unused-vars": "warn",
"no-console": "off"
}
}
];
With TypeScript:
// eslint.config.js
import js from "@eslint/js";
import tseslint from "typescript-eslint";
export default [
js.configs.recommended,
...tseslint.configs.recommended,
{
rules: {
"@typescript-eslint/no-explicit-any": "warn"
}
}
];
See default-eslint.config.js for a complete example with Prettier integration.
Minimal:
{
"semi": true,
"singleQuote": true,
"printWidth": 100
}
Comprehensive:
{
"semi": true,
"singleQuote": true,
"printWidth": 100,
"tabWidth": 2,
"trailingComma": "es5",
"arrowParens": "avoid"
}
See default-prettier.json for our opinionated defaults.
Problem: ESLint formatting rules conflict with Prettier.
// ❌ ESLint config with formatting rules
{
"rules": {
"max-len": ["error", { "code": 80 }],
"quotes": ["error", "single"],
"indent": ["error", 2]
}
}
Why it fails: ESLint and Prettier fight over formatting, causing inconsistent results.
Better:
// ✅ Use eslint-config-prettier to disable conflicts
import js from "@eslint/js";
import prettier from "eslint-config-prettier";
export default [
js.configs.recommended,
prettier, // Disables conflicting ESLint rules
{
rules: {
// Only code quality rules, no formatting
"no-unused-vars": "warn"
}
}
];
Problem: Project has both .eslintrc.json and eslint.config.js.
Why it fails: ESLint 9+ uses flat config by default, ignores legacy .eslintrc.* files unless explicitly configured.
Better: Choose one format:
eslint.config.js (flat config).eslintrc.*Problem: Config references plugins not in package.json.
// ❌ Using plugin that's not installed
import react from "eslint-plugin-react"; // Error if not installed
Why it fails: Linting fails with module not found errors.
Better:
# Install required plugins
npm install --save-dev eslint-plugin-react
// ✅ Now it works
import react from "eslint-plugin-react";
Problem: Trying to replicate entire ESLint plugin ecosystem in Biome.
Why it fails: Biome doesn't support all ESLint plugins. Start simple, add rules incrementally.
Better:
{
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
}
}
Then add specific rules as needed, or stick with ESLint if you need specific plugins.
Problem: Manually fixing issues that tools can fix automatically.
Why it fails: Wastes time, may introduce inconsistencies.
Better: Let biome check --fix or eslint --fix + prettier --write handle formatting. Focus on logic errors and design issues.
The mr-sparkle plugin's linting hook:
.js, .jsx, .ts, .tsx, .mjs, .cjs)What this means: Most formatting issues auto-fix on save. Pay attention to reported unfixable issues.
Before finalizing JavaScript/TypeScript code:
Auto-fixable (tools handle):
Manual attention required:
The universal linting script handles JS/TS files automatically:
# Lint JavaScript file (applies fixes)
./plugins/mr-sparkle/skills/linting/scripts/lint.py file.js
# Lint TypeScript file
./plugins/mr-sparkle/skills/linting/scripts/lint.py file.ts
# JSON output for programmatic use
./plugins/mr-sparkle/skills/linting/scripts/lint.py file.jsx --format json
Exit codes:
0 - Clean or successfully fixed1 - Lint errors found (non-blocking)2 - Tool execution errorSee linting skill for complete CLI documentation.
Detailed guides (loaded on-demand for progressive disclosure):
biome-reference.md - Biome rule categories and common configurationseslint-reference.md - ESLint configuration patterns and flat config migrationprettier-reference.md - Prettier philosophy and configuration optionsdefault-biome.json - Our opinionated biome defaultsdefault-eslint.config.js - Modern flat config example with Prettier integrationdefault-prettier.json - Our opinionated prettier defaultsOfficial documentation to fetch:
Remember: This skill documents mr-sparkle's tool selection logic for JS/TS. Fetch official docs when you need specific rule definitions or configuration syntax you're unsure about.