{"id":25851,"library":"laint","title":"Laint","description":"Laint is an AI-focused linting SDK for JSX/TSX code, currently at v0.1.7 with weekly releases. It provides 50+ programmatic lint rules targeting React, React Native, Expo, and backend development, designed to be used by AI agents (e.g., Claude Code) via hooks. Unlike ESLint, Laint focuses on AI-generated code patterns like no-relative-paths, no-manual-retry-loop, and prefer-guard-clauses, and supports platform-specific rule sets (expo, web, backend). It offers include/exclude mode and a CLI, with zero setup for Claude Code integration.","status":"active","version":"0.1.7","language":"javascript","source_language":"en","source_url":"https://github.com/Create-Inc/laint","tags":["javascript","lint","linter","jsx","tsx","react","react-native","expo","ai","typescript"],"install":[{"cmd":"npm install laint","lang":"bash","label":"npm"},{"cmd":"yarn add laint","lang":"bash","label":"yarn"},{"cmd":"pnpm add laint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used internally to parse JSX/TSX into AST for rule checks.","package":"@typescript-eslint/parser","optional":false}],"imports":[{"note":"ESM-only; no default export. TypeScript types ship with the package.","wrong":"const lintJsxCode = require('laint').lintJsxCode","symbol":"lintJsxCode","correct":"import { lintJsxCode } from 'laint'"},{"note":"Named export, not default.","wrong":"import getAllRuleNames from 'laint'","symbol":"getAllRuleNames","correct":"import { getAllRuleNames } from 'laint'"},{"note":"Not a subpath export; import from root.","wrong":"import { getRulesForPlatform } from 'laint/getRulesForPlatform'","symbol":"getRulesForPlatform","correct":"import { getRulesForPlatform } from 'laint'"}],"quickstart":{"code":"import { lintJsxCode, getAllRuleNames } from 'laint';\n\nconst code = `\n  <Link href=\"./profile\">Profile</Link>\n  <Button onPress={() => router.navigate('../settings')} />\n`;\n\n// Run specific rules\nconst results = lintJsxCode(code, {\n  rules: ['no-relative-paths', 'expo-image-import', 'fetch-response-ok-check'],\n});\n\nconsole.log(results);\n// [\n//   { rule: 'no-relative-paths', message: 'Use absolute paths...', line: 2, column: 14, severity: 'error' },\n//   { rule: 'no-relative-paths', message: 'Use absolute paths...', line: 3, column: 41, severity: 'error' }\n// ]\n\n// Get all rule names\nconsole.log(getAllRuleNames());\n// ['no-relative-paths', 'expo-image-import', ...]","lang":"typescript","description":"Shows programmatic linting with lintJsxCode and how to retrieve all rule names."},"warnings":[{"fix":"Pin to exact version and test upgrades.","message":"Laint is v0.x and may introduce breaking changes without major version bump.","severity":"breaking","affected_versions":">=0.1.0 <1.0.0"},{"fix":"Use prefer-guard-clauses or type guards instead.","message":"The rule 'no-type-assertion' was deprecated in v0.1.6 and may be removed.","severity":"deprecated","affected_versions":">=0.1.6"},{"fix":"Always provide an array for 'rules' when using exclude mode.","message":"Exclude mode requires explicit 'rules' array even if empty: `{ rules: [], exclude: true }` runs all rules.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use platform: 'expo' or others; setting both rules and platform may behave unexpectedly.","message":"Platform mode: 'platform' option ignores 'rules' array; only 'platform' property is used.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"When integrating with Claude Code, check stderr for violations.","message":"CLI exit code 2 in hook mode prints violations to stderr; code 0/1 reads stdout.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `npm install laint` and ensure node_modules contains it.","cause":"Package not installed or path incorrect.","error":"Cannot find module 'laint'"},{"fix":"Use `import { lintJsxCode } from 'laint'` (ESM only).","cause":"Using CommonJS require and destructuring incorrectly, or importing from wrong path.","error":"'lintJsxCode' is not exported from 'laint'"},{"fix":"Change `import laint from 'laint'` to `import { lintJsxCode } from 'laint'`.","cause":"Using default import instead of named import.","error":"TypeError: laint__WEBPACK_IMPORTED_MODULE_0__.lintJsxCode is not a function"},{"fix":"Use `--hook` flag for Claude Code integration to get exit code 2 on violations.","cause":"Running in file mode; exit code 1 indicates violations found.","error":"Exit code 1 on clean file"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}