Integrating with Editors, CI, Tools, etc..
Editors
- Atom Editor
- SublimeText
- Vim
- Visual Studio Code
- micro
- NetBeans
- Emacs
AI Assistants (MCP)
textlint can be used as a Model Context Protocol (MCP) server, enabling AI assistants to interact with textlint directly:
npx textlint --mcp
The MCP server provides tools for linting and fixing text content, allowing AI assistants to automatically check and improve text quality using your textlint configuration.
For detailed setup instructions, see MCP Setup Guide.
CI/CD
GitHub Actions
You can integrate textlint into your GitHub Actions workflow to automatically check text content in pull requests and commits.
Prerequisites
Before setting up GitHub Actions, ensure your project has:
- A textlint configuration file (
.textlintrc.json,.textlintrc.js, etc.) - Required textlint rules and plugins installed as dependencies in
package.json - A npm script for running textlint (e.g.,
"textlint": "textlint docs/**"inpackage.json)
textlint has no default rules, so proper configuration is essential. See Configuring textlint for setup instructions.
Basic Setup
Create .github/workflows/textlint.yml:
name: textlint
on:
push:
pull_request:
jobs:
textlint:
name: textlint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- run: npm ci
- run: npm run textlint
Pull Request Check
For checking only changed files in pull requests:
name: textlint
on:
pull_request:
jobs:
textlint:
name: textlint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- run: npm ci
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
with:
files: '**/*.{md,txt}'
- name: Run textlint on changed files
if: steps.changed-files.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
for file in ${ALL_CHANGED_FILES}; do
npm exec -- textlint "$file"
done
GitHub Annotations
You can use the github formatter to display lint results as GitHub Actions annotations. This makes errors visible directly in the pull request file view:
name: textlint
on:
pull_request:
jobs:
textlint:
name: textlint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- run: npm ci
- run: npm run textlint -- --format github
Or for changed files only:
name: textlint
on:
pull_request:
jobs:
textlint:
name: textlint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- run: npm ci
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
with:
files: '**/*.{md,txt}'
- name: Run textlint with GitHub formatter
if: steps.changed-files.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
for file in ${ALL_CHANGED_FILES}; do
npm exec -- textlint --format github "$file"
done
The github formatter displays lint messages as:
- Inline annotations in pull request file views
- Annotations in the job summary
- Detailed error messages in job logs
See Formatter documentation for more details.
Third-party Actions
- reviewdog: Automated code review tool that supports textlint
- action-textlint: Dedicated GitHub Action for running textlint with reviewdog integration
Browser
- @textlint/editor: Privacy-first browser extension for offline text linting
- Chrome Extension
Program languages
- textlintr: R language package