{"id":25743,"library":"ifttt-lint","title":"ifttt-lint","description":"An open-source implementation of Google's internal IFTTT (IfThisThenThat) linter tool for enforcing atomic pull requests. It analyzes diffs and source files to ensure that when certain files or code regions change, specified dependent files or regions also change. Current stable version is v0.11.1, released periodically. Key differentiators include high-concurrency parallel linting using Node.js worker threads, support for labeled regions, and both CLI and programmatic APIs. It is typed with TypeScript, supports Node.js >=18.18, and integrates with GitHub Actions.","status":"active","version":"0.11.1","language":"javascript","source_language":"en","source_url":"https://www.github.com/ebrevdo/ifttt-lint","tags":["javascript","typescript"],"install":[{"cmd":"npm install ifttt-lint","lang":"bash","label":"npm"},{"cmd":"yarn add ifttt-lint","lang":"bash","label":"yarn"},{"cmd":"pnpm add ifttt-lint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used for CLI argument parsing","package":"commander","optional":false},{"reason":"Used for colored output","package":"chalk","optional":true}],"imports":[{"note":"Default export does not exist; must use named import.","wrong":"import IfThenElse from 'ifttt-lint'","symbol":"IfThenElse","correct":"import { IfThenElse } from 'ifttt-lint'"},{"note":"Use ESM import for TypeScript or modern Node.js.","wrong":"const { lintFile } = require('ifttt-lint')","symbol":"lintFile","correct":"import { lintFile } from 'ifttt-lint'"},{"note":"If only using type, import with `type` keyword to avoid runtime overhead.","wrong":"import { LintContext } from 'ifttt-lint'","symbol":"LintContext","correct":"import type { LintContext } from 'ifttt-lint'"}],"quickstart":{"code":"// Install: npm install --save-dev ifttt-lint\n// Example: lint a diff from stdin\nimport { execSync } from 'child_process';\nconst diff = execSync('git diff HEAD~1').toString();\nconst result = await lintFromString(diff, { ignore: ['**/*.bak'] });\nif (result.errors.length > 0) {\n  console.error('IFTTT lint errors:', result.errors);\n  process.exit(1);\n}\nconsole.log('No IFTTT issues found.');","lang":"typescript","description":"Demonstrates programmatic usage: reading a git diff, linting with ignore patterns, and checking errors."},"warnings":[{"fix":"Upgrade Node.js to v18.18 or later.","message":"Node.js >=18.18 required since v0.11.0; older Node.js versions cause import failures.","severity":"breaking","affected_versions":">=0.11.0"},{"fix":"Use direct file argument instead of --scan.","message":"The CLI option `--scan` is deprecated and will be removed in v1.0. Use `ifttt-lint path/to/file.diff` instead.","severity":"deprecated","affected_versions":">=0.11.0"},{"fix":"Upgrade to v0.11.0 or later which handles binary diffs gracefully.","message":"Binary files in diffs cause lint failures with 'Binary file not supported' error.","severity":"gotcha","affected_versions":"<0.11.0"},{"fix":"Use `import` syntax; switch to dynamic import if required from CJS modules.","message":"API functions previously exported as CommonJS are now ESM-only since v0.11.0.","severity":"breaking","affected_versions":">=0.11.0"},{"fix":"Ensure every `LINT.Label('name')` has a matching `LINT.EndLabel`.","message":"Missing `LINT.EndLabel` for an open `LINT.Label` causes parser errors without clear error message.","severity":"gotcha","affected_versions":"*"},{"fix":"Use single quotes: `-i '**/*.bak'`.","message":"Glob patterns for `-i` (ignore) must be wrapped in quotes in shell to prevent expansion.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Add `\"type\": \"module\"` to your package.json or use dynamic import.","cause":"Using ESM import in a CommonJS project without proper configuration.","error":"SyntaxError: Cannot use import statement outside a module"},{"fix":"Ignore binary files via `-i '*.png'` or upgrade to v0.11.0+.","cause":"Diff contains binary file with changes that cannot be parsed as text.","error":"Error: Binary file 'image.png' is not supported"},{"fix":"Check that each `LINT.EndLabel` is preceded by a `LINT.Label` with the same name.","cause":"Unmatched `LINT.EndLabel` annotation in source file.","error":"Error: LINT.EndLabel without matching LINT.Label"},{"fix":"Use `import { IfThenElse } from 'ifttt-lint'`.","cause":"Incorrect import: using default import instead of named import.","error":"TypeError: IfThenElse is not a constructor"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}