no-cliches
Advanced tools
Comparing version 0.2.2 to 0.3.0
@@ -1,2 +0,2 @@ | ||
const cliches = [ | ||
let cliches = [ | ||
'a chip off the old block', | ||
@@ -372,2 +372,3 @@ 'a clean slate', | ||
'like taking candy from a baby', | ||
'like the plague', | ||
'like there\'s no tomorrow', | ||
@@ -702,2 +703,4 @@ 'lion\'s share', | ||
// Replace a basic white-space with more-robust white-space matching for new lines, half-space etc. | ||
cliches = cliches.map(w => w.replace(/ /g, '[\\b\\s\\u200C]*')); | ||
const clicheRegex = new RegExp(`\\b(${cliches.join('|')})\\b`, 'gi'); | ||
@@ -704,0 +707,0 @@ const matcher = require('./matcher'); |
{ | ||
"name": "no-cliches", | ||
"version": "0.2.2", | ||
"version": "0.3.0", | ||
"description": "Find clichés in your writings", | ||
@@ -41,3 +41,2 @@ "main": "cliches.js", | ||
"devDependencies": { | ||
"jasmine-node": "^2.0.1", | ||
"eslint": "^5.12.0", | ||
@@ -47,4 +46,5 @@ "eslint-config-airbnb": "^17.1.0", | ||
"eslint-plugin-jsx-a11y": "^6.1.2", | ||
"eslint-plugin-react": "^7.12.3" | ||
"eslint-plugin-react": "^7.12.3", | ||
"jasmine-node": "^3.0.0" | ||
} | ||
} |
const cliches = require('../cliches'); | ||
const clichesInSentence = 'Writing specs puts me at loose ends.'; | ||
const clichesInSentenceWithFormatting = 'Writing specs puts me at loose\n ends.'; | ||
const goodSentence = 'The good dog jumps over the bad cat.'; | ||
@@ -22,2 +23,7 @@ | ||
}); | ||
it('should not have a problem with white-space formatting', () => { | ||
const results = cliches(clichesInSentenceWithFormatting); | ||
expect(results).toEqual([{ index: 22, offset: 16 }]); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21715
739