Skip to main content

Integrating with Editors, CI, Tools, etc..

Editors

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:

  1. A textlint configuration file (.textlintrc.json, .textlintrc.js, etc.)
  2. Required textlint rules and plugins installed as dependencies in package.json
  3. A npm script for running textlint (e.g., "textlint": "textlint docs/**" in package.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'
run: npx textlint ${{ steps.changed-files.outputs.all_changed_files }}

Third-party Actions

  • reviewdog: Automated code review tool that supports textlint
  • action-textlint: Dedicated GitHub Action for running textlint with reviewdog integration

Browser

Program languages

Other