summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Wernick <justin@worthe-it.co.za>2023-06-06 23:06:11 +0200
committerJustin Wernick <justin@worthe-it.co.za>2023-06-06 23:06:11 +0200
commit9f10668a88df2255fc1494c38846a09a9c516b64 (patch)
tree1dae64d65fb6989128039b26d2f180666cabeafd
parente0b1e3df773c8b60d523a8feac6f7242e0f70d88 (diff)
Switched jshint to eslint
This happened to find an error in the one test. Oops. Fix #8
-rw-r--r--.eslintrc.json14
-rw-r--r--package.json4
-rw-r--r--test/test.js2
3 files changed, 17 insertions, 3 deletions
diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644
index 0000000..dfb64d0
--- /dev/null
+++ b/.eslintrc.json
@@ -0,0 +1,14 @@
+{
+ "env": {
+ "browser": true,
+ "commonjs": true,
+ "es2021": true,
+ "amd": true
+ },
+ "extends": "eslint:recommended",
+ "parserOptions": {
+ "ecmaVersion": "latest"
+ },
+ "rules": {
+ }
+}
diff --git a/package.json b/package.json
index 0237bc0..6550f3e 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
"description": "A library for parsing and validating South African ID Numbers.",
"main": "south-african-id-parser.js",
"scripts": {
- "pretest": "jshint **/*.js",
+ "pretest": "eslint ./",
"test": "mocha"
},
"keywords": [
@@ -29,7 +29,7 @@
},
"devDependencies": {
"chai": "^4.3.7",
- "jshint": "^2.13.6",
+ "eslint": "^8.42.0",
"mocha": "^10.2.0"
}
}
diff --git a/test/test.js b/test/test.js
index 83980b1..7fdf6d7 100644
--- a/test/test.js
+++ b/test/test.js
@@ -79,7 +79,7 @@ describe('South African ID Number Parsing', function () {
it('should correctly parse invalid ID numbers', function() {
invalidIdNumbers.forEach(function(invalidIdNumber) {
- var info = saIdParser.parse(invalidIdNumbers.idNumber);
+ var info = saIdParser.parse(invalidIdNumber.idNumber);
expect(info).to.deep.equal({isValid: false});
});
});