1.0.3 • Published 6 years ago
commonform-critique v1.0.3
commonform-critique
suggest improvements to Common Forms
var critique = require('commonform-critique')
var assert = require('assert')
assert.deepStrictEqual(
critique({ content: ['to wit'] })[0],
[
{
message: 'The phrase "to wit" is archaic.',
level: 'info',
path: ['content', 0],
source: 'commonform-archaic',
url: null
}
][0]
)
assert.deepStrictEqual(
critique({ content: ['to witness'] }),
[]
)
assert.deepStrictEqual(
critique({ content: ['in order to'] }),
[
{
message: 'Replace "in order to" with "to".',
level: 'info',
path: ['content', 0],
source: 'commonform-critique',
url: null
}
]
)
assert.deepStrictEqual(
critique({ content: ['this /that'] }),
[
{
message: 'Remove the space before "/".',
level: 'info',
path: ['content', 0],
source: 'commonform-critique',
url: null
}
]
)
assert.deepStrictEqual(
critique({ content: ['this/ that'] }),
[
{
message: 'Remove the space after "/".',
level: 'info',
path: ['content', 0],
source: 'commonform-critique',
url: null
}
]
)
assert.deepStrictEqual(
critique({ content: [{ form: { content: ['this / that'] } }] }),
[
{
message: 'Remove the space before "/".',
level: 'info',
path: ['content', 0, 'form', 'content', 0],
source: 'commonform-critique',
url: null
},
{
message: 'Remove the space after "/".',
level: 'info',
path: ['content', 0, 'form', 'content', 0],
source: 'commonform-critique',
url: null
}
]
)
assert.deepStrictEqual(
critique({ content: ['Give me two (2) of those and four (4) of the other one.'] }),
[
{
message: '"two (2)" repeats a written number and numeral, which is redundant and error-prone',
level: 'info',
path: ['content', 0],
source: 'doubleplus-numbers',
url: null
},
{
message: '"four (4)" repeats a written number and numeral, which is redundant and error-prone',
level: 'info',
path: ['content', 0],
source: 'doubleplus-numbers',
url: null
}
]
)
assert.deepStrictEqual(
critique({ content: ['Do not use any silly words whatsoever.'] }),
[
{
message: (
'The phrase "whatsoever" should as a general matter be absent from your contracts.' +
' See MSCD appendix 2, pages 454-455.'
),
level: 'info',
path: ['content', 0],
source: 'commonform-mscd',
url: null
}
]
)
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago
0.8.1
10 years ago
0.8.0
10 years ago
0.7.0
10 years ago
0.6.1
10 years ago
0.6.0
10 years ago
0.5.8
10 years ago
0.5.7
10 years ago
0.5.6
10 years ago
0.5.5
10 years ago
0.5.4
10 years ago
0.5.3
10 years ago
0.5.2
10 years ago
0.5.1
10 years ago
0.5.0
10 years ago