diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index f6b9638..0000000 --- a/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules/ -coverage/ -tmp/ \ No newline at end of file diff --git a/.eslintrc b/.eslintrc index 4ab2c05..d6ed5dc 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,4 +1 @@ -{ - "extends": "hexo", - "root": true -} +const config = require("eslint-config-hexo"); module.exports = config; \ No newline at end of file diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..a13e60f --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,3 @@ +const config = require('eslint-config-hexo/eslint'); + +module.exports = config; diff --git a/lib/renderer.js b/lib/renderer.js index e16894b..91ec16e 100644 --- a/lib/renderer.js +++ b/lib/renderer.js @@ -89,7 +89,7 @@ const renderer = { try { out += encodeURL(href); - } catch (e) { + } catch { out += href; } diff --git a/package.json b/package.json index 63c9538..6954885 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Markdown renderer plugin for Hexo", "main": "index", "scripts": { - "eslint": "eslint .", + "eslint": "eslint --flag unstable_config_lookup_from_file lib/ test/ index.js", "test": "mocha test/index.js", "test-cov": "c8 --reporter=lcovonly npm run test" }, @@ -40,7 +40,7 @@ "c8": "^10.1.2", "chai": "^4.3.7", "eslint": "^9.17.0", - "eslint-config-hexo": "^5.0.0", + "eslint-config-hexo": "github:yoshinorin/eslint-config-hexo#chore/migrate-to-flatconfig", "hexo": "^7.1.1", "mocha": "^10.4.0" }, diff --git a/test/.eslintrc b/test/.eslintrc deleted file mode 100644 index fef0a05..0000000 --- a/test/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "hexo/test" -} diff --git a/test/eslint.config.js b/test/eslint.config.js new file mode 100644 index 0000000..4545a72 --- /dev/null +++ b/test/eslint.config.js @@ -0,0 +1,5 @@ +'use strict'; + +const config = require('eslint-config-hexo/test'); + +module.exports = config;