Description
A reusable default configuration for ESLint v9 built on top of @antfu/eslint-config. This configuration provides a sensible set of rules to keep JavaScript code clean and consistent.
Installation
Install the package and its required dependencies using npm:
npm install --save-dev @rvanbaalen/eslint-config eslint
Usage
Basic Usage
In your project's ESLint configuration (e.g., eslint.config.js
), import and extend the default configuration:
import { config } from "@rvanbaalen/eslint-config";
export default config();
Customization
If you need to customize the rules or override some options, you can import the configuration function and pass your custom options. For example:
import { config } from "@rvanbaalen/eslint-config";
export default config(
{
// Option overrides for the underlying configuration
antfu: {
react: true // Enable React support if needed
}
},
{
// Additional or overriding ESLint rules
semi: ["error", "always"]
}
);
This approach allows you to tailor the ESLint rules to your project's specific requirements while still using a well-defined, default configuration.
Running ESLint
Define a run script in your package json:
{
"scripts": {
"lint": "eslint ."
}
}
Contributing
Contributions are welcome! Please feel free to open an issue or submit a pull request.
License
This project is licensed under the MIT License - see the LICENSE file for details.