textlint / textlint-filter-rule-allowlist Goto Github PK
View Code? Open in Web Editor NEWtextlint filter rule that filters any word by allowing lists.
License: MIT License
textlint filter rule that filters any word by allowing lists.
License: MIT License
An error occurred when updating to v1.2.1.
Paste the stack trace.
linter-registry.js [sm]:137 [Linter] Error running textlint TypeError: Error while loading rule 'whitelist': context.getConfigBaseDir is not a function
at module.exports (/Users/takashi/Documents/textlint_env/node_modules/textlint-filter-rule-whitelist/lib/textlint-filter-rule-whitelist.js:51:33)
at TextLintCoreTask.tryToGetRuleObject (/Users/takashi/.atom/packages/linter-textlint/node_modules/textlint/lib/task/textlint-core-task.js:241:24)
at TextLintCoreTask.tryToAddListenRule (/Users/takashi/.atom/packages/linter-textlint/node_modules/textlint/lib/task/textlint-core-task.js:261:35)
at /Users/takashi/.atom/packages/linter-textlint/node_modules/textlint/lib/task/linter-task.js:122:24
at /Users/takashi/.atom/packages/linter-textlint/node_modules/textlint/lib/core/rule-creator-set.js:127:24
at Array.forEach (native)
at RuleCreatorSet.forEach (/Users/takashi/.atom/packages/linter-textlint/node_modules/textlint/lib/core/rule-creator-set.js:126:35)
at TextLintCoreTask._setupRules (/Users/takashi/.atom/packages/linter-textlint/node_modules/textlint/lib/task/linter-task.js:109:39)
at new TextLintCoreTask (/Users/takashi/.atom/packages/linter-textlint/node_modules/textlint/lib/task/linter-task.js:67:15)
at LinterProcessor.process (/Users/takashi/.atom/packages/linter-textlint/node_modules/textlint/lib/linter/linter-processor.js:71:24)
at TextlintCore._parallelProcess (/Users/takashi/.atom/packages/linter-textlint/node_modules/textlint/lib/textlint-core.js:253:36)
at /Users/takashi/.atom/packages/linter-textlint/node_modules/textlint/lib/textlint-core.js:310:31
at tryCatcher (/Users/takashi/.atom/packages/linter-textlint/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/takashi/.atom/packages/linter-textlint/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/Users/takashi/.atom/packages/linter-textlint/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/Users/takashi/.atom/packages/linter-textlint/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/Users/takashi/.atom/packages/linter-textlint/node_modules/bluebird/js/release/promise.js:693:18)
at Async._drainQueue (/Users/takashi/.atom/packages/linter-textlint/node_modules/bluebird/js/release/async.js:133:16)
at Async._drainQueues (/Users/takashi/.atom/packages/linter-textlint/node_modules/bluebird/js/release/async.js:143:10)
at Async.drainQueues (/Users/takashi/.atom/packages/linter-textlint/node_modules/bluebird/js/release/async.js:17:14)
textlint fails to resolve allowlistConfigPaths when the fix flag is specified.
(textlint success to resolve prh's rulePaths when the fix flag is specified.)
npx textlint --config lint/.textlintrc doc/a.md
× Error
Error while loading filter rule 'allowlist': This allow file is not allow word list: ./allowlist/allow.json
at C:\Users\y_okazawa\tmp\allowlist\doc\a.md
× Stack trace
Error: Error while loading filter rule 'allowlist': This allow file is not allow word list: ./allowlist/allow.json
at C:\Users\y_okazawa\tmp\allowlist\doc\a.md
at C:\Users\y_okazawa\tmp\allowlist\node_modules\textlint-filter-rule-allowlist\lib\textlint-filter-rule-allowlist.js:28:13
at Array.forEach (<anonymous>)
at getAllowWordsFromFiles (C:\Users\y_okazawa\tmp\allowlist\node_modules\textlint-filter-rule-allowlist\lib\textlint-filter-rule-allowlist.js:19:9)
at module.exports (C:\Users\y_okazawa\tmp\allowlist\node_modules\textlint-filter-rule-allowlist\lib\textlint-filter-rule-allowlist.js:60:61)
at TextLintCoreTask.tryToGetFilterRuleObject (C:\Users\y_okazawa\tmp\allowlist\node_modules\@textlint\kernel\lib\task\textlint-core-task.js:191:20)
at TextLintCoreTask.tryToAddListenRule (C:\Users\y_okazawa\tmp\allowlist\node_modules\@textlint\kernel\lib\task\textlint-core-task.js:209:20)
at C:\Users\y_okazawa\tmp\allowlist\node_modules\@textlint\kernel\lib\task\fixer-task.js:67:19
at Array.forEach (<anonymous>)
at TextLintCoreTask._setupRules (C:\Users\y_okazawa\tmp\allowlist\node_modules\@textlint\kernel\lib\task\fixer-task.js:60:48)
at new TextLintCoreTask (C:\Users\y_okazawa\tmp\allowlist\node_modules\@textlint\kernel\lib\task\fixer-task.js:36:15)
textlint success without the fix flag.
npx textlint --config lint/.textlintrc doc/a.md
C:\Users\y_okazawa\tmp\fails-to-resolve-allowlistConfigPaths\doc\a.md
7:1 ✓ error テスティング => テスト prh
✖ 1 problem (1 error, 0 warnings)
✓ 1 fixable problem.
Try to run: $ textlint --fix [file]
require("textlint").TextLintNodeType;
Should we add g
flag to pattern string?
For example, following pattern string is treaded /#.*{#[a-z.-]+}/
.
As a result, this pattern match only first item({#first}
).
By constrast it does not match second item({#second}
)
pattern:
"/#.*{#[a-z.-]+}/"
text:
# First {#first}
# Second {#second}
Current behavior confuse user, I think.
Currently I write an ignore list inline in .textlintrc file.
I want to make an ignore list an external file so that it can be read.
I think it is convenient to write as follows.
{
"filters": {
"whitelist": {
"allow": [
"ignored-word",
"/\\d+/",
"/^===/m"
],
"allowPaths": [
"./allow-words.yml"
]
}
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.