A comprehensive ESLint shareable config with 1,000+ rules (40% auto-fixable) and custom ESLint plugin. Current stable version: 47.4.2. Released frequently (10+ versions in recent months). Key differentiators: includes auto-detection ruleset that only applies relevant style guides based on project files, supports many frameworks (React, Next.js, TypeScript, GraphQL, Lodash, etc.) and tools (Jest, Vitest, Mocha, AVA). Requires ESLint ^9 and is ESM-only. No CJS support. Custom rules in eslint-plugin-canonical.
npm install eslint-config-canonicalVerified import paths — ran on the pinned version, not inferred.
Shows how to use the auto ruleset with typescript-eslint in an ESLint flat config file.
Switch to ESM imports. If using CommonJS, use dynamic import or stay on v46.
Use path imports: import react from 'eslint-config-canonical/react';
Explicitly include framework-specific configs (e.g., react, next) in overrides with explicit file patterns.
Migrate to ESLint 9 flat config. See ESLint migration guide.
Use canonical/vitest if possible, or copy the rules into your own config.
Use import syntax or set "type": "module" in package.json. Alternatively use dynamic import: const auto = (await import('eslint-config-canonical/auto')).default;Use the correct severity: "off", "warn", or "error" as a string, or use number 0, 1, 2.
Ensure eslint-plugin-canonical is installed as a devDependency. In flat config, use plugins: { canonical: require('eslint-plugin-canonical') } or import.Use path imports like 'eslint-config-canonical/auto' or import * as configs and use configs.react etc. (note: subpath imports are recommended).