Skip to content

Commit fec2e9e

Browse files
committed
Update README
1 parent c47a69f commit fec2e9e

File tree

2 files changed

+13
-57
lines changed

2 files changed

+13
-57
lines changed

README.md

+6-28
Original file line numberDiff line numberDiff line change
@@ -31,32 +31,10 @@ To install the tool and use it globally run:
3131
npm install -g @343dev/markdown-lint
3232
```
3333

34-
To install the tool into the project and setup pre-commit hook run:
34+
To install the tool into the project:
3535

3636
```bash
37-
npm install --dev husky lint-staged @343dev/markdown-lint
38-
```
39-
40-
## Project Setup
41-
42-
To automatically lint Markdown files on precommit you should setup `husky` and
43-
`lint-staged` to work with `markdown-lint` in your project’s package.json.
44-
45-
Example:
46-
47-
```json
48-
{
49-
"husky": {
50-
"hooks": {
51-
"pre-commit": "lint-staged"
52-
}
53-
},
54-
"lint-staged": {
55-
"*.md": [
56-
"markdown-lint --fix --typograph"
57-
]
58-
}
59-
}
37+
npm install --dev @343dev/markdown-lint
6038
```
6139

6240
## CLI Usage
@@ -120,13 +98,13 @@ module.exports = {
12098
// plugins for remark-lint
12199
plugins: [
122100
// print errors when there're lines longer that 120 characters
123-
[require('remark-lint-maximum-line-length'), 120],
101+
['remark-lint-maximum-line-length', 120],
124102

125103
// disable rule `no-inline-padding`
126-
[require('remark-lint-no-inline-padding'), false],
104+
['remark-lint-no-inline-padding', false],
127105

128106
// set `*` as the only allowed marker for unordered list
129-
[require('remark-lint-unordered-list-marker-style'), '*']
107+
['remark-lint-unordered-list-marker-style', '*']
130108
],
131109

132110
// settings for remark-stringify which is used when `--fix` is passed
@@ -138,7 +116,7 @@ module.exports = {
138116

139117
typograf: {
140118
// rules API — https://github.com/typograf/typograf/blob/dev/docs/api_rules.md
141-
// list of ruls — https://github.com/typograf/typograf/blob/dev/docs/RULES.en-US.md
119+
// list of rules — https://github.com/typograf/typograf/blob/dev/docs/RULES.en-US.md
142120
locale: ['ru', 'en-US'],
143121
enableRules: [],
144122
disableRules: [

README.ru.md

+7-29
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# @343dev/markdown-lint
22

33
<img align="right" width="192" height="159"
4-
alt="Аватар: Яркое градиентное лого Markdown со звёздочкой"
5-
src="./logo.png">
4+
alt="Аватар: Яркое градиентное лого Markdown со звёздочкой"
5+
src="./logo.png">
66

77
[![npm](https://img.shields.io/npm/v/@343dev/markdown-lint.svg)](https://www.npmjs.com/package/@343dev/markdown-lint)
88

@@ -31,32 +31,10 @@ JS, CSS и иные файлы проекта. Потому создали эт
3131
npm install -g @343dev/markdown-lint
3232
```
3333

34-
Для установки и настройки на pre-commit хук:
34+
Для установки в проект:
3535

3636
```bash
37-
npm install --dev husky lint-staged @343dev/markdown-lint
38-
```
39-
40-
## Настройка проекта
41-
42-
Для автоматической проверки файлов перед коммитом необходимо настроить `husky` и
43-
`lint-staged` на работу с `markdown-lint` в `package.json` вашего проекта.
44-
45-
Пример конфигурации:
46-
47-
```json
48-
{
49-
"husky": {
50-
"hooks": {
51-
"pre-commit": "lint-staged"
52-
}
53-
},
54-
"lint-staged": {
55-
"*.md": [
56-
"markdown-lint --fix --typograph"
57-
]
58-
}
59-
}
37+
npm install --dev @343dev/markdown-lint
6038
```
6139

6240
## Работа с CLI
@@ -121,13 +99,13 @@ module.exports = {
12199
// применяем настройки для remark-lint
122100
plugins: [
123101
// объявляем линтеру, что максимальная длина строки теперь равна 120 символам
124-
[require('remark-lint-maximum-line-length'), 120],
102+
['remark-lint-maximum-line-length', 120],
125103

126104
// отключаем правило `no-inline-padding`
127-
[require('remark-lint-no-inline-padding'), false],
105+
['remark-lint-no-inline-padding', false],
128106

129107
// объявляем линтеру, что мы теперь используем `*` как маркер списка
130-
[require('remark-lint-unordered-list-marker-style'), '*']
108+
['remark-lint-unordered-list-marker-style', '*']
131109
],
132110

133111
// remark-stringify обрабатывает тексты, когда `--fix` передан

0 commit comments

Comments
 (0)