Socket
Socket
Sign inDemoInstall

yaspeller

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yaspeller - npm Package Compare versions

Comparing version 7.2.1 to 10.0.0

19

CHANGELOG.md
# Changelog
## v10.0.0
- Update major `yandex-speller` package.
- Remove unsupported options of new API Yandex Speller: `flagLatin`, `ignoreLatin`, `byWords`, `ignoreRomanNumerals` and `ignoreUppercase`.
## 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 +23,0 @@ - --ignore-tags Not work properly in Markdown files with HTML #176

4

lib/cli/index.js
'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);

@@ -12,11 +12,6 @@ 'use strict';

const apiOptions = [
['byWords', 'do not use a dictionary environment (context) during the scan. This is useful in cases where the service is transmitted to the input of a list of individual words'],
['findRepeatWords', 'highlight repetitions of words, consecutive. For example, "I flew to to to Cyprus"'],
['flagLatin', 'celebrate words, written in Latin, as erroneous'],
['ignoreCapitalization', 'ignore the incorrect use of UPPERCASE / lowercase letters, for example, in the word "moscow"'],
['ignoreDigits', 'ignore words with numbers, such as "avp17h4534"'],
['ignoreLatin', 'ignore words, written in Latin, for example, "madrid"'],
['ignoreRomanNumerals', 'ignore Roman numerals ("I, II, III, ...")'],
['ignoreUrls', 'ignore Internet addresses, email addresses and filenames'],
['ignoreUppercase', 'ignore words written in capital letters']
['ignoreUrls', 'ignore Internet addresses, email addresses and filenames']
];

@@ -34,3 +29,3 @@

.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)

@@ -37,0 +32,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,

@@ -9,5 +9,3 @@ {

"checkYo": { "type": "boolean" },
"byWords": { "type": "boolean" },
"findRepeatWords": { "type": "boolean" },
"flagLatin": { "type": "boolean" },
"ignoreTags": { "type": "array" },

@@ -17,7 +15,4 @@ "ignoreText": { "type": "array" },

"ignoreDigits": { "type": "boolean" },
"ignoreLatin": { "type": "boolean" },
"ignoreRomanNumerals": { "type": "boolean" },
"ignoreUppercase": { "type": "boolean" },
"ignoreUrls": { "type": "boolean" },
"maxRequests": { "type": "number" }
"maxRequests": { "type": "number" }
}
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": "10.0.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.5",
"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": "^10.0.0",
"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",
"yandex-speller": "^4.1.0"
"xml2js": "^0.6.2",
"yandex-speller": "^6.0.0"
},
"devDependencies": {
"chai": "^4.3.4",
"eslint": "^8.1.0",
"mocha": "^9.1.3",
"chai": "^4.3.10",
"eslint": "^8.53.0",
"mocha": "^10.2.0",
"nyc": "^15.1.0",
"sinon": "^11.1.2"
"sinon": "^17.0.1"
},
"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.

@@ -231,5 +235,3 @@

| `checkYo` | `Boolean` | [`--check-yo`](#--check-yo) |
| `byWords` | `Boolean` | [`--by-words`](#--by-words) |
| `findRepeatWords` | `Boolean` | [`--find-repeat-words`](#--find-repeat-words) |
| `flagLatin` | `Boolean` | [`--flag-latin`](#--flag-latin) |
| `ignoreTags` | `Array` | [`--ignore-tags`](#--ignore-tags-tags) |

@@ -239,4 +241,3 @@ | `ignoreText` | `Array` | [`--ignore-text`](#--ignore-text-regexp) |

| `ignoreDigits` | `Boolean` | [`--ignore-digits`](#--ignore-digits) |
| `ignoreLatin` | `Boolean` | [`--ignore-latin`](#--ignore-latin) |
| `ignoreRomanNumerals` | `Boolean` | [`--ignore-roman-numerals`](#--ignore-roman-numerals) |
(#--ignore-roman-numerals) |
| `ignoreUppercase` | `Boolean` | [`--ignore-uppercase`](#--ignore-uppercase) |

@@ -243,0 +244,0 @@ | `ignoreUrls` | `Boolean` | [`--ignore-urls`](#--ignore-urls) |

@@ -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`
Консольный вывод без цвета.

@@ -222,5 +226,3 @@

| `checkYo` | `Boolean` | [`--check-yo`](#--check-yo) |
| `byWords` | `Boolean` | [`--by-words`](#--by-words) |
| `findRepeatWords` | `Boolean` | [`--find-repeat-words`](#--find-repeat-words) |
| `flagLatin` | `Boolean` | [`--flag-latin`](#--flag-latin) |
| `ignoreTags` | `Array` | [`--ignore-tags`](#--ignore-tags-tags) |

@@ -230,5 +232,2 @@ | `ignoreText` | `Array` | [`--ignore-text`](#--ignore-text-regexp) |

| `ignoreDigits` | `Boolean` | [`--ignore-digits`](#--ignore-digits) |
| `ignoreLatin` | `Boolean` | [`--ignore-latin`](#--ignore-latin) |
| `ignoreRomanNumerals` | `Boolean` | [`--ignore-roman-numerals`](#--ignore-roman-numerals) |
| `ignoreUppercase` | `Boolean` | [`--ignore-uppercase`](#--ignore-uppercase) |
| `ignoreUrls` | `Boolean` | [`--ignore-urls`](#--ignore-urls) |

@@ -235,0 +234,0 @@ | `maxRequests` | `Number` | [`--max-requests`](#--max-requests-value) |

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc