Linting
We recommend using ESLint to enforce best practices and coding standards in your App-Compose projects.
Please note that this plugin requires ESLint 9+ and TypeScript.
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"
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”createTask accepts configuration in an object form. To maintain consistency and readability, configuration properties must follow the semantic order: name → run.context → run.fn → enabled.context → enabled.fn. This rule strictly enforces this sequence.
// 👍 greatcreateTask({ name: "alpha", run: { context: { timeout: timeoutTag }, fn: init }, enabled: { context: { authorized: authorizedTag }, fn: check },})
// 👎 weirdcreateTask({ name: "alpha", enabled: { fn: check, context: { authorized: authorizedTag } }, run: { context: { timeout: timeoutTag }, fn: init },})