Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cli/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { lintJsxCode } from '../index';
import type { LintConfig, LintResult } from '../types';

const JSX_EXTENSIONS = new Set(['.jsx', '.tsx']);
const LINT_EXTENSIONS = new Set(['.js', '.jsx', '.ts', '.tsx']);

function loadConfig(): LintConfig {
const configPath = path.resolve('laint.config.json');
Expand Down Expand Up @@ -55,13 +55,13 @@
}

const ext = path.extname(filePath).toLowerCase();
if (!JSX_EXTENSIONS.has(ext)) {
if (!LINT_EXTENSIONS.has(ext)) {
process.exit(0);
}

let code: string;
try {
code = fs.readFileSync(filePath, 'utf-8');

Check warning on line 64 in src/cli/check.ts

View workflow job for this annotation

GitHub Actions / Lint & Format

Found readFileSync from package "node:fs" with non literal argument at index 0
} catch {
// File doesn't exist or can't be read — don't block Claude
process.exit(0);
Expand All @@ -86,12 +86,12 @@
}

function runFileMode(filePath: string): void {
if (!fs.existsSync(filePath)) {

Check warning on line 89 in src/cli/check.ts

View workflow job for this annotation

GitHub Actions / Lint & Format

Found existsSync from package "node:fs" with non literal argument at index 0
console.error(`File not found: ${filePath}`);
process.exit(1);
}

const code = fs.readFileSync(filePath, 'utf-8');

Check warning on line 94 in src/cli/check.ts

View workflow job for this annotation

GitHub Actions / Lint & Format

Found readFileSync from package "node:fs" with non literal argument at index 0
const config = loadConfig();
const results = lintJsxCode(code, config);

Expand Down
Loading