Comparing version 7.2.1 to 9.1.0
# Changelog | ||
## v9.1.0 | ||
- Update `yandex-speller` package. | ||
## v9.0.0 | ||
- Update deps in package.json. | ||
- Yaspeller requires Node.js 16 or higher. | ||
## v8.0.1 | ||
Update deps in package.json. | ||
## v8.0.0 | ||
- Yaspeller requires Node.js 12 or higher. | ||
- Reducing the size of dependencies #178 @alchazov. | ||
- CLI `no-colors` option replaced with `no-color`. | ||
## v7.2.1 | ||
@@ -4,0 +19,0 @@ - --ignore-tags Not work properly in Markdown files with HTML #176 |
'use strict'; | ||
const async = require('async'); | ||
const chalk = require('chalk'); | ||
const program = require('commander'); | ||
@@ -20,5 +19,2 @@ | ||
setDebugMode(program.debug); | ||
if (!program.colors) { | ||
chalk.level = 0; | ||
} | ||
@@ -25,0 +21,0 @@ const mergedOptions = getMergedOptions(program.config); |
@@ -33,3 +33,3 @@ 'use strict'; | ||
.option('--dictionary <file>', 'json file for own dictionary', value => splitTrim(value, ':')) | ||
.option('--no-colors', 'clean output without colors') | ||
.option('--no-color', 'clean output without colors') | ||
.option('--report <type>', 'generate a report: console, text, html or json. Default: "console"', splitByCommas) | ||
@@ -36,0 +36,0 @@ .option('--ignore-tags <tags>', `ignore tags. Default: "${defaultConfig.ignoreTags.join(',')}"`, splitByCommas) |
'use strict'; | ||
const cosmiconfig = require('cosmiconfig').cosmiconfigSync; | ||
const lilconfig = require('lilconfig').lilconfigSync; | ||
const stripJsonComments = require('strip-json-comments'); | ||
const parseJson = require('parse-json'); | ||
const sjson = require('secure-json-parse'); | ||
const path = require('path'); | ||
@@ -15,3 +15,3 @@ | ||
try { | ||
return parseJson(stripJsonComments(content)); | ||
return sjson.parse(stripJsonComments(content)); | ||
} catch (err) { | ||
@@ -34,3 +34,3 @@ err.message = `JSON Error in ${filepath}:\n${err.message}`; | ||
function getConfig(file) { | ||
const explorer = cosmiconfig('yaspeller', { | ||
const explorer = lilconfig('yaspeller', { | ||
loaders: { | ||
@@ -37,0 +37,0 @@ '.json': loadJson, |
const chalk = require('chalk'); | ||
const pico = require('picocolors'); | ||
@@ -12,15 +12,15 @@ const { jsonStringify } = require('./string'); | ||
function consoleInfo(data) { | ||
console.info(chalk.cyan(data)); | ||
console.info(pico.cyan(data)); | ||
} | ||
function consoleWarn(data) { | ||
console.warn(chalk.yellow(data)); | ||
console.warn(pico.yellow(data)); | ||
} | ||
function consoleError(data) { | ||
console.error(chalk.red(data)); | ||
console.error(pico.red(data)); | ||
} | ||
function consoleOk(data) { | ||
console.log(chalk.green(data)); | ||
console.log(pico.green(data)); | ||
} | ||
@@ -35,3 +35,3 @@ | ||
if (isDebugMode()) { | ||
const prefix = chalk.cyan('[DEBUG]'); | ||
const prefix = pico.cyan('[DEBUG]'); | ||
if (typeof text === 'object' && text) { | ||
@@ -41,3 +41,3 @@ console.log(prefix); | ||
Object.keys(text).forEach(key => { | ||
console.log(chalk.cyan(' ' + key + ': ') + jsonStringify(text[key])); | ||
console.log(pico.cyan(' ' + key + ': ') + jsonStringify(text[key])); | ||
}); | ||
@@ -44,0 +44,0 @@ } else { |
@@ -5,3 +5,3 @@ 'use strict'; | ||
const isutf8 = require('isutf8'); | ||
const minimatch = require('minimatch'); | ||
const { minimatch } = require('minimatch'); | ||
const pth = require('path'); | ||
@@ -8,0 +8,0 @@ const stripJsonComments = require('strip-json-comments'); |
'use strict'; | ||
const chalk = require('chalk'); | ||
const pico = require('picocolors'); | ||
const program = require('commander'); | ||
@@ -39,16 +39,16 @@ | ||
if (pos.length) { | ||
comment.push(chalk.cyan(pos[0].line + ':' + pos[0].column)); | ||
comment.push(pico.cyan(pos[0].line + ':' + pos[0].column)); | ||
} | ||
if (el.count > 1) { | ||
comment.push(chalk.cyan('count: ' + el.count)); | ||
comment.push(pico.cyan('count: ' + el.count)); | ||
} | ||
if (hasEngRusLetters(el.word)) { | ||
comment.push(chalk.red('en: ' + replaceRusLettersWithAsterisk(el.word))); | ||
comment.push(chalk.green('ru: ' + replaceEngLettersWithAsterisk(el.word))); | ||
comment.push(pico.red('en: ' + replaceRusLettersWithAsterisk(el.word))); | ||
comment.push(pico.green('ru: ' + replaceEngLettersWithAsterisk(el.word))); | ||
} | ||
if (el.suggest) { | ||
comment.push(chalk.cyan('suggest: ' + el.suggest.join(', '))); | ||
comment.push(pico.cyan('suggest: ' + el.suggest.join(', '))); | ||
} | ||
@@ -74,3 +74,3 @@ | ||
if (hasManyErrors(data.data)) { | ||
errors.push(chalk.red('Too many errors\n')); | ||
errors.push(pico.red('Too many errors\n')); | ||
} | ||
@@ -81,3 +81,3 @@ | ||
if (typos.length) { | ||
errors.push(chalk.red(el.title + ': ' + | ||
errors.push(pico.red(el.title + ': ' + | ||
typos.length + '\n') + | ||
@@ -88,4 +88,4 @@ typos.join('\n') + '\n'); | ||
const time = data.time ? ' ' + chalk.magenta(data.time + ' ms') : ''; | ||
const separator = chalk.red('-----\n'); | ||
const time = data.time ? ' ' + pico.magenta(data.time + ' ms') : ''; | ||
const separator = pico.red('-----\n'); | ||
@@ -95,10 +95,10 @@ let res = data.resource; | ||
if (isUrl(res)) { | ||
res = chalk.underline(res); | ||
res = pico.underline(res); | ||
} | ||
if (errors.length) { | ||
console.error(chalk.red(errorSymbol) + ' ' + res + time + '\n' + | ||
console.error(pico.red(errorSymbol) + ' ' + res + time + '\n' + | ||
separator + errors.join('\n') + separator); | ||
} else { | ||
console.log(chalk.green(okSymbol) + ' ' + res + time); | ||
console.log(pico.green(okSymbol) + ' ' + res + time); | ||
} | ||
@@ -105,0 +105,0 @@ } |
@@ -11,4 +11,3 @@ 'use strict'; | ||
const yaspellerApi = require('yandex-speller'); | ||
const MarkdownIt = require('markdown-it'); | ||
const md = new MarkdownIt({ html: true }); | ||
const marked = require('marked').marked; | ||
@@ -67,3 +66,3 @@ const eyo = require('./plugins/eyo'); | ||
if (format === 'markdown') { | ||
text = md.render(text); | ||
text = marked(text); | ||
} | ||
@@ -70,0 +69,0 @@ |
The MIT License (MIT) | ||
© 2021 Denis Seleznev, <hcodes@yandex.ru> | ||
© 2023 Denis Seleznev, <hcodes@yandex.ru> | ||
@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
@@ -13,3 +13,3 @@ { | ||
"description": "Search tool typos in the text, files and websites", | ||
"version": "7.2.1", | ||
"version": "9.1.0", | ||
"license": "MIT", | ||
@@ -36,28 +36,28 @@ "homepage": "https://github.com/hcodes/yaspeller", | ||
"dependencies": { | ||
"async": "^3.2.1", | ||
"chalk": "^4.1.2", | ||
"async": "^3.2.4", | ||
"commander": "^3.0.0", | ||
"cosmiconfig": "^7.0.1", | ||
"entities": "^3.0.1", | ||
"entities": "^4.5.0", | ||
"escape-html": "^1.0.3", | ||
"eyo-kernel": "^2.5.6", | ||
"glob": "^7.2.0", | ||
"isutf8": "^3.1.1", | ||
"markdown-it": "^12.2.0", | ||
"minimatch": "^3.0.4", | ||
"node-fetch": "^2.6.2", | ||
"parse-json": "^5.2.0", | ||
"glob": "^10.3.10", | ||
"isutf8": "^4.0.0", | ||
"lilconfig": "^2.1.0", | ||
"marked": "^9.1.3", | ||
"minimatch": "^9.0.3", | ||
"node-fetch": "^2.7.0", | ||
"picocolors": "^1.0.0", | ||
"secure-json-parse": "^2.7.0", | ||
"strip-json-comments": "^3.1.1", | ||
"xml2js": "^0.4.23", | ||
"xml2js": "^0.6.2", | ||
"yandex-speller": "^4.1.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "^4.3.4", | ||
"eslint": "^8.1.0", | ||
"mocha": "^9.1.3", | ||
"chai": "^4.3.10", | ||
"eslint": "^8.52.0", | ||
"mocha": "^10.2.0", | ||
"nyc": "^15.1.0", | ||
"sinon": "^11.1.2" | ||
"sinon": "^17.0.0" | ||
}, | ||
"engines": { | ||
"node": ">=10" | ||
"node": ">=16" | ||
}, | ||
@@ -64,0 +64,0 @@ "scripts": { |
@@ -6,2 +6,3 @@ yaspeller | ||
[![Coverage Status](https://img.shields.io/coveralls/hcodes/yaspeller.svg)](https://coveralls.io/r/hcodes/yaspeller) | ||
[![install size](https://packagephobia.com/badge?p=yaspeller)](https://packagephobia.com/result?p=yaspeller) | ||
@@ -86,2 +87,5 @@ <img align="right" width="200" src="https://raw.githubusercontent.com/hcodes/yaspeller/master/images/logo.png" /> | ||
If you have tons of markdown and introduce this linter, you're likely to want | ||
generation of initial dictionary with [yaspeller-dictionary-builder](https://github.com/razum2um/yaspeller-dictionary-builder), | ||
so one line will cover all word's forms. | ||
@@ -136,3 +140,3 @@ #### `--report <type>` | ||
#### `--no-colors` | ||
#### `--no-color` | ||
Clean output without colors. | ||
@@ -139,0 +143,0 @@ |
@@ -78,2 +78,6 @@ yaspeller | ||
Если у вас много md-файлов, и вы заносите линтер, то, возможно, вам пригодится | ||
[yaspeller-dictionary-builder](https://github.com/razum2um/yaspeller-dictionary-builder). | ||
Так вы сможете сгенерировать начальный словарь, где каждая строка будет объединять все словоформы. | ||
#### `--report <type>` | ||
@@ -127,3 +131,3 @@ Задать вид отчёта: `console`, `html`, `markdown`, `junit` или `json`.<br/> | ||
#### `--no-colors` | ||
#### `--no-color` | ||
Консольный вывод без цвета. | ||
@@ -130,0 +134,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
97030
311
2310
+ Addedlilconfig@^2.1.0
+ Addedmarked@^9.1.3
+ Addedpicocolors@^1.0.0
+ Addedsecure-json-parse@^2.7.0
+ Added@isaacs/cliui@8.0.2(transitive)
+ Added@pkgjs/parseargs@0.11.0(transitive)
+ Addedansi-regex@5.0.16.1.0(transitive)
+ Addedansi-styles@6.2.1(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedcross-spawn@7.0.3(transitive)
+ Addedeastasianwidth@0.2.0(transitive)
+ Addedemoji-regex@8.0.09.2.2(transitive)
+ Addedentities@4.5.0(transitive)
+ Addedforeground-child@3.3.0(transitive)
+ Addedglob@10.4.5(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedisutf8@4.0.1(transitive)
+ Addedjackspeak@3.4.3(transitive)
+ Addedlilconfig@2.1.0(transitive)
+ Addedlru-cache@10.4.3(transitive)
+ Addedmarked@9.1.6(transitive)
+ Addedminimatch@9.0.5(transitive)
+ Addedminipass@7.1.2(transitive)
+ Addedpackage-json-from-dist@1.0.0(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpath-scurry@1.11.1(transitive)
+ Addedsecure-json-parse@2.7.0(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@4.1.0(transitive)
+ Addedstring-width@4.2.35.1.2(transitive)
+ Addedstrip-ansi@6.0.17.1.0(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedwrap-ansi@7.0.08.1.0(transitive)
+ Addedxml2js@0.6.2(transitive)
- Removedchalk@^4.1.2
- Removedcosmiconfig@^7.0.1
- Removedmarkdown-it@^12.2.0
- Removedparse-json@^5.2.0
- Removed@babel/code-frame@7.24.7(transitive)
- Removed@babel/helper-validator-identifier@7.24.7(transitive)
- Removed@babel/highlight@7.24.7(transitive)
- Removed@types/parse-json@4.0.2(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedargparse@2.0.1(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedcallsites@3.1.0(transitive)
- Removedchalk@2.4.24.1.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedcosmiconfig@7.1.0(transitive)
- Removedentities@2.1.03.0.1(transitive)
- Removederror-ex@1.3.2(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedglob@7.2.3(transitive)
- Removedhas-flag@3.0.04.0.0(transitive)
- Removedimport-fresh@3.3.0(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-arrayish@0.2.1(transitive)
- Removedisutf8@3.1.1(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedjson-parse-even-better-errors@2.3.1(transitive)
- Removedlines-and-columns@1.2.4(transitive)
- Removedlinkify-it@3.0.3(transitive)
- Removedmarkdown-it@12.3.2(transitive)
- Removedmdurl@1.0.1(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedonce@1.4.0(transitive)
- Removedparent-module@1.0.1(transitive)
- Removedparse-json@5.2.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpath-type@4.0.0(transitive)
- Removedresolve-from@4.0.0(transitive)
- Removedsupports-color@5.5.07.2.0(transitive)
- Removeduc.micro@1.0.6(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedxml2js@0.4.23(transitive)
- Removedyaml@1.10.2(transitive)
Updatedasync@^3.2.4
Updatedentities@^4.5.0
Updatedglob@^10.3.10
Updatedisutf8@^4.0.0
Updatedminimatch@^9.0.3
Updatednode-fetch@^2.7.0
Updatedxml2js@^0.6.2