Advanced Configuration

This page covers the technical details for power users: configuration, CI/CD setup, output formats, category filtering, and framework detection.

Direct Configuration

LintMyAI works with a configuration file in your project root. You can use it standalone (via npx lintmyai) or add a configuration file for custom rule settings.

Using with an Existing Config

Import and add the recommended config to your configuration file:

import lintmyai from 'lintmyai';

export default [
  lintmyai.configs.recommended,
  // ...your other configs
];

Customizing Rule Severity

Override individual rules in your config:

import lintmyai from 'lintmyai';

export default [
  lintmyai.configs.recommended,
  {
    rules: {
      'lintmyai/no-hardcoded-secrets': 'error',
      'lintmyai/no-excessive-comments': 'off',
    },
  },
];

Init Wizard

Generate a configuration file tailored to your project:

npx lintmyai init

This detects your framework and creates a config file with the appropriate rule set.

CI/CD Setup

GitHub Actions

Add LintMyAI to your GitHub Actions workflow:

name: Code Quality
on: [push, pull_request]

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm install -D lintmyai
      - run: npx lintmyai --ci
        env:
          LINTMYAI_LICENSE_KEY: ${{ secrets.LINTMYAI_LICENSE_KEY }}

GitLab CI

lint:
  image: node:20
  script:
    - npm install -D lintmyai
    - npx lintmyai --ci
  variables:
    LINTMYAI_LICENSE_KEY: $LINTMYAI_LICENSE_KEY

CI Mode

The --ci flag changes behavior for pipeline use:

  • Exits with a non-zero code when issues are found (fails the build)
  • Set LINTMYAI_LICENSE_KEY as a CI secret instead of running activate

SARIF Output

Generate SARIF (Static Analysis Results Interchange Format) output for integration with GitHub Code Scanning:

npx lintmyai --format sarif > results.sarif

GitHub Code Scanning Integration

Upload SARIF results to GitHub Code Scanning in your workflow:

- run: npx lintmyai --format sarif > results.sarif
  env:
    LINTMYAI_LICENSE_KEY: ${{ secrets.LINTMYAI_LICENSE_KEY }}
- uses: github/codeql-action/upload-sarif@v3
  with:
    sarif_file: results.sarif

This surfaces LintMyAI findings directly in your pull request annotations and the Security tab.

Category Filtering

Focus scans on specific issue categories:

# Only check for security issues
npx lintmyai --category security

# Only check for hallucinated imports
npx lintmyai --category hallucination

# Exclude complexity rules
npx lintmyai --exclude-category complexity

Available Categories

CategoryWhat It Catches
hallucinationFake packages, non-existent APIs
securityHardcoded secrets, unsafe patterns
dead-codeUnused functions, empty error handlers
ai-behaviorPlaceholder comments, hedging, AI fingerprints
boilerplateExcessive comments, over-documented code
complexityOverly complex functions, cognitive load
testingTest quality issues
frameworkFramework-specific anti-patterns

When --category is specified, --exclude-category is ignored.

JSON Output

Get machine-readable output for programmatic use:

npx lintmyai --format json

This outputs a JSON array of findings with file paths, line numbers, rule IDs, and messages -- useful for custom tooling, dashboards, or integrating with other systems.

Framework Packs

LintMyAI auto-detects your framework and loads the appropriate rule pack:

FrameworkDetectionAdditional Rules
Reactreact or react-dom in dependenciesHooks rules, component patterns
Next.jsnext in dependenciesReact rules + server-side patterns
Vuevue in dependenciesVue-specific linting
Nuxtnuxt in dependenciesVue rules + Nuxt patterns
Expressexpress in dependenciesServer-side patterns

Detection is automatic based on your package.json. No configuration needed.

Scanning Specific Files

Target specific files or directories:

# Scan a directory
npx lintmyai src/

# Scan specific files
npx lintmyai src/api/auth.ts src/utils/helpers.ts

License Activation

Local Development

Activate your license once per machine:

npx lintmyai activate YOUR_LICENSE_KEY

The license is stored at ~/.config/lintmyai/license.json. No .env file needed.

CI/CD Environments

Set the LINTMYAI_LICENSE_KEY environment variable in your CI secrets. No activation step needed -- the environment variable is checked automatically during scans.

License checks are disk-only during scans. No network calls, no latency impact.