eslint-plugin-lube
raw JSON → 0.5.1 verified Sat Apr 25 auth: no javascript
An ESLint plugin providing auto-fixable formatting rules to replace Prettier, including import sorting, JSDoc type casting, sequence formatting, and Svelte naming conventions. Current version 0.5.1, actively developed with TypeScript support. Requires ESLint >=9.0.0 (flat config). Differentiates by being fully fixable and integrating formatting into ESLint's linting pipeline, eliminating the need for a separate formatter. Supports 4 rules: pretty-imports, pretty-jsdoc-casting, pretty-sequence, svelte-naming-convention.
Common errors
error Error: Cannot find module 'eslint-plugin-lube' ↓
cause Plugin not installed in node_modules.
fix
Run 'npm install eslint-plugin-lube --save-dev'
error Error: ESLint configuration in .eslintrc.* is not supported ↓
cause Plugin requires flat config, not legacy rc files.
fix
Convert to eslint.config.js with flat config.
error TypeError: Cannot destructure property 'rules' of 'require(...)' as it is undefined. ↓
cause Using CommonJS require instead of ESM import.
fix
Use 'import lube from 'eslint-plugin-lube'' or use dynamic import.
Warnings
breaking Plugin requires eslint >=9.0.0 with flat config; older eslint versions or .eslintrc configs are not supported. ↓
fix Upgrade to ESLint 9+ and use eslint.config.js with flat config.
deprecated Rule 'pretty-sequence' may be deprecated in future; check docs for alternatives. ↓
fix Consider using other formatting rules or Prettier if sequence formatting is needed.
gotcha Only 4 rules available; request for more rules via GitHub issues may be needed. ↓
fix Check plugin docs for rule list; contribute or request new rules.
Install
npm install eslint-plugin-lube yarn add eslint-plugin-lube pnpm add eslint-plugin-lube Imports
- default wrong
const lube = require('eslint-plugin-lube')correctimport lube from 'eslint-plugin-lube' - rules wrong
const { rules } = require('eslint-plugin-lube')correctimport { rules } from 'eslint-plugin-lube' - configs wrong
const configs = require('eslint-plugin-lube').configscorrectimport { configs } from 'eslint-plugin-lube'
Quickstart
import lube from 'eslint-plugin-lube';
export default [
lube.configs.recommended,
{
rules: {
'lube/pretty-imports': 'error',
'lube/pretty-jsdoc-casting': 'error',
},
},
];