diff --git a/.jscsrc b/.jscsrc deleted file mode 100644 index 6cdb7d0..0000000 --- a/.jscsrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "excludeFiles": ["node_modules/**", "coverage/**", "tmp/**"], - "preset": "hexo" -} \ No newline at end of file diff --git a/.npmignore b/.npmignore index 4ab50d4..1ad8e47 100644 --- a/.npmignore +++ b/.npmignore @@ -11,4 +11,3 @@ appveyor.yml .npmignore package-lock.json yarn.lock -.jscsrc diff --git a/.travis.yml b/.travis.yml index 179eab4..b3d9c99 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,6 @@ node_js: script: - npm run eslint - - npm run jscs - npm run test-cov after_script: diff --git a/lib/generator.js b/lib/generator.js index 2be86cb..8af023c 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -4,14 +4,14 @@ var nunjucks = require('nunjucks'); var env = new nunjucks.Environment(); var pathFn = require('path'); var fs = require('fs'); -var gravatar = require('hexo/lib/plugins/helper/gravatar'); +var gravatar = require('hexo/lib/plugins/helper/gravatar'); // eslint-disable-line node/no-unpublished-require env.addFilter('uriencode', function(str) { return encodeURI(str); }); env.addFilter('noControlChars', function(str) { - return str.replace(/[\x00-\x1F\x7F]/g, ''); + return str.replace(/[\x00-\x1F\x7F]/g, ''); // eslint-disable-line no-control-regex }); var atomTmplSrc = pathFn.join(__dirname, '../atom.xml'); diff --git a/package.json b/package.json index 71657e7..30ae6dc 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,6 @@ "main": "index", "scripts": { "eslint": "eslint .", - "jscs": "jscs .", "test": "mocha test/index.js", "test-cov": "istanbul cover --print both _mocha -- test/index.js" }, @@ -39,12 +38,10 @@ "babel-eslint": "^9.0.0", "chai": "^4.2.0", "cheerio": "^0.22.0", - "eslint": "^2.4.0", - "eslint-config-hexo": "^1.0.4", + "eslint": "^5.13.0", + "eslint-config-hexo": "^3.0.0", "hexo": "^3.3.1", "istanbul": "^0.4.5", - "jscs": "^3.0.7", - "jscs-preset-hexo": "^1.0.1", "mocha": "^5.2.0" }, "engines": { diff --git a/test/index.js b/test/index.js index 30490e5..344963b 100644 --- a/test/index.js +++ b/test/index.js @@ -13,7 +13,7 @@ env.addFilter('uriencode', function(str) { }); env.addFilter('noControlChars', function(str) { - return str.replace(/[\x00-\x1F\x7F]/g, ''); + return str.replace(/[\x00-\x1F\x7F]/g, ''); // eslint-disable-line no-control-regex }); var atomTmplSrc = pathFn.join(__dirname, '../atom.xml'); @@ -33,10 +33,10 @@ describe('Feed generator', function() { var Post = hexo.model('Post'); var generator = require('../lib/generator').bind(hexo); - (require('../node_modules/hexo/lib/plugins/helper'))(hexo); + require('../node_modules/hexo/lib/plugins/helper')(hexo); - var posts; - var locals; + var posts, + locals; before(function() { return Post.insert([ @@ -113,7 +113,7 @@ describe('Feed generator', function() { var result = generator(locals); var $ = cheerio.load(result.data, {xmlMode: true}); - var description = $('content\\\:encoded').html() + var description = $('content\\:encoded').html() .replace(/^$/, '');