diff --git a/.github/workflows/test.yaml b/.github/workflows/js.yaml
similarity index 51%
rename from .github/workflows/test.yaml
rename to .github/workflows/js.yaml
index 36d847a..4cbc056 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/js.yaml
@@ -1,10 +1,10 @@
-name: test
+name: js
on:
pull_request:
push:
branches: [master]
jobs:
- js:
+ test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
@@ -20,3 +20,19 @@ jobs:
run: npm ci
- name: Test JavaScript
run: npm test
+ lint:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+ - name: Read .nvmrc
+ run: echo ::set-output name=NVMRC::$(cat .nvmrc)
+ id: nvm
+ - name: Use Node.js ${{ steps.nvm.outputs.NVMRC }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: '${{ steps.nvm.outputs.NVMRC }}'
+ - name: Install dependencies
+ run: npm ci
+ - name: Lint JavaScript
+ run: npx gulp js:lint
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..eff7139
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml
new file mode 100644
index 0000000..d23208f
--- /dev/null
+++ b/.idea/jsLibraryMappings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/jsLinters/jshint.xml b/.idea/jsLinters/jshint.xml
new file mode 100644
index 0000000..2023131
--- /dev/null
+++ b/.idea/jsLinters/jshint.xml
@@ -0,0 +1,85 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 0000000..cfa8992
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,3 @@
+{
+ "node": true
+}
diff --git a/dist/multiselect.js b/dist/multiselect.js
index 18e2ff6..56c67fb 100644
--- a/dist/multiselect.js
+++ b/dist/multiselect.js
@@ -515,7 +515,7 @@
/**
* @name AmoMultiselectFactory#_optionsRegularExpression
- *
+ *
* @description
* Options attribute value regular expression
*
diff --git a/gulpfile.js b/gulpfile.js
index 36daac5..125ed28 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -51,7 +51,6 @@ gulp.task('all', 'Build application', [
'css:app',
'js:app',
'js:libs',
- 'js:lint'
]);
gulp.task('dist', 'Build multiselect', [
@@ -108,9 +107,13 @@ gulp.task('js:libs', 'Compile third party JavaScript', function() {
});
gulp.task('js:lint', 'Run JSHint to check for JavaScript code quality', function() {
- gulp.src(js.src.app)
+ gulp.src(js.src.app.concat([
+ '*.js',
+ 'tests/**/*.js'
+ ]))
.pipe(gulpJshint())
- .pipe(gulpJshint.reporter('default'));
+ .pipe(gulpJshint.reporter('default'))
+ .pipe(gulpJshint.reporter('fail'));
});
gulp.task('serve', 'Run a local webserver', function() {
diff --git a/karma.conf.js b/karma.conf.js
index 3e0d9a2..00a3fad 100644
--- a/karma.conf.js
+++ b/karma.conf.js
@@ -15,5 +15,5 @@ module.exports = function(config) {
autoWatch: true,
browsers: ['ChromeHeadless'],
singleRun: false
- })
-}
+ });
+};
diff --git a/package-lock.json b/package-lock.json
index 5bbc458..48b34ba 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -3615,25 +3615,25 @@
"dev": true
},
"jshint": {
- "version": "2.11.1",
- "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.11.1.tgz",
- "integrity": "sha512-WXWePB8ssAH3DlD05IoqolsY6arhbll/1+i2JkRPpihQAuiNaR/gSt8VKIcxpV5m6XChP0hCwESQUqpuQMA8Tg==",
+ "version": "2.11.2",
+ "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.11.2.tgz",
+ "integrity": "sha512-3JfkI/3igmLYKVTEjglsaeUktOqZfgRM+nLL0AItmX5CV+PUOcVGmLBhhDjJ7pLPXsKYIkzMqFkN7avABmrj3g==",
"dev": true,
"requires": {
"cli": "~1.0.0",
"console-browserify": "1.1.x",
"exit": "0.1.x",
"htmlparser2": "3.8.x",
- "lodash": "~4.17.11",
+ "lodash": "~4.17.19",
"minimatch": "~3.0.2",
"shelljs": "0.3.x",
"strip-json-comments": "1.0.x"
},
"dependencies": {
"lodash": {
- "version": "4.17.15",
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
- "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
+ "version": "4.17.19",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
+ "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
"dev": true
}
}
diff --git a/src/lib/multiselect.factory.js b/src/lib/multiselect.factory.js
index 6bd8bc5..61936d9 100644
--- a/src/lib/multiselect.factory.js
+++ b/src/lib/multiselect.factory.js
@@ -15,7 +15,7 @@
/**
* @name AmoMultiselectFactory#_optionsRegularExpression
- *
+ *
* @description
* Options attribute value regular expression
*
diff --git a/tests/lib/multiselect.directive.spec.js b/tests/lib/multiselect.directive.spec.js
index 59b9bea..0b9966a 100644
--- a/tests/lib/multiselect.directive.spec.js
+++ b/tests/lib/multiselect.directive.spec.js
@@ -69,11 +69,11 @@ describe('amoMultiselect', function() {
amoMultiselectFactoryInstanceSpy.getOptionsExpression.and.returnValue('options');
amoMultiselectFactoryInstanceSpy.getLabel.and.callFake(function(option) {
- return 'LABEL ' + option
+ return 'LABEL ' + option;
});
amoMultiselectFactoryInstanceSpy.getValue.and.callFake(function(option) {
- return 'VALUE ' + option
+ return 'VALUE ' + option;
});
});
diff --git a/tests/lib/multiselect.factory.spec.js b/tests/lib/multiselect.factory.spec.js
index 736302b..2a661dd 100644
--- a/tests/lib/multiselect.factory.spec.js
+++ b/tests/lib/multiselect.factory.spec.js
@@ -314,7 +314,7 @@ describe('AmoMultiselectFactory', function() {
expect(result).toEqual({
key: 2,
group: 'A'
- })
+ });
});
});
@@ -327,7 +327,7 @@ describe('AmoMultiselectFactory', function() {
expect(result).toEqual({
key: 1,
group: 'B'
- })
+ });
});
});
@@ -340,7 +340,7 @@ describe('AmoMultiselectFactory', function() {
expect(result).toEqual({
key: 3,
group: 'B'
- })
+ });
});
});
});