textlint rule integrate with ESLint.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
test
.babelrc
.gitignore
.travis.yml
LICENSE
README.md
package.json

README.md

textlint-rule-eslint Build Status textlint fixable rule

textlint rule integrate with ESLint.

UseCase

ESLint can lint markdown file using eslint/eslint-plugin-markdown. But, eslint-plugin-markdown don't support disabling Markdown(HTML) comment for ignoring some CodeBlock.

textlint can filter specified CodeBlock using textlint-filter-rule-comments.

<!-- textlint-disable -->

```js
var ignore = "This is ignored"
```

<!-- textlint-enable -->

Sometimes, we want to write broken JavaScript code into JS CodeBlock for Syntax Highlight.

This is error example of parsing:

<!-- textlint-disable eslint -->

```js
// This is invalid example
const const;
```

<!-- textlint-enable eslint -->

Install

Install with npm:

npm install textlint-rule-eslint

Usage

Via .textlintrc(Recommended)

{
    "rules": {
        "eslint": {
          // Required: path to .eslintrc file
          "configFile": "path/to/.eslintrc"
        }
    }
}

Via CLI

textlint --rule eslint README.md

Options

  • configFile: string
    • Required
    • path to .eslintrc file
  • langs: string[]
    • recognize lang of CodeBlock
{
    "rules": {
        "eslint": {
            // Required: path to .eslintrc file
            "configFile": "path/to/.eslintrc",
            // recognize lang of CodeBlock
            "langs": ["js", "javascript", "node", "jsx"]
        }
    }
}

Fixable

textlint-rule-eslint support --fix option.

textlint rule

See https://github.com/textlint/textlint/#fixable for more details.

Changelog

See Releases page.

Running tests

Install devDependencies and Run npm test:

npm i -d && npm test

Contributing

Pull requests and stars are always welcome.

For bugs and feature requests, please create an issue.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

License

MIT © azu