A comprehensive set of build tools and configurations for LoopBack 4 and TypeScript projects providing CLI commands for compilation, linting, testing, and coverage
—
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Pending
The risk profile of this skill
ESLint integration with automatic configuration discovery and LoopBack-specific rules for maintaining code quality and consistency.
Runs ESLint with automatic configuration discovery and default file extensions.
CLI Usage:
# Lint current directory
lb-eslint .
# Lint specific files
lb-eslint src/index.ts src/utils.ts
# Lint with fix
lb-eslint --fix .
# Report unused disable directives
lb-eslint --report-unused-disable-directives .
# Lint specific extensions
lb-eslint --ext .js,.jsx,.ts,.tsx src/Note: ESLint functionality is only available through the lb-eslint CLI command. It is not exported as a programmatic function from the main module.
Automatically discovers ESLint configuration files in the project.
Configuration Search Order:
.eslintrc.js in project root.eslintrc.json in project root@loopback/build/config/.eslintrc.jsDefault Configuration:
// @loopback/build/config/.eslintrc.js
module.exports = {
extends: '@loopback/eslint-config',
};Automatically discovers and uses ESLint ignore files.
// Automatically uses .eslintignore if present in project root
// Falls back to @loopback/build/config/.eslintignoreDefault Ignore Patterns:
node_modules
distAutomatically sets default file extensions if not specified.
// Default extensions: .js,.ts
// Only applied if --ext option is not providedExtension Examples:
# Uses default extensions (.js,.ts)
lb-eslint src/
# Custom extensions override defaults
lb-eslint --ext .js,.jsx,.ts,.tsx src/All ESLint command line options are supported and passed through.
interface ESLintOptions {
"--fix": boolean; // Automatically fix problems
"--fix-dry-run": boolean; // Show fixes without applying
"--ext": string; // File extensions to lint
"-c" | "--config": string; // Configuration file path
"--ignore-path": string; // Ignore file path
"--report-unused-disable-directives": boolean; // Report unused disable comments
"--max-warnings": number; // Maximum number of warnings allowed
"--output-file": string; // Output file for results
"--format": string; // Output format (stylish, json, etc.)
"--quiet": boolean; // Report errors only
"--cache": boolean; // Enable result caching
"--cache-location": string; // Cache file location
}Uses @loopback/eslint-config for consistent code style across LoopBack projects.
Features of @loopback/eslint-config:
Command Line Usage:
# Basic linting with default configuration
lb-eslint .
# Fix issues automatically
lb-eslint --fix src/Package.json Integration:
{
"scripts": {
"lint": "lb-eslint --report-unused-disable-directives .",
"lint:fix": "lb-eslint --fix .",
"lint:check": "lb-eslint ."
}
}Custom Configuration:
# Use custom config file
lb-eslint -c .eslintrc.custom.js src/
# Use custom ignore file
lb-eslint --ignore-path .eslintignore.custom src/
# Lint specific file types
lb-eslint --ext .ts,.d.ts src/ESLint errors are properly propagated and handled.
// Process exits with non-zero code on lint errors
// Warnings do not cause process exit unless --max-warnings is exceeded
// Configuration errors are reported with helpful messages