Registry / testing / eslint-config-scratch

eslint-config-scratch

JSON →
library14.1.13jsnpmunverified

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-scratch
INSTALL
IMPORT
SIG · ESLINT-CONFIG-SCRA
E
eslint-config-scratch
testingjavascriptv14.1.13
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

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

eslintConfigScratch
✓ import { eslintConfigScratch } from 'eslint-config-scratch'
✗ const eslintConfigScratch = require('eslint-config-scratch')
ESM-only since v14; CommonJS require will fail.
prettierConfigScratch
✓ import { prettierConfigScratch } from 'eslint-config-scratch'
✗ import { prettierConfig } from 'eslint-config-scratch'
Named export, not default; ensure exact name.
eslintConfigScratch.defineConfig
✓ import { eslintConfigScratch } from 'eslint-config-scratch' eslintConfigScratch.defineConfig(...)
✗ import { defineConfig } from 'eslint-config-scratch'
defineConfig is a method on the exported object, not a direct named export.

Shows typical flat config setup with TypeScript type-checking, ignoring dist and node_modules, and accompanying Prettier config.

// myProjectRoot/eslint.config.mjs import { eslintConfigScratch } from 'eslint-config-scratch' import { globalIgnores } from 'eslint/config' export default eslintConfigScratch.defineConfig( eslintConfigScratch.recommended, { files: ['src/**'], languageOptions: { parserOptions: { projectService: true, tsconfigRootDir: import.meta.dirname, }, }, }, globalIgnores(['dist/**', 'node_modules/**']), ) // myProjectRoot/prettier.config.mjs import { prettierConfigScratch } from 'eslint-config-scratch' export default prettierConfigScratch.recommended
Debug
Known issues
breakingv14 moved to ESM-only flat config, removing support for .eslintrc.* files and CommonJS.
fix
Upgrade to eslint.config.mjs (or .js with type:module) and use eslintConfigScratch.defineConfig.
affects: >=14.0.0
breakingPeer dependency eslint upgraded to ^9.0.0 in v14, incompatible with eslint <9.
fix
Update eslint to ^9 and prettier to ^3.
affects: >=14.0.0
deprecatedLegacy styles from eslint-config-scratch@^9 and below are no longer provided; only flat config presets are supported.
fix
If you need old rule sets, pin to v9 or migrate to new presets.
affects: >=14.0.0
gotchaeslintConfigScratch.defineConfig is re-exported from '@eslint/config'; do not import separately.
fix
Use eslintConfigScratch.defineConfig(...) instead of importing defineConfig from a different package.
affects: >=14.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module from not supported.
Using require() to import ESM-only package.
fix
Change to import syntax: import { eslintConfigScratch } from 'eslint-config-scratch'
TypeError: eslintConfigScratch.defineConfig is not a function
Using an older version that doesn't have defineConfig method, or wrong import.
fix
Update to v14 and import the named export correctly.
Configuration for rule 'no-console' is invalid: Value 'off' is not accepted.
Using severity as string instead of number in flat config.
fix
Use severity numbers (0, 1, 2) or string ('off', 'warn', 'error') but ensure proper format in the config array.
Upgrade
Version history
14.1.13latest on npm
Audit
Dependencies
eslintrequiredPeer dependency required at runtime; version ^9.23.0
prettierrequiredPeer dependency for formatting rules; version ^3
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-config-scratch — npm install eslint-config-scratch · libregistry