textlint-message-to-codemirror
v1.0.0
Published
Convert textlint's messages to CodeMirror lint object
Downloads
38
Readme
textlint-message-to-codemirror
Convert textlint'Ss messages to CodeMirror lint object
Install
Install with npm:
npm install textlint-message-to-codemirror
Usage
const assert = require("assert");
const textlintToCodeMirror = require("textlint-message-to-codemirror");
describe("textlintToCodeMirror", () => {
it("message to codemirror", () => {
assert.deepEqual(textlintToCodeMirror({
message: "message",
severity: 1,
line: 1,
column: 1
}), {
from: {
ch: 0,
line: 0
},
to: {
ch: 1,
line: 0
},
message: "message",
severity: "warning"
});
assert.deepEqual(textlintToCodeMirror({
message: "message",
severity: 2,
line: 10,
column: 10
}), {
from: {
ch: 9,
line: 9
},
to: {
ch: 10,
line: 9
},
message: "message",
severity: "error"
});
});
});
Running tests
Install devDependencies and Run npm test
:
npm i -d && npm test
Contributing
Pull requests and stars are always welcome.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Author
License
MIT © azu