Legacy ES5 ESLint configuration without modern ES6+ features. Note: This configuration is deprecated. Use eslint-config-airbnb-base/legacy instead.
Provides Airbnb's ESLint rules for legacy ES5 JavaScript environments by extending eslint-config-airbnb-base/legacy.
/**
* Legacy Airbnb ESLint configuration (DEPRECATED)
* Usage: extends: ['airbnb/legacy']
* Recommended: Use 'eslint-config-airbnb-base/legacy' directly instead
*/
const legacyConfig = {
extends: ['eslint-config-airbnb-base/legacy'],
rules: {}
};Usage Examples:
// .eslintrc.js - Deprecated usage
module.exports = {
extends: ['airbnb/legacy'] // Don't use this
};
// .eslintrc.js - Recommended alternative
module.exports = {
extends: ['airbnb-base/legacy'] // Use this instead
};The legacy configuration is a simple wrapper around eslint-config-airbnb-base/legacy. Users should migrate to using the base package directly:
interface MigrationPath {
// Old (deprecated)
oldConfig: {
extends: ['airbnb/legacy'];
};
// New (recommended)
newConfig: {
extends: ['airbnb-base/legacy'];
};
}Migration Steps:
Install eslint-config-airbnb-base directly:
npm install --save-dev eslint-config-airbnb-baseUpdate ESLint configuration:
// Before
module.exports = {
extends: ['airbnb/legacy']
};
// After
module.exports = {
extends: ['airbnb-base/legacy']
};Remove eslint-config-airbnb if not using React rules:
npm uninstall eslint-config-airbnbThe legacy configuration includes all rules from eslint-config-airbnb-base/legacy:
interface LegacyRules {
// ES5 JavaScript features only
es5Rules: boolean;
// Legacy variable declaration patterns
varDeclaration: boolean;
// Function expressions and declarations
functionRules: boolean;
// Object and array handling (ES5)
objectArrayRules: boolean;
// Control flow and conditionals
controlFlowRules: boolean;
// Error handling and debugging
errorHandlingRules: boolean;
}interface LegacyConfiguration {
extends: ['eslint-config-airbnb-base/legacy'];
rules: Record<string, never>; // Empty rules object
}The legacy configuration was originally intended for:
interface LegacyUseCases {
// ES5-only environments
es5Environments: boolean;
// Internet Explorer compatibility
ieCompatibility: boolean;
// Legacy Node.js versions
oldNodeJS: boolean;
// Embedded JavaScript environments
embeddedJS: boolean;
// Build tools and scripts requiring ES5
buildScripts: boolean;
}However, all these use cases are better served by using eslint-config-airbnb-base/legacy directly.
The legacy configuration differs from the main configuration by excluding:
interface ExcludedFeatures {
// Modern ES6+ features not available in legacy config
arrowFunctions: false;
classes: false;
destructuring: false;
templateLiterals: false;
letConst: false;
modules: false;
defaultParameters: false;
restSpread: false;
// Features available in legacy config
varDeclarations: true;
functionExpressions: true;
objectLiterals: true;
arrayMethods: true;
regularExpressions: true;
}