Skip to content

Commit

Permalink
Merge pull request #474 from 0x6b/textlint-formatter-to-@textlint
Browse files Browse the repository at this point in the history
refactor(textlint-formatter): move to @textlint/linter-formatter
  • Loading branch information
0x6b committed Jan 17, 2018
2 parents b769c1b + 9f54a5a commit ea23a73
Show file tree
Hide file tree
Showing 42 changed files with 23 additions and 20 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Visit [https://textlint.github.io/](https://textlint.github.io/) to see textlint
- `npm install textlint-rule-xxx`.
- See [collection of textlint rules](https://github.com/textlint/textlint/wiki/Collection-of-textlint-rule "Collection of textlint rule · textlint/textlint Wiki")
- [Markdown](https://github.com/textlint/textlint-plugin-markdown) and [plain text](https://github.com/textlint/textlint-plugin-text) are supported by default. Support is available for [HTML](https://github.com/textlint/textlint-plugin-html) and [other file formats](https://github.com/textlint/textlint#supported-file-formats) via plugins.
- Supports the use of custom formatters and formatter bundles [formatter(reporter)](./packages/textlint-formatter)
- Supports the use of custom formatters and formatter bundles [formatter(reporter)](./packages/@textlint/linter-formatter)

## Quick Tour

Expand Down Expand Up @@ -315,7 +315,7 @@ e.g. use `pretty-error` formatter:
$ textlint -f pretty-error file.md
```

More details in [textlint-formatter](./packages/textlint-formatter "textlint-formatter").
More details in [@textlint/linter-formatter](./packages/@textlint/linter-formatter "@textlint/linter-formatter").

## Use as node module

Expand Down Expand Up @@ -472,7 +472,7 @@ These modules are parts of textlint.
| :--------------------------------------- | :--------------------------------------- | :--------------------------------------- |
| [`textlint`](./packages/textlint) | [![npm](https://img.shields.io/npm/v/textlint.svg?style=flat-square)](https://www.npmjs.com/package/textlint) | textlint command line tool itself |
| [`@textlint/kernel`](./packages/@textlint/kernel) | [![npm](https://img.shields.io/npm/v/@textlint/kernel.svg?style=flat-square)](https://www.npmjs.com/package/@textlint/kernel) | textlint main logic module. It is universal JavaScript. |
| [`textlint-formatter`](./packages/textlint-formatter) | [![npm](https://img.shields.io/npm/v/textlint-formatter.svg?style=flat-square)](https://www.npmjs.com/package/textlint-formatter) | textlint output formatter |
| [`@textlint/linter-formatter`](./packages/@textlint/linter-formatter) | [![npm](https://img.shields.io/npm/v/@textlint/linter-formatter.svg?style=flat-square)](https://www.npmjs.com/package/@textlint/linter-formatter) | textlint output formatter |
| [`textlint-fixer-formatter`](./packages/textlint-fixer-formatter) | [![npm](https://img.shields.io/npm/v/textlint-fixer-formatter.svg?style=flat-square)](https://www.npmjs.com/package/textlint-fixer-formatter) | textlint output formatter for fixer |
| [`textlint-plugin-markdown`](./packages/textlint-plugin-markdown) | [![npm](https://img.shields.io/npm/v/textlint-plugin-markdown.svg?style=flat-square)](https://www.npmjs.com/package/textlint-plugin-markdown) | markdown support for textlint |
| [`textlint-plugin-text`](./packages/textlint-plugin-text) | [![npm](https://img.shields.io/npm/v/textlint-plugin-text.svg?style=flat-square)](https://www.npmjs.com/package/textlint-plugin-text) | plain text support for textlint |
Expand Down
4 changes: 2 additions & 2 deletions docs/formatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ You can read the source code from `filePath` property.

## Built-in formatter

textlint use `textlint-formatter` module as built-in formatter.
textlint use `@textlint/linter-formatter` module as built-in formatter.

- [textlint-formatter](../packages/textlint-formatter/README.md "textlint-formatter")
- [@textlint/linter-formatter](../packages/@textlint/linter-formatter/README.md "@textlint/linter-formatter")

## Custom Formatter

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# textlint-formatter
# @textlint/linter-formatter

[textlint](https://github.com/textlint/textlint "textlint/textlint") output formatter.

## Installation

```
npm install textlint-formatter
npm install @textlint/linter-formatter
```

## Usage
Expand All @@ -15,7 +15,7 @@ See [formatters/](src/formatters).
Currently, you can use "stylish" (defaults), "checkstyle", "compact", "jslint-xml", "json", "junit", "pretty-error", "table", "tap", and "unix".

```js
const createFormatter = require("textlint-formatter").createFormatter;
const createFormatter = require("@textlint/linter-formatter").createFormatter;
const formatter = createFormatter({
formatterName: "stylish"
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node
var concat = require("concat-stream");
var fs = require("fs");
var run = require("../lib/textlint-formatter/src/cli");
var run = require("../lib/linter-formatter/src/cli");
var useStdIn = process.argv.indexOf("--stdin") > -1;
if (useStdIn) {
process.stdin.pipe(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "textlint-formatter",
"name": "@textlint/linter-formatter",
"description": "textlint output formatter",
"version": "3.0.2",
"homepage": "https://github.com/textlint/textlint/tree/master/packages/textlint-formatter",
"homepage": "https://github.com/textlint/textlint/tree/master/packages/@textlint/linter-formatter",
"repository": {
"type": "git",
"url": "https://github.com/textlint/textlint.git"
},
"main": "lib/textlint-formatter/src/index.js",
"types": "lib/textlint-formatter/src/index.d.ts",
"main": "lib/linter-formatter/src/index.js",
"types": "lib/linter-formatter/src/index.d.ts",
"bin": {
"textlint-formatter": "bin/cmd.js"
},
Expand All @@ -30,6 +30,9 @@
"bugs": {
"url": "https://github.com/textlint/textlint/issues"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@azu/format-text": "^1.0.1",
"@azu/style-format": "^1.0.0",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const path = require("path");
const tryResolve = require("try-resolve");
const interopRequire = require("interop-require");
const isFile = require("is-file");
const debug = require("debug")("textlint:textfix-formatter");
const debug = require("debug")("textlint:@textlint/linter-formatter");

export type FormatterConfig = { color?: boolean; formatterName: string };

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// LICENSE : MIT
"use strict";
import { createFormatter, getFormatterList } from "textlint-formatter";
import { createFormatter, getFormatterList } from "@textlint/linter-formatter";

import * as path from "path";
import * as assert from "assert";

describe("textlint-formatter-test", function() {
describe("@textlint/linter-formatter-test", function() {
describe("createFormatter", function() {
it("should return formatter function", function() {
const formatter = createFormatter({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./lib/"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/textlint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"@textlint/ast-node-types": "^4.0.0",
"@textlint/feature-flag": "^3.0.3",
"@textlint/kernel": "^2.0.4",
"@textlint/linter-formatter": "^3.0.2",
"@types/bluebird": "^3.5.18",
"bluebird": "^3.0.5",
"debug": "^2.1.0",
Expand All @@ -88,7 +89,6 @@
"read-pkg-up": "^3.0.0",
"structured-source": "^3.0.2",
"textlint-fixer-formatter": "^3.0.2",
"textlint-formatter": "^3.0.2",
"textlint-plugin-markdown": "^4.0.5",
"textlint-plugin-text": "^3.0.5",
"try-resolve": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/textlint/src/options.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// LICENSE : MIT
"use strict";
import { getFormatterList, FormatterDetail } from "textlint-formatter";
import { getFormatterList, FormatterDetail } from "@textlint/linter-formatter";
import { getFixerFormatterList, FixerFormatterDetail } from "textlint-fixer-formatter";

const optionator = require("optionator");
Expand Down
2 changes: 1 addition & 1 deletion packages/textlint/src/textlint-engine.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use strict";
import { createFormatter } from "textlint-formatter";
import { createFormatter } from "@textlint/linter-formatter";
import { AbstractTextLintEngine } from "./engine/textlint-engine-core";
import { TextLintCore } from "./textlint-core";
import { TextLintFormatterOption } from "./textlint-interface";
Expand Down

0 comments on commit ea23a73

Please sign in to comment.