Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,20 @@ describe('comment filtering', () => {

const messages = await lint(text);

assert.deepEqual(messages, [
'Incorrect usage of the term: “id”, use “ID” instead',
'Incorrect usage of the term: “id”, use “ID” instead',
]);
assert.deepEqual(messages, ['Incorrect term: “id”, use “ID” instead', 'Incorrect term: “id”, use “ID” instead']);
});

it('ignores violations for the rest of the file after an unmatched textlint-disable comment', async () => {
const text = ['We use the id field.', '', '<!-- textlint-disable -->', '', 'We use the id field again.'].join('\n');

const messages = await lint(text);

assert.deepEqual(messages, ['Incorrect usage of the term: “id”, use “ID” instead']);
assert.deepEqual(messages, ['Incorrect term: “id”, use “ID” instead']);
});

it('flags violations when no textlint-disable comment is present', async () => {
const messages = await lint('We use the id field.');

assert.deepEqual(messages, ['Incorrect usage of the term: “id”, use “ID” instead']);
assert.deepEqual(messages, ['Incorrect term: “id”, use “ID” instead']);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('terminology rule', () => {
it('flags a term from the preset default list', async () => {
const messages = await lint(true, 'We use the id field.');

assert.deepEqual(messages, ['Incorrect usage of the term: “id”, use “ID” instead']);
assert.deepEqual(messages, ['Incorrect term: “id”, use “ID” instead']);
});

it("does not flag terms from textlint-rule-terminology's own defaults", async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/textlint-rule-preset-alma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"textlint-rule-apostrophe": "^2.0.0",
"textlint-rule-common-misspellings": "^1.0.1",
"textlint-rule-stop-words": "^3.0.0",
"textlint-rule-terminology": "^3.0.0",
"textlint-rule-terminology": "^5.0.0",
"textlint-rule-title-case": "^3.0.0",
"textlint-rule-write-good": "^2.0.0"
},
Expand Down
1 change: 1 addition & 0 deletions packages/textlint-rule-preset-alma/rules/terminology.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line import/no-unresolved -- v5 only declares `exports`, which [email protected] can't read; Node resolves it fine at runtime.
import textlintRuleTerminology from 'textlint-rule-terminology';

const defaultOptions = {
Expand Down
37 changes: 27 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ __metadata:
textlint-rule-apostrophe: "npm:^2.0.0"
textlint-rule-common-misspellings: "npm:^1.0.1"
textlint-rule-stop-words: "npm:^3.0.0"
textlint-rule-terminology: "npm:^3.0.0"
textlint-rule-terminology: "npm:^5.0.0"
textlint-rule-title-case: "npm:^3.0.0"
textlint-rule-write-good: "npm:^2.0.0"
peerDependencies:
Expand Down Expand Up @@ -3147,7 +3147,7 @@ __metadata:
languageName: node
linkType: hard

"@textlint/ast-node-types@npm:15.8.0":
"@textlint/ast-node-types@npm:15.8.0, @textlint/ast-node-types@npm:^15.2.1":
version: 15.8.0
resolution: "@textlint/ast-node-types@npm:15.8.0"
checksum: 10/793a7da8aacb8b9204afdb8e66179e591fa4a5593bbdff5ea80332ab2bc0f4bb81663855c2c7017f01d1e9ef3a0cc54c67040daf6e6c019c58f39fb007296c0e
Expand Down Expand Up @@ -14460,13 +14460,20 @@ __metadata:
languageName: node
linkType: hard

"strip-json-comments@npm:^3.0.1, strip-json-comments@npm:^3.1.1":
"strip-json-comments@npm:^3.1.1":
version: 3.1.1
resolution: "strip-json-comments@npm:3.1.1"
checksum: 10/492f73e27268f9b1c122733f28ecb0e7e8d8a531a6662efbd08e22cccb3f9475e90a1b82cab06a392f6afae6d2de636f977e231296400d0ec5304ba70f166443
languageName: node
linkType: hard

"strip-json-comments@npm:^5.0.3":
version: 5.0.3
resolution: "strip-json-comments@npm:5.0.3"
checksum: 10/3ccbf26f278220f785e4b71f8a719a6a063d72558cc63cb450924254af258a4f4c008b8c9b055373a680dc7bd525be9e543ad742c177f8a7667e0b726258e0e4
languageName: node
linkType: hard

"structured-source@npm:^4.0.0":
version: 4.0.0
resolution: "structured-source@npm:4.0.0"
Expand Down Expand Up @@ -14796,6 +14803,17 @@ __metadata:
languageName: node
linkType: hard

"textlint-rule-helper@npm:^2.5.0":
version: 2.5.0
resolution: "textlint-rule-helper@npm:2.5.0"
dependencies:
"@textlint/ast-node-types": "npm:^15.2.1"
structured-source: "npm:^4.0.0"
unist-util-visit: "npm:^2.0.3"
checksum: 10/3630d4088c90bff4bd4d9797b8c03df048f2e58912b94bbd791f0a88a639ff82cdd0e8daea1d994ae8ead390b709b4ec0331a737ecb88ee02ee4fd5c56b5903c
languageName: node
linkType: hard

"textlint-rule-stop-words@npm:^3.0.0":
version: 3.0.2
resolution: "textlint-rule-stop-words@npm:3.0.2"
Expand All @@ -14807,14 +14825,13 @@ __metadata:
languageName: node
linkType: hard

"textlint-rule-terminology@npm:^3.0.0":
version: 3.0.5
resolution: "textlint-rule-terminology@npm:3.0.5"
"textlint-rule-terminology@npm:^5.0.0":
version: 5.2.16
resolution: "textlint-rule-terminology@npm:5.2.16"
dependencies:
lodash: "npm:^4.17.15"
strip-json-comments: "npm:^3.0.1"
textlint-rule-helper: "npm:^2.1.1"
checksum: 10/728ce2998e5cbbe069f41bfce9cb00203d656b3668027676859b64904e45afaab99572a4f00bd05960d059a86d4f3c6ade97a3f7ff88193af13b1fe4806ee78c
strip-json-comments: "npm:^5.0.3"
textlint-rule-helper: "npm:^2.5.0"
checksum: 10/ab360380c6f398f6d984df24617edb6a2a179f0eb9a03a45f571e2df97cbc1cf326a1e41ddc8fc2ef54e534082ef5c3928b82e0513ef1e4a1fb59f5a51160131
languageName: node
linkType: hard

Expand Down