eslint-plugin-spellcheck
Advanced tools
Comparing version 0.0.17 to 0.0.19
@@ -0,0 +0,0 @@ |
{ | ||
"name": "eslint-plugin-spellcheck", | ||
"version": "0.0.17", | ||
"version": "0.0.19", | ||
"description": "ESLint rules to spell check js files", | ||
@@ -17,3 +17,3 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "gulp", | ||
"test": "nyc mocha", | ||
"lint": "eslint -c .eslintrc.json rules/*.js" | ||
@@ -30,7 +30,5 @@ }, | ||
"eslint": ">4.18.2", | ||
"gulp": "^4.0.2", | ||
"gulp-istanbul": "^1.1.3", | ||
"gulp-mocha": "^6.0.0", | ||
"istanbul": "^0.4.4", | ||
"mocha": "^6.1.4", | ||
"nyc": "^15.1.0", | ||
"shelljs": "^0.7.3", | ||
@@ -37,0 +35,0 @@ "shelljs-nodecli": "^0.1.1" |
@@ -42,2 +42,3 @@ # eslint-plugin-spellcheck | ||
"identifiers": true, | ||
"templates": true, | ||
"lang": "en_US", | ||
@@ -53,6 +54,6 @@ "skipWords": [ | ||
"http://[^s]*", | ||
"^[-\\w]+\/[-\\w\\.]+$" //For MIME Types | ||
"^[-\\w]+\/[-\\w\\.]+$" | ||
], | ||
"skipWordIfMatch": [ | ||
"^foobar.*$" // words that begin with foobar will not be checked | ||
"^foobar.*$" | ||
], | ||
@@ -89,2 +90,5 @@ "minLength": 3 | ||
"langDir": <<String>>, default: "" | ||
Language files directory path. By default uses the plugin directory. | ||
"skipWords": <<Array Of Strings>> default: [] | ||
@@ -91,0 +95,0 @@ Array of words that will not be checked. |
module.exports = { | ||
langDir: __dirname + '/utils/dicts', | ||
skipWords: [ | ||
@@ -3,0 +4,0 @@ // own names |
// Native modules | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
@@ -83,2 +84,6 @@ // 3rd party dependencies | ||
}, | ||
langDir: { | ||
type: 'string', | ||
default: defaultSettings.langDir | ||
}, | ||
skipWords: { | ||
@@ -123,2 +128,3 @@ type: 'array', | ||
var defaultOptions = { | ||
langDir: defaultSettings.langDir, | ||
comments: true, | ||
@@ -151,4 +157,4 @@ strings: true, | ||
dictionary = spell.parse({ | ||
aff: fs.readFileSync(__dirname + '/utils/dicts/' + language + '.aff'), | ||
dic: fs.readFileSync(__dirname + '/utils/dicts/' + language + '.dic') | ||
aff: fs.readFileSync(path.join(options.langDir, language + '.aff')), | ||
dic: fs.readFileSync(path.join(options.langDir, language + '.dic')) | ||
}); | ||
@@ -166,3 +172,3 @@ | ||
// Regular expression matches regexp metacharacters, and any special char | ||
var regexp = /(\\[sSwdDB0nfrtv])|\\[0-7][0-7][0-7]|\\x[0-9A-F][0-9A-F]|\\u[0-9A-F][0-9A-F][0-9A-F][0-9A-F]|[^0-9a-zA-Z ']/g, | ||
var regexp = /(\\[sSwdDB0nfrtv])|\\[0-7][0-7][0-7]|\\x[0-9A-F][0-9A-F]|\\u[0-9A-F][0-9A-F][0-9A-F][0-9A-F]|[^0-9a-zA-Z '’]/g, | ||
nodeWords = value.replace(regexp, ' ') | ||
@@ -169,0 +175,0 @@ .replace(/([A-Z])/g, ' $1').split(' '), |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
8
17
556
166
2420643