eslint-config/README.md
rus07tam b4f68f48c6
All checks were successful
Publish to npm / publish-npm (release) Successful in 9s
initial commit
2026-02-08 15:13:43 +00:00

3.2 KiB

@ruject/eslint-config

License Stars Open Issues

A comprehensive ESLint configuration package designed for TypeScript projects, enforcing stylistic consistency, code quality, and modern best practices.

Why This Config?

  • Reduces boilerplate setup across multiple projects.
  • Enforces consistent style and property ordering in classes/interfaces/objects.
  • Integrates modern ESLint ecosystem plugins in a single, maintainable config.
  • Designed for TypeScript projects with type-aware linting.

Features

Installation

bun install -D @ruject/eslint-config
# or
npm install --save-dev @ruject/eslint-config

All ESLint plugins and TypeScript ESLint should be installed as dev dependencies alongside this package.


Usage

Create a eslint.config.js in your project:

import config from '@ruject/eslint-config';
export default config;

Legacy config

Create a .eslintrc.js in your project:

module.exports = {
  extends: ['@ruject/eslint-config'],
};

Rules

Sorting with Perfectionist

  • Classes, Interfaces, Objects, Object Types are sorted according to custom natural rules.

  • sortBaseRule — base sorting order for objects and interfaces.

  • sortDetailedRule — detailed sorting for classes, including static/private/protected properties and methods.

  • Keys like type, id, name, meta, author, version are prioritized, unknown properties are moved to the bottom.

  • All other members (methods, properties, accessors, static blocks) are sorted naturally with detailed rules.

Prettier

  • Enforces single quotes.
  • Automatically checks formatting errors.
  • Ensures code is formatted consistently across the project.

SonarJS Rules

  • Integrates recommended SonarJS rules for detecting code smells and maintainability issues.

Unicorn Rules

  • Enables all Unicorn plugin rules for safer and cleaner code.

Ignored Files

Automatically ignores:

dist/**
**/dist/**
build/**
**/build/**

Customization

You can extend or override any rule as needed:

module.exports = {
  extends: ['@ruject/eslint-config'],
  rules: {
    'perfectionist/sort-classes': 'off',
    'prettier/prettier': ['error', { singleQuote: false }],
  },
};

License

See LICENSE for details.