@nexso/eslint-config
v2.0.2
Published
nexso ESLint configuration based on eslint-config-airbnb-extended with ESLint 9 Flat Config support
Readme
@nexso/eslint-config
A comprehensive ESLint configuration based on eslint-config-airbnb-extended with additional security rules and Nexso customizations.
Used in the nexso development (an aPaaS).
✨ Version 2.0+: Now fully compatible with ESLint 9.x using Flat Config format!
- ✅ ESLint 9.x support with Flat Config
- ✅ Based on
eslint-config-airbnb-extended(maintained AirBnB replacement)- ✅ Security rules included
- ✅ Import/export validation
- ✅ Node.js 18+ environments
- ❌ No legacy ESLint 8.x support (use v1.x for legacy)
Features
- AirBnB Extended: Built on top of
eslint-config-airbnb-extended- a modern, maintained replacement for AirBnB configs - Security: Built-in security linting with
eslint-plugin-security - Import Management: Proper import/export validation with
eslint-plugin-import-x - Modern JavaScript: ES2021+ features supported
- ESLint 9 Only: Full compatibility with ESLint 9.x Flat Config format
Installation
Install the config and its peer dependencies:
npm i -D @nexso/eslint-configUsage
ESLint 9.x (Flat Config) - Required
Create a eslint.config.js file with:
import nexso from '@nexso/eslint-config';
export default [
...nexso,
{
rules: {
// Override rules if needed
},
},
];Migration from v1.x
If you're upgrading from v1.x, you need to:
- Update to ESLint 9.x
- Convert your
.eslintrc.*toeslint.config.js - Install the new peer dependencies
- Update your configuration format
For legacy ESLint 8.x support, continue using @nexso/[email protected].
What's Included
This configuration includes:
Base Rules
- All rules from
eslint-config-airbnb-extended - JavaScript recommended rules from
@eslint/js
Security Rules
eslint-plugin-securityfor security-related linting
Custom nexso Rules
import-x/extensions: Enforces file extensions in imports (Node.js ES modules)no-restricted-syntax: Preventsfor...inloops, labels, andwithstatementsmax-len: 100 characters with comment exceptionfunction-paren-newline: Consistent parameter formattingno-underscore-dangle: Allows_idfor MongoDB compatibility
Requirements
- Node.js 18.18.0+ or 20.9.0+ or 21.1.0+
- ESLint 9.30.1+
- eslint-plugin-import-x 4.16.1+
Contributing
This package is used internally by nexso. Issues and pull requests are welcome.
Version History
See CHANGELOG
License
Apache-2.0
