Linting
An ESLint plugin enforces App-Compose conventions in TypeScript code. It requires ESLint 9+.
Installation
Section titled “Installation”Use your preferred package manager.
npm install --save-dev --save-exact @grlt-hub/eslint-plugin-app-composepnpm add --save-dev --save-exact @grlt-hub/eslint-plugin-app-composeyarn add --dev --exact @grlt-hub/eslint-plugin-app-composebun add --dev --exact @grlt-hub/eslint-plugin-app-composeImport the plugin and add it to your config. Use the recommended preset for a quick start.
import appCompose from "@grlt-hub/eslint-plugin-app-compose"import tseslint from "typescript-eslint"
export default tseslint.config(appCompose.configs.recommended)You can also configure it manually.
{ plugins: { 'app-compose': appCompose, }, rules: { 'app-compose/task-options-order': 'warn', },}task-options-order
Section titled “task-options-order”This order matches how a Task reads top-to-bottom: name first, then run before the optional enabled. Inside both, context comes before fn. The plugin warns when the order differs.
// ❌ WrongcreateTask({ name: "alpha", enabled: { fn: check, context: { authorized: authorizedTag }, }, run: { context: { timeout: timeoutTag }, fn: init, },})
// ✅ CorrectcreateTask({ name: "alpha", run: { context: { timeout: timeoutTag }, fn: init, }, enabled: { context: { authorized: authorizedTag }, fn: check, },})