Skip to main content
Glama
rodhayl
by rodhayl

linter

Run code lints, validate syntax, or apply LLM-powered fixes to improve code quality and catch errors in your projects.

Instructions

Run lints, syntax validation, or LLM-assisted lint fixes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionNoAction: run (check only), fix (LLM-powered fixes), validate (syntax check)
filesNoSpecific files to process
commandNoCustom lint command (for run action)
autoFixNoApply linter auto-fixes without LLM (for run action)
difficultyNoLLM fix difficulty level (for fix action)
dryRunNoPreview fixes without applying (for fix action)
maxFixesNoMaximum fixes to apply (for fix action)
contentNoContent to validate (for validate action, optional)
timeoutNoTimeout in milliseconds

Implementation Reference

  • The `runLinter` method in `ExecutionTools` class handles the execution of linting commands, supporting auto-detection and custom commands.
    async runLinter(options?: {
      command?: string;
      files?: string[];
      fix?: boolean;
      timeout?: number;
    }): Promise<ExecutionResult> {
      let command = options?.command;
    
      if (!command) {
        command = await this.detectLintCommand();
        if (!command) {
          return {
            success: false,
            exitCode: -1,
            stdout: '',
            stderr: 'Could not detect linter. Please provide a lint command.',
            duration: 0,
            command: '',
          };
        }
      }
    
      // Add fix flag if requested (ESLint style)
      if (options?.fix && command.includes('eslint')) {
        command = command.replace('eslint', 'eslint --fix');
      }
    
      // Append specific files if provided
      if (options?.files && options.files.length > 0) {
        command = `${command} ${options.files.join(' ')}`;
      }
    
      return this.executeCommand(
        command,
        this.workspaceRoot,
        options?.timeout ?? this.defaultTimeout
      );
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rodhayl/mcpLocalHelper'

If you have feedback or need assistance with the MCP directory API, please join our Discord server