Skip to content

Commit

Permalink
Refactor code-style
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed May 25, 2022
1 parent bbac29d commit 5201df3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
* @property {string} lang
* @property {Record<string, number>} cuss
* @property {{singular: (word: string) => string, plural: (word: string) => string}} [pluralize]
* @property {string[]} [ignorePluralize]
* @property {string[]} [regular]
* @property {Array<string>} [ignorePluralize]
* @property {Array<string>} [regular]
*
* @typedef Options
* Configuration.
* @property {string[]} [ignore]
* @property {Array<string>} [ignore]
* Phrases *not* to warn about.
* @property {0|1|2} [sureness=0]
* Minimum *sureness* to warn about, see `cuss`.
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Uses [`cuss`][cuss] for sureness.

###### `options.ignore`

Phrases *not* to warn about (`Array.<string>`, default: `[]`).
Phrases *not* to warn about (`Array<string>`, default: `[]`).

###### `options.sureness`

Expand Down
2 changes: 1 addition & 1 deletion script/build-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const own = {}.hasOwnProperty
export default function table() {
return (tree) => {
headingRange(tree, 'list of rules', (start, _, end) => {
/** @type {TableContent[]} */
/** @type {Array<TableContent>} */
const rows = [
u('tableRow', [
u('tableCell', [u('text', 'id')]),
Expand Down
14 changes: 7 additions & 7 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ test('profanities', (t) => {
.process('Merde!')
.then((file) => {
t.deepEqual(
file.messages.map((d) => String(d)),
file.messages.map(String),
['1:1-1:6: Don’t use `Merde`, it’s profane'],
'should support other languages'
)
Expand All @@ -58,7 +58,7 @@ test('profanities', (t) => {
)
.then((file) => {
t.deepEqual(
file.messages.map((d) => String(d)),
file.messages.map(String),
[
'1:33-1:37: Be careful with `butt`, it’s profane in some cases',
'2:9-2:15: Don’t use `asshat`, it’s profane',
Expand All @@ -73,7 +73,7 @@ test('profanities', (t) => {
.process('He’s pretty set on beating your butt for sheriff.')
.then((file) => {
t.deepEqual(
file.messages.map((d) => String(d)),
file.messages.map(String),
[],
'should not warn for `ignore`d phrases'
)
Expand All @@ -84,7 +84,7 @@ test('profanities', (t) => {
.process('When he’ll freeze over, hell freezes over.')
.then((file) => {
t.deepEqual(
file.messages.map((d) => String(d)),
file.messages.map(String),
['1:25-1:29: Be careful with `hell`, it’s profane in some cases'],
'should correctly depend on apostrophes'
)
Expand All @@ -95,7 +95,7 @@ test('profanities', (t) => {
.process('slave slaves')
.then((file) => {
t.deepEqual(
file.messages.map((d) => String(d)),
file.messages.map(String),
[
'1:1-1:6: Don’t use `slave`, it’s profane',
'1:7-1:13: Don’t use `slaves`, it’s profane'
Expand All @@ -115,7 +115,7 @@ test('profanities', (t) => {
)
.then((file) => {
t.deepEqual(
file.messages.map((d) => String(d)),
file.messages.map(String),
[
'2:9-2:15: Don’t use `asshat`, it’s profane',
'3:34-3:40: Reconsider using `addict`, it may be profane'
Expand All @@ -129,7 +129,7 @@ test('profanities', (t) => {
.process(["who're", 'who’re', 'whore'].join('\n'))
.then((file) => {
t.deepEqual(
file.messages.map((d) => String(d)),
file.messages.map(String),
['3:1-3:6: Don’t use `whore`, it’s profane'],
'should not warn about `who are` contractions'
)
Expand Down

0 comments on commit 5201df3

Please sign in to comment.