Shareable ESLint configuration for Scratch JavaScript and TypeScript projects, maintained by the Scratch Foundation. Current stable version is 14.1.13 (April 2026), with frequent releases (weekly bug fixes). It combines ESLint and Prettier for code style and correctness, providing flat config presets (recommended, recommendedTypeFree, recommendedTypeChecked) via eslintConfigScratch.defineConfig. Differentiators include first-class Scratch conventions, type-aware linting via typescript-eslint, and re-exported Prettier config (prettierConfigScratch). Requires ESLint 9 and Prettier 3 as peer dependencies.
npm install eslint-config-scratchVerified import paths — ran on the pinned version, not inferred.
Shows typical flat config setup with TypeScript type-checking, ignoring dist and node_modules, and accompanying Prettier config.
Upgrade to eslint.config.mjs (or .js with type:module) and use eslintConfigScratch.defineConfig.
Update eslint to ^9 and prettier to ^3.
If you need old rule sets, pin to v9 or migrate to new presets.
Use eslintConfigScratch.defineConfig(...) instead of importing defineConfig from a different package.
Change to import syntax: import { eslintConfigScratch } from 'eslint-config-scratch'Update to v14 and import the named export correctly.
Use severity numbers (0, 1, 2) or string ('off', 'warn', 'error') but ensure proper format in the config array.