CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-eslint--create-config

Utility to create ESLint config files through an interactive setup process.

Pending

Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

cli-interface.mddocs/

CLI Interface

Command-line interface for interactive ESLint configuration setup with support for different configuration modes and legacy formats.

Capabilities

Command Execution

The main CLI executable handles command-line arguments and orchestrates the configuration generation process.

/**
 * Main CLI entry point that processes command-line arguments
 * Supports interactive mode and direct configuration modes
 * Located at: bin/create-config.js
 */

Command Line Options:

  • No arguments: Interactive mode with prompts
  • --config <package-name>: Use specific shared configuration package
  • --eslintrc --config <package-name>: Generate legacy eslintrc-style configuration

Usage Examples:

# Interactive mode - asks questions about project setup
npx @eslint/create-config@latest

# Use a specific shared config (flat config format)
npx @eslint/create-config@latest -- --config eslint-config-standard

# Use a specific shared config (legacy eslintrc format)  
npx @eslint/create-config@latest -- --eslintrc --config eslint-config-standard

# Use scoped package
npx @eslint/create-config@latest -- --config @company/eslint-config

# Alternative using npm init
npm init @eslint/config@latest -- --config eslint-config-airbnb

Interactive Mode

When run without arguments, the CLI launches an interactive setup process:

  1. Language Selection: Choose what to lint (JavaScript, JSON, Markdown, CSS)
  2. Purpose Selection: Syntax checking only or syntax + problem detection
  3. JavaScript Configuration: Module type, framework, TypeScript usage, environment
  4. Markdown Configuration: CommonMark vs GitHub Flavored Markdown (if selected)
  5. Config File Language: JavaScript vs TypeScript for the config file
  6. Jiti Integration: For TypeScript config files on older Node.js versions
  7. Installation: Package manager choice and dependency installation

Direct Configuration Mode

When --config flag is provided:

  • Skips interactive prompts
  • Installs specified shared configuration package
  • Determines configuration type (flat vs eslintrc) based on --eslintrc flag presence
  • Automatically installs peer dependencies

Error Handling

The CLI handles several error conditions:

// Package.json validation
if (packageJsonPath === null) {
  throw new Error("A package.json file is necessary to initialize ESLint. Run `npm init` to create a package.json file and try again.");
}

Common error scenarios:

  • Missing package.json file in current directory
  • Invalid shared configuration package names
  • Network failures during peer dependency fetching
  • File system permissions for config file creation
  • Package manager availability (npm, yarn, pnpm, bun)

Process Flow

The CLI follows this execution flow:

  1. Initialization: Load package.json metadata and parse command arguments
  2. Mode Detection: Determine if running in interactive or direct config mode
  3. Configuration: Either prompt user or use provided configuration
  4. Generation: Create ConfigGenerator instance with appropriate options
  5. Calculation: Generate configuration content and dependency list
  6. Output: Create config file and optionally install dependencies

Exit Codes

  • 0: Successful configuration creation
  • 1: Error during execution (missing package.json, configuration errors, etc.)

Environment Requirements

  • Node.js: ^18.18.0 || ^20.9.0 || >=21.1.0 (with SSL support)
  • Package Manager: npm, yarn, pnpm, or bun (for dependency installation)
  • File System: Write permissions in current working directory

Install with Tessl CLI

npx tessl i tessl/npm-eslint--create-config

docs

cli-interface.md

index.md

interactive-questions.md

tile.json