-
What version of textlint are you using? $ npx --no-install textlint -v
v13.3.3
$ npm list textlint-rule-terminology
opentelemetry.io@ /Users/chalin/git/lf/open-telemetry/opentelemetry.io
└── [email protected] What file type (Markdown, plain text, etc.) are you using? Markdown, here's the test input file <!-- Mis-capitalized "Github" on next line doesn't get reported -->
A Github
[api](some-url). <-- correctly reported: Incorrect usage of the term: “api”, use “API” instead -->
Github <-- correctly reported: Incorrect usage of the term: “Github”, use “GitHub” instead --> Here's my config file {
"rules": {
"terminology": {
"defaultTerms": false,
"terms": [
"API",
"GitHub"
]
}
}
} What did you do? Please include the actual source code causing the issue. $ npx textlint index.md
/Users/chalin/git/lf/open-telemetry/opentelemetry.io/index.md
3:2 ✓ error Incorrect usage of the term: “api”, use “API” instead terminology
4:1 ✓ error Incorrect usage of the term: “Github”, use “GitHub” instead terminology
✖ 2 problems (2 errors, 0 warnings)
✓ 2 fixable problems.
Try to run: $ textlint --fix [file] What did you expect to happen? The mis-capitalized "Github" on the second line should be reported as an error. What actually happened? Please include the actual, raw output from textlint. Only 2 out of the three errors are reported. $ npx textlint index.md --debug
textlint:cli cliOptions: {"debug":true,"ignorePath":"/Users/chalin/git/lf/open-telemetry/opentelemetry.io/.textlintignore","init":false,"stdin":false,"format":"stylish","color":true,"quiet":false,"textlintrc":true,"cache":false,"cacheLocation":"/Users/chalin/git/lf/open-telemetry/opentelemetry.io/.textlintcache","_":["index.md"]} +0ms
textlint:cli textlint --version: 13.3.3 +1ms
textlint:cli Running on files, stdin-filename: undefined +0ms
textlint:cli cliDescriptor: {"rule":[],"filterRule":[],"plugin":[]} +1ms
textlint:cli textlintrcDescriptor: {"rule":[{"id":"terminology","options":{"defaultTerms":false,"terms":["API","GitHub"]}}],"filterRule":[],"plugin":[{"id":"@textlint/textlint-plugin-text","options":{}},{"id":"@textlint/textlint-plugin-markdown","options":{}}],"configBaseDir":"/Users/chalin/git/lf/open-telemetry/opentelemetry.io"} +15ms
textlint:cli mergedDescriptor: {"rule":[{"id":"terminology","options":{"defaultTerms":false,"terms":["API","GitHub"]}}],"filterRule":[],"plugin":[{"id":"@textlint/textlint-plugin-text","options":{}},{"id":"@textlint/textlint-plugin-markdown","options":{}}],"configBaseDir":"/Users/chalin/git/lf/open-telemetry/opentelemetry.io"} +1ms
textlint:find-util findFiles ignore baseDir: /Users/chalin/git/lf/open-telemetry/opentelemetry.io, normalizeIgnoreFilePath: /Users/chalin/git/lf/open-telemetry/opentelemetry.io/.textlintignore +0ms
textlint:find-util search patterns: [ 'index.md' ] +0ms
textlint:find-util search ignore patterns: [ '**/.git/**', '**/node_modules/**' ] +2ms
textlint:createTextlint Available extensions: [".txt",".text",".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mkdown",".ron"] +0ms
textlint:createTextlint Process files: ["/Users/chalin/git/lf/open-telemetry/opentelemetry.io/index.md"] +0ms
textlint:createTextlint No Process files that are un-support extensions: [] +0ms
textlint:kernel used plugin "@textlint/textlint-plugin-markdown" +0ms
textlint:kernel process file /Users/chalin/git/lf/open-telemetry/opentelemetry.io/index.md +12ms
textlint:core-task terminology report {"message":"Incorrect usage of the term: “api”, use “API” instead","index":0,"fix":{"range":[0,3],"text":"API","isAbsolute":false}} +0ms
textlint:core-task terminology report {"message":"Incorrect usage of the term: “Github”, use “GitHub” instead","index":84,"fix":{"range":[84,90],"text":"GitHub","isAbsolute":false}} +1ms
textlint:cli lint results: [{"messages":[{"type":"lint","ruleId":"terminology","message":"Incorrect usage of the term: “api”, use “API” instead","index":78,"line":3,"column":2,"range":[78,79],"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3}},"severity":2,"fix":{"range":[78,81],"text":"API"}},{"type":"lint","ruleId":"terminology","message":"Incorrect usage of the term: “Github”, use “GitHub” instead","index":176,"line":4,"column":1,"range":[176,177],"loc":{"start":{"line":4,"column":1},"end":{"line":4,"column":2}},"severity":2,"fix":{"range":[176,182],"text":"GitHub"}}],"filePath":"/Users/chalin/git/lf/open-telemetry/opentelemetry.io/index.md"}] +33ms
textlint:@textlint/linter-formatter formatterName: stylish +0ms
/Users/chalin/git/lf/open-telemetry/opentelemetry.io/index.md
3:2 ✓ error Incorrect usage of the term: “api”, use “API” instead terminology
4:1 ✓ error Incorrect usage of the term: “Github”, use “GitHub” instead terminology
✖ 2 problems (2 errors, 0 warnings)
✓ 2 fixable problems.
Try to run: $ textlint --fix [file] The error in the second line gets reported if I do any of the following:
Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Not being familiar with textlint and filters, I originally reported this issue over
|
Beta Was this translation helpful? Give feedback.
-
The issue seems to be that textlint string nodes can contain multiple lines (i.e., For example, given this input text:
Here's the initial portion of the AST: {
"type": "Document",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "Str",
"value": "Some text\nA Github\nMore text",
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 3,
"column": 9
}
},
"range": [
0,
28
],
"raw": "Some text\nA Github\nMore text"
} Note the multiline |
Beta Was this translation helpful? Give feedback.
-
Fixed by: |
Beta Was this translation helpful? Give feedback.
Fixed by: