Skip to content

Commit

Permalink
lint spelling of "non-empty" (#484)
Browse files Browse the repository at this point in the history
  • Loading branch information
bakkot authored Sep 20, 2022
1 parent 8d7c17f commit 34e14b8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lint/collect-spelling-diagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ const matchers = [
pattern: /\b[Nn]onnegative\b/gu,
message: 'prefer "non-negative"',
},
{
pattern: /[Nn]onempty/gu,
message: 'prefer "non-empty"',
},
{
pattern: /\b[Nn]onzero\b/gu,
message: 'prefer "non-zero"',
Expand Down
13 changes: 13 additions & 0 deletions test/lint-spelling.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,19 @@ describe('spelling', () => {
);
});

it('nonempty', async () => {
await assertLint(
positioned`
<p>a ${M}nonempty List</p>
`,
{
ruleId: 'spelling',
nodeType: 'html',
message: 'prefer "non-empty"',
}
);
});

it('nonzero', async () => {
await assertLint(
positioned`
Expand Down

0 comments on commit 34e14b8

Please sign in to comment.