@textmode/lint
v0.1.2
Published
Shared linting and formatting for the textmode.js ecosystem (ESLint, Prettier, markdownlint-cli2).
Maintainers
Readme
@textmode/lint
|
|
|
|
| :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@textmode/lint owns linting and formatting for the textmode.js ecosystem. It bundles the ESLint flat config, Prettier options, and markdownlint-cli2 rules behind one textmode-lint command, so consumers no longer install or configure the engines themselves.
Use it to give every repository the same lint and format behavior without repeating engine dependencies, config files, or ignore rules.
Features
- One package, three engines - ESLint, Prettier, and markdownlint-cli2 are implementation dependencies, not peer dependencies. Consumers install only
@textmode/lint. - One command -
textmode-lint lint,format,format:check,lint:markdown, andcheckcover the whole surface. - Zero config - Conventional projects need no ESLint, Prettier, or markdownlint configuration. The shared configs ship in the package.
- Zero ignore duplication - A shared
.prettierignorebaseline ships with the package and is used only when a project has no.prettierignoreof its own.
Installation
npm install -D @textmode/lintNo engine dependencies are required.
Usage
Conventional projects need no configuration. Create eslint.config.js at the project root only so editors and tools can resolve the shared flat config:
export { default } from '@textmode/lint';Then delegate the standard scripts:
{
"scripts": {
"format": "textmode-lint format",
"format:check": "textmode-lint format:check",
"lint": "textmode-lint lint",
"lint:markdown": "textmode-lint lint:markdown",
"lint:markdown:fix": "textmode-lint lint:markdown --fix"
}
}Commands
textmode-lint lint [targets...]
textmode-lint format [targets...]
textmode-lint format:check [targets...]
textmode-lint lint:markdown [--fix]
textmode-lint checklintruns ESLint with the shared flat config (default target.).formatformats files in place with Prettier (default target.).format:checkverifies formatting without writing.lint:markdownlints Markdown with markdownlint-cli2.checkrunsformat:check,lint, andlint:markdownin order and stops at the first failure.
Every argument after the command is forwarded to the underlying engine, so
textmode-lint lint --fix, textmode-lint lint src tests, and
textmode-lint lint:markdown --fix work without special handling.
Every command accepts --cwd <directory>, --help, and --version. Exit
status 0 means success, 1 means the engine reported a problem, and 2
means the invocation was invalid.
Configuration
ESLint
Re-export the shared flat config from eslint.config.js:
export { default } from '@textmode/lint';To extend the shared config, compose it into a local flat config array:
import shared from '@textmode/lint';
export default [
...shared,
{
rules: {
'@typescript-eslint/no-explicit-any': 'off',
},
},
];Prettier
The CLI uses the shared Prettier options and a shared .prettierignore
baseline (Markdown and shader files). If a project has its own
.prettierignore, Prettier uses it instead.
For editor integration, point the prettier key at the shared options:
{
"prettier": "@textmode/lint/prettier"
}markdownlint
The CLI uses the shared markdownlint-cli2 config (globs, ignores, rules,
and formatter). A project can override or extend it with its own
.markdownlint-cli2.jsonc at the root, which merges with the shared config:
{
"ignores": ["examples/**/*.md", ".agents/**"],
}Related packages
@textmode/lint works with the following textmode-tooling packages:
| Package | Relationship |
| --------------------------------------------- | -------------------------------------------------------------------------------------- |
| @textmode/release | textmode-release format-staged uses @textmode/lint for the shared pre-commit hook |
| @textmode/tsconfig | Consumers commonly run type checks alongside lint checks in local package scripts |
License
The @textmode/lint package is licensed under the CC0 1.0 Universal.
