DIRUPT ESLint Config provides a set of carefully curated ESLint rules and configurations to ensure consistent code style and quality across projects. This package encapsulates the best practices and coding standards used by the DIRUPT core team, helping developers write clean, maintainable, and error-free JavaScript and TypeScript code.
Install the package from the npm registry.
pnpm add -D @dirupt/eslint-config
# Make sure also to install the following packages
pnpm add -D eslint@9 prettier@3
After installation, use one of the following presets depending on the nature of your application/library/project.
// eslint.config.{js,mjs,ts}
import { configApp } from '@adonisjs/eslint-config'
import { configAdonis } from '@dirupt/eslint-config'
export default configApp(configAdonis())
// eslint.config.{js,mjs,ts}
import { configReact } from '@dirupt/eslint-config'
export default configReact()
// eslint.config.{js,mjs,ts}
import { configTypescript } from '@dirupt/eslint-config'
export default configTypescript()
// eslint.config.{js,mjs,ts}
import { configRecommanded } from '@dirupt/eslint-config'
export default configRecommanded()
You can combine multiple configurations. For example:
// eslint.config.{js,mjs,ts}
import { configTypescript, configRecommanded, configReact } from '@dirupt/eslint-config'
export default configTypescript(configRecommanded(configReact()))
-
configAdonis()
: Configuration for AdonisJS projects -
configReact()
: Configuration for React projects -
configTypescript()
: Configuration for TypeScript projects -
configRecommanded()
: Recommended configuration for general JavaScript/TypeScript projects
Each configuration can be customized by passing additional options or rules.
This package includes several plugins and predefined rules:
- Import plugin and rules
- Unused imports plugin and rules
- Prettier plugin and rules
- TypeScript-specific rules (when using
configTypescript
) - React-specific rules (when using
configReact
)
For detailed information about the rules and plugins, please refer to the source code or documentation of each specific configuration.