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_KEYas a CI secret instead of runningactivate
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
| Category | What It Catches |
|---|---|
hallucination | Fake packages, non-existent APIs |
security | Hardcoded secrets, unsafe patterns |
dead-code | Unused functions, empty error handlers |
ai-behavior | Placeholder comments, hedging, AI fingerprints |
boilerplate | Excessive comments, over-documented code |
complexity | Overly complex functions, cognitive load |
testing | Test quality issues |
framework | Framework-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:
| Framework | Detection | Additional Rules |
|---|---|---|
| React | react or react-dom in dependencies | Hooks rules, component patterns |
| Next.js | next in dependencies | React rules + server-side patterns |
| Vue | vue in dependencies | Vue-specific linting |
| Nuxt | nuxt in dependencies | Vue rules + Nuxt patterns |
| Express | express in dependencies | Server-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.