Registry / ai-ml / laint
library0.1.7jsnpmunverified

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.

npm install laint
INSTALL
IMPORT
SIG · LAINT
L
laint
ai-mljavascriptv0.1.7
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

lintJsxCode
import { lintJsxCode } from 'laint'
const lintJsxCode = require('laint').lintJsxCode
ESM-only; no default export. TypeScript types ship with the package.
getAllRuleNames
import { getAllRuleNames } from 'laint'
import getAllRuleNames from 'laint'
Named export, not default.
getRulesForPlatform
import { getRulesForPlatform } from 'laint'
import { getRulesForPlatform } from 'laint/getRulesForPlatform'
Not a subpath export; import from root.

Shows programmatic linting with lintJsxCode and how to retrieve all rule names.

import { lintJsxCode, getAllRuleNames } from 'laint'; const code = ` <Link href="./profile">Profile</Link> <Button onPress={() => router.navigate('../settings')} /> `; // Run specific rules const results = lintJsxCode(code, { rules: ['no-relative-paths', 'expo-image-import', 'fetch-response-ok-check'], }); console.log(results); // [ // { rule: 'no-relative-paths', message: 'Use absolute paths...', line: 2, column: 14, severity: 'error' }, // { rule: 'no-relative-paths', message: 'Use absolute paths...', line: 3, column: 41, severity: 'error' } // ] // Get all rule names console.log(getAllRuleNames()); // ['no-relative-paths', 'expo-image-import', ...]
laint --version
Debug
Known issues
breakingLaint is v0.x and may introduce breaking changes without major version bump.
fix
Pin to exact version and test upgrades.
affects: >=0.1.0 <1.0.0
deprecatedThe rule 'no-type-assertion' was deprecated in v0.1.6 and may be removed.
fix
Use prefer-guard-clauses or type guards instead.
affects: >=0.1.6
gotchaExclude mode requires explicit 'rules' array even if empty: `{ rules: [], exclude: true }` runs all rules.
fix
Always provide an array for 'rules' when using exclude mode.
affects: >=0.1.0
gotchaPlatform mode: 'platform' option ignores 'rules' array; only 'platform' property is used.
fix
Use platform: 'expo' or others; setting both rules and platform may behave unexpectedly.
affects: >=0.1.0
gotchaCLI exit code 2 in hook mode prints violations to stderr; code 0/1 reads stdout.
fix
When integrating with Claude Code, check stderr for violations.
affects: >=0.1.0
Errors
Common errors & fixes
Cannot find module 'laint'
Package not installed or path incorrect.
fix
Run `npm install laint` and ensure node_modules contains it.
'lintJsxCode' is not exported from 'laint'
Using CommonJS require and destructuring incorrectly, or importing from wrong path.
fix
Use `import { lintJsxCode } from 'laint'` (ESM only).
TypeError: laint__WEBPACK_IMPORTED_MODULE_0__.lintJsxCode is not a function
Using default import instead of named import.
fix
Change `import laint from 'laint'` to `import { lintJsxCode } from 'laint'`.
Exit code 1 on clean file
Running in file mode; exit code 1 indicates violations found.
fix
Use `--hook` flag for Claude Code integration to get exit code 2 on violations.
Upgrade
Version history
0.1.7latest on npm
Audit
Dependencies
@typescript-eslint/parserrequiredUsed internally to parse JSX/TSX into AST for rule checks.
Agent activity
14 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources