Registry / testing / eslint-plugin-kirklin

eslint-plugin-kirklin

JSON →
library4.0.0jsnpmunverified

eslint-plugin-kirklin is a collection of opinionated ESLint rules created by Kirk Lin, primarily used with the kirklin/eslint-config configuration. The current stable version is 4.0.0, which adds support for ESLint v10. The plugin releases new features and breaking changes periodically, with v2.0.0 dropping CJS support to become ESM-only. Key differentiators include custom rules like consistent-list-newline, top-level-function, no-top-level-await, consistent-chaining, and indent-unindent, which enforce a consistent code style specific to the author's preferences.

npm install eslint-plugin-kirklin
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-KIRK
E
eslint-plugin-kirklin
testingjavascriptv4.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

default
✓ import plugin from 'eslint-plugin-kirklin'
✗ const plugin = require('eslint-plugin-kirklin')
Plugin is ESM-only since v2.0.0; requires eslint.config.js (flat config) for ESLint >=9.
rules
✓ import { rules } from 'eslint-plugin-kirklin'
✗ const { rules } = require('eslint-plugin-kirklin')
Named export for accessing rule definitions, also ESM-only.
configs
✓ import { configs } from 'eslint-plugin-kirklin'
✗ import { config } from 'eslint-plugin-kirklin'
Configurations are exported under configs (not config). Use plugin.configs.recommended for recommended config.

Shows how to import the plugin and configure recommended rules in flat config (ESLint >=9).

// eslint.config.js import plugin from 'eslint-plugin-kirklin'; export default [ { plugins: { kirklin: plugin, }, rules: { 'kirklin/consistent-list-newline': 'error', 'kirklin/top-level-function': 'error', 'kirklin/no-top-level-await': 'error', 'kirklin/consistent-chaining': 'warn', }, }, ];
Debug
Known issues
breakingv2.0.0 dropped CommonJS (CJS) build; plugin is now ESM-only.
fix
Ensure your project is using ES modules (set "type": "module" in package.json or use .mjs extension for config).
affects: >=2.0.0
deprecatedv1.x versions are deprecated; upgrade to v2+ for ESM support and latest rules.
fix
Update to v4.0.0: npm install eslint-plugin-kirklin@latest
affects: <2.0.0
gotchav4.0.0 requires ESLint v10. Using with older ESLint versions will fail.
fix
Update ESLint to >=10: npm install eslint@latest
affects: >=4.0.0
gotchaPlugin is designed for flat config (eslint.config.js). Legacy .eslintrc format is not supported since v2.
fix
Migrate to flat config: https://eslint.org/docs/latest/use/configure/configuration-files-new
affects: >=2.0.0
gotchaIf using ESLint <9, you must use a compatibility layer like @eslint/eslintrc to use this plugin.
fix
Consider upgrading to ESLint >=9 or use eslint-plugin-kirklin@1.x (but v1 is deprecated).
affects: >=2.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/eslint-plugin-kirklin/index.js from /path/to/.eslintrc.js not supported.
Plugin is ESM-only since v2.0.0, but config file is using CommonJS (require).
fix
Convert config to ESM (rename .eslintrc.js to eslint.config.js with "type": "module") or use dynamic import.
ESLint: Failed to load plugin 'kirklin' declared in '.eslintrc.*': Cannot find module 'eslint-plugin-kirklin'
Plugin not installed or not in node_modules.
fix
Run: npm install eslint-plugin-kirklin --save-dev
TypeError: plugin.config is not a function
Misleading: plugin.configs is an object, not a function; referring to it as config will cause a TypeError.
fix
Use plugin.configs.recommended (or plugin.configs itself) instead of plugin.config.
ESLint could not find the plugin 'eslint-plugin-kirklin' in the config.
Flat config requires the plugin to be registered in the plugins object.
fix
Add plugins: { kirklin: plugin } to your config object.
Upgrade
Version history
4.0.0latest on npm
Audit
Dependencies
eslintrequiredpeer dependency required to use the plugin
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-plugin-kirklin — npm install eslint-plugin-kirklin · libregistry