CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-nuxt--eslint

Generate ESLint config from current Nuxt settings

Pending

Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

Overview
Eval results
Files

module-configuration.mddocs/

Module Configuration

Core module options and setup for integrating ESLint with Nuxt applications. The module is configured through the eslint key in nuxt.config.ts.

Capabilities

Module Options Interface

Main configuration interface for the @nuxt/eslint module.

/**
 * Main configuration interface for the @nuxt/eslint module
 */
interface ModuleOptions {
  /** 
   * Options for ESLint flat config generation (.nuxt/eslint.config.mjs)
   * Set to false to disable config generation
   * Set to true to use default options
   * Set to object to customize generation options
   */
  config?: ConfigGenOptions | boolean;
  
  /** 
   * Enable ESLint checker align with dev server or build process
   * Not enabled by default
   * Set to false to disable checker
   * Set to true to use default checker options  
   * Set to object to customize checker options
   */
  checker?: CheckerOptions | boolean;
}

Default Configuration

The module comes with sensible defaults that work for most Nuxt projects.

/**
 * Default module options applied when not specified
 */
const defaults: ModuleOptions = {
  config: true,
  checker: false,
};

Usage Examples:

// Basic usage with defaults
export default defineNuxtConfig({
  modules: ['@nuxt/eslint']
})

// Enable both config generation and checker
export default defineNuxtConfig({
  modules: ['@nuxt/eslint'],
  eslint: {
    config: true,
    checker: true
  }
})

// Disable config generation, enable checker only
export default defineNuxtConfig({
  modules: ['@nuxt/eslint'],
  eslint: {
    config: false,
    checker: {
      lintOnStart: true,
      emitError: true
    }
  }
})

// Custom configuration
export default defineNuxtConfig({
  modules: ['@nuxt/eslint'],
  eslint: {
    config: {
      configFile: 'custom/eslint.config.mjs',
      autoInit: false
    },
    checker: {
      include: ['src/**/*.ts'],
      formatter: 'unix'
    }
  }
})

Module Registration

The module is automatically registered with Nuxt's module system and provides configuration key registration.

/**
 * Module metadata for Nuxt registration
 */
interface ModuleMeta {
  /** Module name for identification */
  name: '@nuxt/eslint';
  /** Configuration key in nuxt.config.ts */
  configKey: 'eslint';
}

Setup Process

The module setup process follows Nuxt's module lifecycle:

  1. Registration: Module is registered with Nuxt module system
  2. Option Processing: User configuration is merged with defaults
  3. Config Generation: If enabled, ESLint config generation is set up
  4. Checker Integration: If enabled, dev server integration is configured
  5. Hook Registration: Custom hooks are registered for extensibility

The setup is conditional based on configuration:

  • Config generation runs if options.config is truthy
  • Checker integration only runs in development mode if options.checker is truthy

Configuration Validation

The module performs basic validation on configuration options:

  • Boolean values enable/disable features with default settings
  • Object values allow detailed customization
  • Invalid configurations will result in setup errors during Nuxt startup

Install with Tessl CLI

npx tessl i tessl/npm-nuxt--eslint

docs

config-generation.md

dev-server-integration.md

extensibility.md

index.md

module-configuration.md

tile.json