{"id":19576,"library":"eslint-config-scratch","title":"Scratch ESLint Config","description":"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.","status":"active","version":"14.1.13","language":"javascript","source_language":"en","source_url":"https://github.com/scratchfoundation/eslint-config-scratch","tags":["javascript","eslint","eslintconfig","prettier","scratch"],"install":[{"cmd":"npm install eslint-config-scratch","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-config-scratch","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-config-scratch","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required at runtime; version ^9.23.0","package":"eslint","optional":false},{"reason":"Peer dependency for formatting rules; version ^3","package":"prettier","optional":false}],"imports":[{"note":"ESM-only since v14; CommonJS require will fail.","wrong":"const eslintConfigScratch = require('eslint-config-scratch')","symbol":"eslintConfigScratch","correct":"import { eslintConfigScratch } from 'eslint-config-scratch'"},{"note":"Named export, not default; ensure exact name.","wrong":"import { prettierConfig } from 'eslint-config-scratch'","symbol":"prettierConfigScratch","correct":"import { prettierConfigScratch } from 'eslint-config-scratch'"},{"note":"defineConfig is a method on the exported object, not a direct named export.","wrong":"import { defineConfig } from 'eslint-config-scratch'","symbol":"eslintConfigScratch.defineConfig","correct":"import { eslintConfigScratch } from 'eslint-config-scratch'\neslintConfigScratch.defineConfig(...)"}],"quickstart":{"code":"// myProjectRoot/eslint.config.mjs\nimport { eslintConfigScratch } from 'eslint-config-scratch'\nimport { globalIgnores } from 'eslint/config'\n\nexport default eslintConfigScratch.defineConfig(\n  eslintConfigScratch.recommended,\n  {\n    files: ['src/**'],\n    languageOptions: {\n      parserOptions: {\n        projectService: true,\n        tsconfigRootDir: import.meta.dirname,\n      },\n    },\n  },\n  globalIgnores(['dist/**', 'node_modules/**']),\n)\n\n// myProjectRoot/prettier.config.mjs\nimport { prettierConfigScratch } from 'eslint-config-scratch'\nexport default prettierConfigScratch.recommended","lang":"typescript","description":"Shows typical flat config setup with TypeScript type-checking, ignoring dist and node_modules, and accompanying Prettier config."},"warnings":[{"fix":"Upgrade to eslint.config.mjs (or .js with type:module) and use eslintConfigScratch.defineConfig.","message":"v14 moved to ESM-only flat config, removing support for .eslintrc.* files and CommonJS.","severity":"breaking","affected_versions":">=14.0.0"},{"fix":"Update eslint to ^9 and prettier to ^3.","message":"Peer dependency eslint upgraded to ^9.0.0 in v14, incompatible with eslint <9.","severity":"breaking","affected_versions":">=14.0.0"},{"fix":"If you need old rule sets, pin to v9 or migrate to new presets.","message":"Legacy styles from eslint-config-scratch@^9 and below are no longer provided; only flat config presets are supported.","severity":"deprecated","affected_versions":">=14.0.0"},{"fix":"Use eslintConfigScratch.defineConfig(...) instead of importing defineConfig from a different package.","message":"eslintConfigScratch.defineConfig is re-exported from '@eslint/config'; do not import separately.","severity":"gotcha","affected_versions":">=14.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Change to import syntax: import { eslintConfigScratch } from 'eslint-config-scratch'","cause":"Using require() to import ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module from not supported."},{"fix":"Update to v14 and import the named export correctly.","cause":"Using an older version that doesn't have defineConfig method, or wrong import.","error":"TypeError: eslintConfigScratch.defineConfig is not a function"},{"fix":"Use severity numbers (0, 1, 2) or string ('off', 'warn', 'error') but ensure proper format in the config array.","cause":"Using severity as string instead of number in flat config.","error":"Configuration for rule 'no-console' is invalid: Value 'off' is not accepted."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}