Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

retext-textlint

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

retext-textlint

retext plugin to use textlint

  • 0.2.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

retext-textlint js-standard-style

retext plugin to use textlint.

Installation

npm:

npm install retext-textlint

Usage

Install textlint plugins.

npm:

npm install textlint-plugin-jtf-style
  • example/example.js
var retext = require('retext')
var japanese = require('retext-japanese')
var textlint = require('retext-textlint')
var compact = require('eslint/lib/formatters/compact')

var text = 'タイトル「文章の推敲に必要なこと」\n' +
    '\n' +
    '1 これは前段です。これは中段(2文の場合は後段という。)です。これは後段です。聡は常用漢字表外の漢字です。'

var options = {
  plugins: [
    'textlint-plugin-jtf-style'
  ]
}

retext().use(japanese).use(textlint, options).process(text, (err, file, doc) => {
  console.log('\n=== file ===')
  console.log(compact([file]))
})

/**
* === file ===
* : line 1, col 10, Warning - "jtf-style/2.1.2.漢字" 「敲」は「常用漢字表」外の漢字です。
* : line 3, col 41, Warning - "jtf-style/2.1.2.漢字" 「聡」は「常用漢字表」外の漢字です。
* : line 3, col 17, Error - "jtf-style/2.1.8.算用数字" 算用数字は「半角」で表記します。
* 
* 3 problems
*/
  • example/.textlintrc
{
  "plugins": [
    "jtf-style"
  ],
  "rules": {
    "jtf-style/2.1.2.漢字": {
      "severity" : "warning"
    },
    "jtf-style/4.1.1.句点(。)": false,
    "jtf-style/3.1.1.全角文字と半角文字の間": false
  }
}

API

retext.use(textlint, options)

Parameters

  • textlint — This plugin.

  • options (Object, optional)

    • plugins (Array.<string>) - textlint plugin name array.

License

MIT

Keywords

FAQs

Package last updated on 07 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc