Skip to content

Commit

Permalink
Added eslint,lint-staged and Husky (#519)
Browse files Browse the repository at this point in the history
* updated privacy link (#413)

Co-authored-by: Cess <[email protected]>

* FIX: adds missing entries in .gitignore (#423)

adds .vscode in .gitignore
adds _SpecRunner.html in .gitignore

Co-authored-by: Emily Ashley <[email protected]>
Co-authored-by: Govind Goel <[email protected]>
Co-authored-by: Cess <[email protected]>

* added eslint, Husky and lint-staged

Co-authored-by: Kaira Hiwatari <[email protected]>
Co-authored-by: Cess <[email protected]>
Co-authored-by: Shreya Sharma <[email protected]>
Co-authored-by: Emily Ashley <[email protected]>
Co-authored-by: Govind Goel <[email protected]>
  • Loading branch information
6 people authored Jul 14, 2020
1 parent a228d06 commit 0daf8cb
Show file tree
Hide file tree
Showing 41 changed files with 18,455 additions and 16,671 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/*.js
28 changes: 28 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
'env': {
'browser': true,
'es6': true,
},
'extends': [
'google',
],
'globals': {
'Atomics': 'readonly',
'SharedArrayBuffer': 'readonly',
},
'parserOptions': {
'ecmaVersion': 11,
'sourceType': 'module',
},
'rules': {
'max-len': 0,
'no-var': 0,
'new-cap': 0,
'no-invalid-this': 0, // PublicLab.TagsModule
'require-jsdoc': 0, // PublicLab.TitleModule.Related.js
'guard-for-in': 0, // PublicLAb.Editor.js
'no-unused-vars': 0,
'quotes': 0,
'comma-dangle': 0
},
};
136 changes: 67 additions & 69 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,83 +1,81 @@
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-browserify');

grunt.loadNpmTasks('grunt-browserify');
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
options: {
livereload: true
},
source: {
files: [
'src/*.js',
'src/*/*.js',
'Gruntfile.js'
],
tasks: ['build:js']
}
},

watch: {
options : {
livereload: true
},
source: {
files: [
'src/*.js',
'src/*/*.js',
'Gruntfile.js'
],
tasks: [ 'build:js' ]
}
},

browserify: {
dist: {
src: [
'src/PublicLab.Editor.js'
],
dest: 'dist/PublicLab.Editor.js'
},
debug: {
options : {
browserifyOptions: {
debug: true
}
},
src: [
'src/PublicLab.Editor.js'
],
dest: 'dist/PublicLab.Editor.js'
}
browserify: {
dist: {
src: [
'src/PublicLab.Editor.js'
],
dest: 'dist/PublicLab.Editor.js'
},
debug: {
options: {
browserifyOptions: {
debug: true
}
},
src: [
'src/PublicLab.Editor.js'
],
dest: 'dist/PublicLab.Editor.js'
}
},

jasmine: {
publiclabeditor: {
src: 'dist/*.js',
options: {
specs: 'spec/javascripts/*spec.js',
vendor: [
'node_modules/jquery/dist/jquery.min.js',
'node_modules/bootstrap/dist/js/bootstrap.min.js',
'node_modules/blueimp-file-upload/js/vendor/jquery.ui.widget.js',
'node_modules/blueimp-file-upload/js/jquery.iframe-transport.js',
'node_modules/blueimp-file-upload/js/jquery.fileupload.js',
'node_modules/typeahead.js/dist/typeahead.jquery.js',
'node_modules/typeahead.js/dist/bloodhound.js',
'node_modules/bootstrap-tokenfield/dist/bootstrap-tokenfield.js',
'node_modules/jasmine-jquery/lib/jasmine-jquery.js',
'node_modules/jasmine-ajax/lib/mock-ajax.js',
'https://maps.googleapis.com/maps/api/js?libraries=places&language=en&key=AIzaSyDWgc7p4WWFsO3y0MTe50vF4l4NUPcPuwE',
'node_modules/leaflet-blurred-location/dist/Leaflet.BlurredLocation.js',
'node_modules/leaflet/dist/leaflet.js'
]
}
}
jasmine: {
publiclabeditor: {
src: 'dist/*.js',
options: {
specs: 'spec/javascripts/*spec.js',
vendor: [
'node_modules/jquery/dist/jquery.min.js',
'node_modules/bootstrap/dist/js/bootstrap.min.js',
'node_modules/blueimp-file-upload/js/vendor/jquery.ui.widget.js',
'node_modules/blueimp-file-upload/js/jquery.iframe-transport.js',
'node_modules/blueimp-file-upload/js/jquery.fileupload.js',
'node_modules/typeahead.js/dist/typeahead.jquery.js',
'node_modules/typeahead.js/dist/bloodhound.js',
'node_modules/bootstrap-tokenfield/dist/bootstrap-tokenfield.js',
'node_modules/jasmine-jquery/lib/jasmine-jquery.js',
'node_modules/jasmine-ajax/lib/mock-ajax.js',
'https://maps.googleapis.com/maps/api/js?libraries=places&language=en&key=AIzaSyDWgc7p4WWFsO3y0MTe50vF4l4NUPcPuwE',
'node_modules/leaflet-blurred-location/dist/Leaflet.BlurredLocation.js',
'node_modules/leaflet/dist/leaflet.js'
]
}
}
}

});

/* Default (development): Watch files and build on change. */
grunt.registerTask('default', ['watch' , 'jasmine']);
});

grunt.registerTask('build', [
'browserify:dist'
]);
/* Default (development): Watch files and build on change. */
grunt.registerTask('default', ['watch', 'jasmine']);

grunt.registerTask('debug', [
'browserify:debug'
]);
grunt.registerTask('build', [
'browserify:dist'
]);

grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.registerTask('debug', [
'browserify:debug'
]);

grunt.loadNpmTasks('grunt-contrib-jasmine');
};
Loading

0 comments on commit 0daf8cb

Please sign in to comment.