Skip to content
lint-fixer logo

Lint Fixer

lint-fixer

Expert assistant for analyzing and fixing linting and formatting issues in the KR92 Bible Voice project using Biome and TypeScript. Use when fixing lint errors, resolving TypeScript issues, applying code formatting, or reviewing code quality.

SKILL.md

Full skill instructions

Lint Fixer

Capabilities

  • Analyze Biome lint errors, warnings, and infos
  • Auto-fix safe linting issues
  • Review and apply TypeScript strict mode fixes
  • Explain linting rules and best practices
  • Batch fix common patterns

Linting Tools

Biome

The project uses Biome for linting and formatting:

npx @biomejs/​biome lint .           # Check for lint issues
npx @biomejs/​biome lint . --write   # Auto-fix safe issues
npx @biomejs/​biome format .         # Format code
npx @biomejs/​biome check --write .  # Lint + format

TypeScript

npx tsc --noEmit                    # Type checking
npm run typecheck                   # Same as above

Common Biome Issues

1. Template Literals (useTemplate)

Issue: String concatenation should use template literals

Before:

alert('Error: ' + err.message);
const url = baseUrl + '/' + endpoint;

After:

alert(`Error: ${err.message}`);
const url = `${baseUrl}/​${endpoint}`;

2. Const Declarations (useConst)

Issue: Variables that are never reassigned should use const

Before:

let value = 10;
let result = calculate();

After:

const value = 10;
const result = calculate();

3. Unused Variables (noUnusedVariables)

Issue: Variables declared but never used

Fix:

// Remove if truly unused
// const unused = value;

// Or prefix with _ if intentionally unused
const _intentionallyUnused = value;

4. Console Statements (noConsole)

Issue: Console statements in production code

Fix:

// Remove or conditionally include
if (process.env.NODE_ENV === 'development') {
  console.log('Debug info');
}

// Or use proper logging
logger.debug('Debug info');

5. Any Type (noExplicitAny)

Issue: Using any type instead of specific types

Before:

function process(data: any) {
  return data.value;
}

After:

interface Data {
  value: string;
}

function process(data: Data) {
  return data.value;
}

// Or use unknown for truly dynamic data
function process(data: unknown) {
  if (isData(data)) {
    return data.value;
  }
}

6. Non-Null Assertions (noNonNullAssertion)

Issue: Using ! non-null assertion

Before:

const element = document.getElementById('app')!;

After:

const element = document.getElementById('app');
if (!element) {
  throw new Error('Element not found');
}

Usage Examples

Example 1: Auto-Fix Safe Issues

User: "Fix all safe linting issues"

Assistant:

# Run Biome with auto-fix
npx @biomejs/​biome check --write .

# Review changes
git diff

# If changes look good, commit
git add .
git commit -m "fix: apply Biome auto-fixes"

Example 2: Fix Template Literal Issues

User: "Fix the template literal warnings"

Assistant: I'll fix the string concatenation issues. Looking at the error:

// public/​embed-test.html:413
alert('Audion toisto epäonnistui: ' + err.message);

Let me fix this:

// Replace with template literal
alert(`Audion toisto epäonnistui: ${err.message}`);

For batch fixing similar issues, I can use Find & Replace pattern:

  • Find: '([^']*?)'\s*\+\s*([^;]+)
  • Replace: `$1${$2}`

Example 3: Fix TypeScript Errors

User: "I have TypeScript errors in my component"

Assistant: Let me check the TypeScript errors:

npx tsc --noEmit 2>&1 | head -20

Common fixes:

Missing type annotations:

// Before
const handleClick = (e) => {
  console.log(e);
};

// After
const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {
  console.log(e);
};

Implicit any:

// Before
const data = await response.json();

// After
interface ApiResponse {
  success: boolean;
  data: any; // Define proper type
}
const data: ApiResponse = await response.json();

Example 4: Batch Fix Const Issues

User: "Convert all let to const where possible"

Assistant:

# First, let Biome auto-fix
npx @biomejs/​biome check --write .

# For remaining cases, manual review needed
# Search for: let (\w+) =
# Review each case to ensure variable isn't reassigned

Example 5: Clean Up Console Statements

User: "Remove or fix console.log statements"

Assistant:

Strategy:

  1. Development logs - Wrap in environment check
  2. Debug logs - Remove or convert to proper logging
  3. Error logs - Keep but use console.error
// Development only
if (import.meta.env.DEV) {
  console.log('Debug:', data);
}

// Remove debug logs
// console.log('Testing'); // ❌ Remove

// Keep error logs
console.error('Failed to load:', error); // ✅ Keep

// Better: Use proper error handling
try {
  await operation();
} catch (error) {
  console.error('Operation failed:', error);
  toast({
    title: "Error",
    description: error.message,
    variant: "destructive"
  });
}

Biome Configuration

The project likely has a biome.json config file:

{
  "$schema": "https://biomejs.dev/​schemas/​1.9.4/​schema.json",
  "vcs": {
    "enabled": true,
    "clientKind": "git",
    "useIgnoreFile": true
  },
  "files": {
    "ignoreUnknown": false,
    "ignore": ["node_modules", "dist", ".next", "build"]
  },
  "formatter": {
    "enabled": true,
    "indentStyle": "space",
    "indentWidth": 2,
    "lineWidth": 100
  },
  "linter": {
    "enabled": true,
    "rules": {
      "recommended": true,
      "style": {
        "useTemplate": "error",
        "useConst": "error"
      },
      "suspicious": {
        "noExplicitAny": "warn",
        "noConsole": "warn"
      }
    }
  },
  "javascript": {
    "formatter": {
      "quoteStyle": "single",
      "semicolons": "always"
    }
  }
}

Workflow for Fixing Lint Issues

Step 1: Assess the Damage

# Run lint check
npx @biomejs/​biome lint .

# Count issues by severity
npx @biomejs/​biome lint . 2>&1 | grep -c "error"
npx @biomejs/​biome lint . 2>&1 | grep -c "warn"

Step 2: Auto-Fix Safe Issues

# Let Biome fix what it can
npx @biomejs/​biome check --write .

# Check what changed
git diff --stat

Step 3: Manual Fixes

# Run lint again to see remaining issues
npx @biomejs/​biome lint . > lint-report.txt

# Fix manually by priority:
# 1. Errors first
# 2. Then warnings
# 3. Then infos

Step 4: Verify

# Run full check
npx @biomejs/​biome check .
npx tsc --noEmit

# If clean, commit
git add .
git commit -m "fix: resolve linting issues"

Priority Fix Order

  1. TypeScript errors - Breaks builds
  2. Biome errors - Critical issues
  3. Biome warnings - Important issues
  4. Biome infos - Nice to have

Common Patterns by File Type

React Components (.tsx)

// Common issues:
// - Missing type annotations for props
// - Unused imports
// - Console.log statements
// - Non-null assertions

// Fix template:
interface Props {
  data: DataType;
  onUpdate: (value: string) => void;
}

export const Component = ({ data, onUpdate }: Props) => {
  // No console.log here
  return <div>...</​div>;
};

Edge Functions (.ts)

// Common issues:
// - Any types in request/​response
// - Missing error handling types
// - String concatenation

// Fix template:
interface RequestBody {
  field: string;
}

interface ResponseData {
  success: boolean;
  data: ResultType;
}

serve(async (req: Request) => {
  try {
    const body: RequestBody = await req.json();
    // ...
    return new Response(
      JSON.stringify({ success: true, data }),
      { headers: corsHeaders }
    );
  } catch (error) {
    return new Response(
      JSON.stringify({
        success: false,
        error: error instanceof Error ? error.message : 'Unknown error'
      }),
      { status: 500, headers: corsHeaders }
    );
  }
});

Test Files

// Often can ignore some rules
// Add to biome.json:
{
  "linter": {
    "rules": {
      "suspicious": {
        "noExplicitAny": "off"  // OK in tests
      }
    }
  }
}

Ignoring Specific Issues

Inline Comments

// biome-ignore lint/​style/​useTemplate: Legacy code, will refactor later
const message = 'Error: ' + error;

// biome-ignore lint/​suspicious/​noExplicitAny: Third-party types
const data: any = externalLibrary.getData();

File-Level Ignore

/​* biome-ignore lint/​style/​useTemplate: Multiple concatenations in this file */

CI/​CD Integration

Your GitHub Actions already runs these checks:

# .github/​workflows/​ci.yml
- name: Lint
  run: |
    if npx -y @biomejs/​biome --version > /​dev/​null 2>&1; then
      npx @biomejs/​biome lint .
      npx @biomejs/​biome format . --check
    fi

- name: TypeScript
  run: npm run typecheck --if-present || npx tsc --noEmit

Quick Reference

Issue TypeCommand to FixManual Review?
Template literals--writeNo
Const declarations--writeNo
Formatting--writeNo
Unused variables--writeYes - verify not needed
Any typesManualYes - add proper types
Console statementsManualYes - keep errors only
Non-null assertionsManualYes - add null checks

Related Documentation

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View