@borela-tech/eslint-config
v2.2.2
Published
ESLint config used in Borela Tech projects.
Downloads
943
Maintainers
Readme
@borela-tech/eslint-config
Shared ESLint configuration for Borela Tech projects.
Features
- Preconfigured ESLint rules
- Includes recommended rules from:
- ESLint
- TypeScript
- React (if applicable)
- Custom rules for consistent import/export organization
Installation
npm install --save-dev @borela-tech/eslint-configUsage
Create a file named eslint.config.ts in the root of your project and add the
following code:
import {CONFIG} from '@borela-tech/eslint-config'
export default CONFIGCustom Rules
This package includes several custom ESLint rules to enforce consistent import and export organization. All rules are auto-fixable.
sorted-imports
Enforces imports are sorted alphabetically within their respective groups:
- Side-effect imports (e.g.,
import 'module') - Default imports (e.g.,
import React from 'react') - Named imports (e.g.,
import {useState} from 'react') - Type imports (e.g.,
import type {Config} from 'module')
Within each group, imports are sorted alphabetically by module source. Named import specifiers within each import are also sorted alphabetically.
sorted-re-exports
Enforces re-exports are sorted alphabetically within their respective groups:
- Re-export all (e.g.,
export * from 'module') - Re-export named (e.g.,
export {foo, bar} from 'module') - Re-export type (e.g.,
export type {Type1, Type2} from 'module')
Within each group, re-exports are sorted alphabetically by module source. Named export specifiers are also sorted alphabetically.
imports-and-re-exports-at-top
Ensures all imports and re-exports appear at the top of the file before any other statements.
individual-imports
Enforces one import per statement instead of grouped imports:
Bad:
import {foo, bar, baz} from 'module'Good:
import {foo} from 'module'
import {bar} from 'module'
import {baz} from 'module'individual-re-exports
Enforces one re-export per statement instead of grouped re-exports:
Bad:
export {foo, bar, baz} from 'module'Good:
export {foo} from 'module'
export {bar} from 'module'
export {baz} from 'module'