lwc-linter
Version:
A comprehensive CLI tool for linting Lightning Web Components v8.0.0+ with modern LWC patterns, decorators, lifecycle hooks, and Salesforce platform integration
25 lines (22 loc) • 708 B
JavaScript
const path = require('path');
const fs = require('fs');
// Check if we're running from source or built version
const srcPath = path.join(__dirname, '../src/cli.ts');
const libPath = path.join(__dirname, '../lib/cli.js');
if (fs.existsSync(libPath)) {
// Use built version
require(libPath);
} else if (fs.existsSync(srcPath)) {
// Use TypeScript version with ts-node for development
try {
require('ts-node/register');
require(srcPath);
} catch (error) {
console.error('TypeScript compilation required. Please run: npm run build');
process.exit(1);
}
} else {
console.error('CLI files not found. Please install the package properly.');
process.exit(1);
}