Skip to content

Commit 9bf3bc9

Browse files
committed
Update README
1 parent 09e52ec commit 9bf3bc9

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010

1111
$ npm install -D textlint textlint-rule-max-comma
1212
$ $(npm bin)/textlint --rule max-comma README.md
13-
# 11:0 error This sentence exceeds the maximum count of comma. Maximum is 3.
13+
# 11:0 error This sentence exceeds the maximum count of comma. Maximum is 4.
1414

1515
## Options
1616

1717
- `max`: maximum number of ","
18-
- Default: `3`
19-
- It means that report an error if the sentence include 4 or more `,`
18+
- Default: `4`
19+
- It means that report an error if the sentence include 5 or more `,`
2020

2121
Configure `"max"` value of the `.textlintrc` file.
2222

src/textlint-rule-max-comma.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function countOfComma(text) {
99
}
1010

1111
const defaultOptions = {
12-
// default: max comma count is 4
12+
// default: allowed command count
1313
max: 4
1414
};
1515
export default function (context, options = defaultOptions) {
@@ -27,7 +27,6 @@ export default function (context, options = defaultOptions) {
2727
sentences.forEach(sentence => {
2828
const source = new StringSource(sentence);
2929
const sentenceValue = source.toString();
30-
console.log(sentenceValue);
3130
const count = countOfComma(sentenceValue);
3231
if (count > maxComma) {
3332
const lastCommandIndex = sentenceValue.lastIndexOf(",");

test/textlint-rule-max-comma-test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ tester.run("no-todo", rule, {
88
valid: [
99
// no match
1010
"This is text.",
11-
// 3 is ok by default
11+
// 4 is ok by default
1212
"0, 1, 2, 3",
13+
"0, 1, 2, 3, 4",
1314
"This `sum(0,1,2,3,4,5,6,7,8,9,10)` is ok",
1415
{
1516
text: "0, 1, 2, 3, 4",

0 commit comments

Comments
 (0)