Skip to content

Linting

An ESLint plugin enforces App-Compose conventions in TypeScript code. It requires ESLint 9+.

Use your preferred package manager.

Terminal window
npm install --save-dev --save-exact @grlt-hub/eslint-plugin-app-compose

Import 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',
},
}

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.

// ❌ Wrong
createTask({
name: "alpha",
enabled: {
fn: check,
context: { authorized: authorizedTag },
},
run: {
context: { timeout: timeoutTag },
fn: init,
},
})
// ✅ Correct
createTask({
name: "alpha",
run: {
context: { timeout: timeoutTag },
fn: init,
},
enabled: {
context: { authorized: authorizedTag },
fn: check,
},
})