Registry / testing / eslint-plugin-canonical

eslint-plugin-canonical

JSON →
library5.1.3jsnpmunverified

ESLint plugin enforcing Canonical style rules and TypeScript best practices. Current version 5.1.3 (stable, active development). Includes rules for filename conventions, import ordering, type import preferences, destructuring newlines, and identifier naming. Requires @typescript-eslint/parser. Provides recommended config. Differentiators: opinionated set of rules beyond standard ESLint/TypeScript-ESLint, promotes inline type imports, and strict naming conventions. Release cadence: multiple minor/patch releases per year.

testing
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 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

Plugin is default-exported; named export only for rules object.

import plugin from 'eslint-plugin-canonical' (or use in extends/plugins via 'plugin:canonical/recommended')

configs is a named export containing 'recommended' and other configs.

import { configs } from 'eslint-plugin-canonical'

Both ESM and CommonJS supported; rules map accessible via named import.

import { rules } from 'eslint-plugin-canonical'

Configures ESLint with Canonical plugin and recommended rules, plus custom rules for filename matching and inline type imports.

// .eslintrc.json { "parser": "@typescript-eslint/parser", "plugins": ["canonical"], "extends": ["plugin:canonical/recommended"], "rules": { "canonical/filename-match-exported": "error", "canonical/prefer-inline-type-import": "error" } }
Debug
Known footguns
breakingVersion 3.0.0 dropped support for Node <12; requires ESLint >=6.
deprecatedRule 'no-use-extend-native' deprecated in v4.0.0.
gotchaRequires @typescript-eslint/parser; using other parsers (e.g., babel-eslint) breaks rule functionality.
breakingVersion 5.0.0 changed rule 'destructuring-property-newline' defaults.
gotchaPlugin rule names require 'canonical/' prefix in ESLint config.
deprecatedRule 'id-match' deprecated in favor of built-in ESLint 'id-match' with custom options.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
8 hits · last 30 days
gptbot
4
ahrefsbot
3
script
1
Resources