@bemoje/eslint
v2.0.0
Published
Custom ESLint plugin and rule utilities for consistent code style in TypeScript projects.
Maintainers
Readme
@bemoje/eslint
Custom ESLint plugin and rule utilities for consistent code style in TypeScript projects.
Exports
- createRule: Helper to create an ESLint rule with a consistent format.
- eslintPluginBemoje: ESLint plugin for Bemoje projects.
- noBlankLineBetweenCommentAndDeclaration: Enforce no blank lines between block comments and the next declaration.
- splitImports: Enforce no blank lines between block comments and the next declaration.
Installation
npm install --save-dev @bemoje/eslintFeatures
- Custom ESLint plugin with a recommended config
- Auto-fixable rules for consistent whitespace formatting
- Built on
@typescript-eslint/utilsfor TypeScript-aware linting - ESM flat config compatible
Usage
Plugin Setup (Flat Config)
// eslint.config.mjs
import { eslintPluginBemoje } from '@bemoje/eslint'
export default [
{
plugins: { 'eslint-plugin-bemoje': eslintPluginBemoje() },
rules: { 'eslint-plugin-bemoje/no-blank-line-between-comment-and-declaration': 'error' },
},
]Using the Recommended Config
import { eslintPluginBemoje } from '@bemoje/eslint'
const plugin = eslintPluginBemoje()
const { plugins, rules } = plugin.configs.recommended
export default [{ plugins, rules }]Rules
no-blank-line-between-comment-and-declaration
Enforces that there are no blank lines between a block comment (JSDoc or multi-line) and the declaration it documents. Auto-fixable.
Incorrect:
/**
* Adds two numbers.
*/
export function add(a: number, b: number) {
return a + b
}Correct:
/**
* Adds two numbers.
*/
export function add(a: number, b: number) {
return a + b
}Single-line block comments and line comments between the block comment and the declaration are ignored.
