diff options
author | Thibaud Lepretre <thibaud.lepretre@gmail.com> | 2019-07-01 16:37:50 +0300 |
---|---|---|
committer | Thibaud Lepretre <thibaud.lepretre@gmail.com> | 2019-07-01 16:37:50 +0300 |
commit | d24365653002414f37d75fc6692ad8b135f3844b (patch) | |
tree | 927f907a5947da6c50dd69e0da446f8c0ff574fb | |
parent | ad1232a989f3f0a26db549f721a3dd8a81121765 (diff) |
Fix eslint error
-rw-r--r-- | .eslintrc | 23 | ||||
-rwxr-xr-x | src/js/about.js | 2 | ||||
-rwxr-xr-x | tasks/config/cssmin.js | 2 | ||||
-rwxr-xr-x | tasks/config/sails-linker.js | 8 | ||||
-rwxr-xr-x | tasks/config/uglify.js | 2 |
5 files changed, 28 insertions, 9 deletions
@@ -1,4 +1,7 @@ { + "parserOptions": { + "ecmaVersion": 6 + }, "extends": "google", "rules": { "comma-dangle": [2,"never"], @@ -10,6 +13,22 @@ "no-trailing-spaces": [2, {"skipBlankLines": true }], "eqeqeq":[1], "max-len": [1, 100, 4, {"ignoreUrls": true}], - "no-useless-escape":0 + "no-useless-escape":0, + "quote-props": [ + 2, + "as-needed" + ], + "no-var": "off", + "no-invalid-this": "off", + "indent": [ + "error", + 2, + { + "FunctionDeclaration": { + "body": 1, + "parameters": 2 + } + } + ] } -}
\ No newline at end of file +} diff --git a/src/js/about.js b/src/js/about.js index ba7c8ae..4e526da 100755 --- a/src/js/about.js +++ b/src/js/about.js @@ -8,7 +8,7 @@ * @constructor */ var AboutCard = function() { - this.$openBtn = $("#sidebar, #header").find("a[href*='#about']"); + this.$openBtn = $('#sidebar, #header').find('a[href*=\'#about\']'); this.$closeBtn = $('#about-btn-close'); this.$blog = $('#blog'); this.$about = $('#about'); diff --git a/tasks/config/cssmin.js b/tasks/config/cssmin.js index 9ebe6ec..4037084 100755 --- a/tasks/config/cssmin.js +++ b/tasks/config/cssmin.js @@ -9,7 +9,7 @@ module.exports = function(grunt) { cwd: 'static/css', src: ['style.css'], dest: 'static/css', - ext: '-' + nanoid(60).toLocaleLowerCase().replace(/[_-]+/g, "") + '.min.css' + ext: '-' + nanoid(60).toLocaleLowerCase().replace(/[_-]+/g, '') + '.min.css' }] } }); diff --git a/tasks/config/sails-linker.js b/tasks/config/sails-linker.js index 21899d9..757ee25 100755 --- a/tasks/config/sails-linker.js +++ b/tasks/config/sails-linker.js @@ -8,7 +8,7 @@ module.exports = function(grunt) { endTag: '<!--SCRIPTS END-->', fileRef: function(filepath) { var tmpl = '<script src="%s"></script>'; - return util.format(tmpl, filepath.substring(filepath.indexOf("/"))); + return util.format(tmpl, filepath.substring(filepath.indexOf('/'))); }, appRoot: 'src/' }, @@ -22,7 +22,7 @@ module.exports = function(grunt) { endTag: '<!--STYLES END-->', fileRef: function(filepath) { var tmpl = '<link rel="stylesheet" href="%s" />'; - return util.format(tmpl, filepath.substring(filepath.indexOf("/"))); + return util.format(tmpl, filepath.substring(filepath.indexOf('/'))); }, appRoot: 'src/' }, @@ -36,7 +36,7 @@ module.exports = function(grunt) { endTag: '<!--SCRIPTS END-->', fileRef: function(filepath) { var tmpl = '<script src="%s"></script>'; - return util.format(tmpl, filepath.substring(filepath.indexOf("/"))); + return util.format(tmpl, filepath.substring(filepath.indexOf('/'))); }, appRoot: 'src/' }, @@ -50,7 +50,7 @@ module.exports = function(grunt) { endTag: '<!--STYLES END-->', fileRef: function(filepath) { var tmpl = '<link rel="stylesheet" href="%s" />'; - return util.format(tmpl, filepath.substring(filepath.indexOf("/"))); + return util.format(tmpl, filepath.substring(filepath.indexOf('/'))); }, appRoot: 'src/' }, diff --git a/tasks/config/uglify.js b/tasks/config/uglify.js index 44d4baa..3783421 100755 --- a/tasks/config/uglify.js +++ b/tasks/config/uglify.js @@ -2,7 +2,7 @@ var nanoid = require('nanoid'); module.exports = function(grunt) { var website = {}; - var token = nanoid(60).toLocaleLowerCase().replace(/[_-]+/g, ""); + var token = nanoid(60).toLocaleLowerCase().replace(/[_-]+/g, ''); website['static/js/script-' + token + '.min.js'] = ['static/js/script.js']; grunt.config.set('uglify', { // Minify `script.js` file into `script.min.js` |