Pluggable ESLint configuration for Node.js that extends ESNext with Node.js-specific safety checks and best practices
73
Create a configuration builder that composes layered ESLint rule sets for different JavaScript environments.
Build a system that generates ESLint configurations by composing base environment rules with optional style guide rules. Your system should support:
Each configuration should be a valid ESLint configuration object with:
extends array (for composition)rules object (for ESLint rule definitions)no-var and prefer-const @testno-path-concat @test.eslintrc file correctly merges rules from extended configs @test@generates
/**
* Generates an ESNext base configuration with modern JavaScript rules
* @returns {Object} ESLint configuration object with rules for ES2015+ code
*/
function generateESNextConfig() {
// IMPLEMENTATION HERE
}
/**
* Generates a Node.js configuration that extends ESNext
* @param {string} baseConfigPath - Path to the base configuration to extend
* @returns {Object} ESLint configuration object with Node.js-specific rules
*/
function generateNodeConfig(baseConfigPath) {
// IMPLEMENTATION HERE
}
/**
* Generates a style guide configuration with formatting rules
* @returns {Object} ESLint configuration object with code style rules
*/
function generateStyleGuideConfig() {
// IMPLEMENTATION HERE
}
/**
* Composes multiple ESLint configurations into a single .eslintrc file
* @param {string[]} configPaths - Array of configuration paths to extend
* @param {Object} additionalRules - Optional additional rules to override
* @returns {Object} Combined ESLint configuration object
*/
function composeConfigs(configPaths, additionalRules = {}) {
// IMPLEMENTATION HERE
}
module.exports = {
generateESNextConfig,
generateNodeConfig,
generateStyleGuideConfig,
composeConfigs
};Provides composable ESLint configurations for multiple JavaScript environments including ESNext, Node.js, and style guides.
Install with Tessl CLI
npx tessl i tessl/npm-eslint-config-nodedocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10