diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..eb8204b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "eslint.experimental.useFlatConfig": true +} diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..449a584 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,7 @@ +// import lvjiaxuan from '@lvjiaxuan/eslint-plugin/flat' + +// /** @type {import('eslint').Linter.FlatConfig} */ +// export default lvjiaxuan.configs.recommended + +const lvjiaxuan = require('@lvjiaxuan/eslint-plugin/flat') +module.exports = lvjiaxuan.configs.recommended diff --git a/package-lock.json b/package-lock.json index 96b8340..3af7012 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,22 +1,22 @@ { "name": "vscode-eslint-disable", - "version": "0.2.1", + "version": "0.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "vscode-eslint-disable", - "version": "0.2.1", + "version": "0.3.0", "license": "MIT", "dependencies": { "vscode-languageserver": "^8.1.0" }, "devDependencies": { - "@lvjiaxuan/eslint-plugin": "^0.8.3", + "@lvjiaxuan/eslint-plugin": "^0.10.1", "@types/eslint": "^8.21.1", - "@types/node": "^18.14.6", + "@types/node": "^18.15.0", "@types/vscode": "1.60.0", - "eslint": "^8.35.0", + "eslint": "^8.36.0", "tsup": "^6.6.3", "typescript": "^4.9.5" }, @@ -376,15 +376,39 @@ "node": ">=12" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.2.0", + "resolved": "https://registry.npmmirror.com/@eslint-community/eslint-utils/-/eslint-utils-4.2.0.tgz", + "integrity": "sha512-gB8T4H4DEfX2IV9zGDJPOBgP1e/DbfCPDTtEqUMckpvzS1OYtva8JdFYBqMwYk7xAQ429WGF/UPqn8uQ//h2vQ==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.4.0", + "resolved": "https://registry.npmmirror.com/@eslint-community/regexpp/-/regexpp-4.4.0.tgz", + "integrity": "sha512-A9983Q0LnDGdLPjxyXQ00sbV+K+O+ko2Dr+CZigbHWtX9pNfxlaBkMR8X1CztI73zuEyEBXTVjx7CE+/VSwDiQ==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, "node_modules/@eslint/eslintrc": { - "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/@eslint/eslintrc/-/eslintrc-2.0.0.tgz", - "integrity": "sha512-fluIaaV+GyV24CCu/ggiHdV+j4RNh85yQnAYS/G2mZODZgGmmlrgCydjUcV3YvxCm9x8nMAfThsqTni4KiXT4A==", + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/@eslint/eslintrc/-/eslintrc-2.0.1.tgz", + "integrity": "sha512-eFRmABvW2E5Ho6f5fHLqgena46rOj7r7OKHYfLElqcBfGFHHpjBhivyi5+jOEQuSpdc/1phIZJlbC2te+tZNIw==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.4.0", + "espree": "^9.5.0", "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", @@ -397,9 +421,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.35.0", - "resolved": "https://registry.npmmirror.com/@eslint/js/-/js-8.35.0.tgz", - "integrity": "sha512-JXdzbRiWclLVoD8sNUjR443VVlYqiYmDVT6rGUEIEHU5YJW0gaVZwV2xgM7D4arkvASqD0IlLUVjHiFuxaftRw==", + "version": "8.36.0", + "resolved": "https://registry.npmmirror.com/@eslint/js/-/js-8.36.0.tgz", + "integrity": "sha512-lxJ9R5ygVm8ZWgYdUweoq5ownDlJ4upvoWmO4eLxBYHdMo+vZ/Rx0EN6MbKWDJOSUGrqJy2Gt+Dyv/VKml0fjg==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -435,12 +459,12 @@ "dev": true }, "node_modules/@lvjiaxuan/eslint-config": { - "version": "0.8.3", - "resolved": "https://registry.npmmirror.com/@lvjiaxuan/eslint-config/-/eslint-config-0.8.3.tgz", - "integrity": "sha512-FTdGFKMnAoICckMa+89VGqinqZtSs3n3rMi2eZljl1NxxXVX0L1vnOFB5/KMI4URf4AQyBb7mYPQZnjw4SZLZQ==", + "version": "0.10.1", + "resolved": "https://registry.npmmirror.com/@lvjiaxuan/eslint-config/-/eslint-config-0.10.1.tgz", + "integrity": "sha512-Y89ldRVndHav+Qm05VjH6+vu3DGs4k5XhE198M+kzGVFPEtcmbeLYeVVAbDC+iYgV7Thh/nFmaiGZQBxyDD57Q==", "dev": true, "dependencies": { - "@lvjiaxuan/eslint-config-vue": "^0.8.3" + "@lvjiaxuan/eslint-config-vue": "^0.10.1" }, "bin": { "eslint-config": "bin/add.mjs" @@ -450,33 +474,33 @@ } }, "node_modules/@lvjiaxuan/eslint-config-js": { - "version": "0.8.3", - "resolved": "https://registry.npmmirror.com/@lvjiaxuan/eslint-config-js/-/eslint-config-js-0.8.3.tgz", - "integrity": "sha512-jXiFaxnhlik2sSZdwUYAcXKl02M8mJ93DfcoFc2SH32W209FB11yqY4HCP296jEf3bNztqrYozY7Ehd/H5FaDA==", + "version": "0.10.1", + "resolved": "https://registry.npmmirror.com/@lvjiaxuan/eslint-config-js/-/eslint-config-js-0.10.1.tgz", + "integrity": "sha512-SHIylYbEQsI4wonEJxfZ75uK3ujyCrRkcqUEt52cut48nd2dG7+0hFhxCpnNthJp0V8jx2FJoejr0ZQEbJemVQ==", "dev": true, "dependencies": { - "@eslint/js": "^8.35.0", + "@eslint/js": "^8.36.0", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-jsonc": "^2.6.0", "eslint-plugin-markdown": "^2.2.1", "eslint-plugin-promise": "^6.1.1", "eslint-plugin-yml": "^1.5.0", "globals": "^13.20.0", - "yaml-eslint-parser": "^1.1.0" + "yaml-eslint-parser": "^1.2.0" }, "peerDependencies": { "eslint": ">=8" } }, "node_modules/@lvjiaxuan/eslint-config-ts": { - "version": "0.8.3", - "resolved": "https://registry.npmmirror.com/@lvjiaxuan/eslint-config-ts/-/eslint-config-ts-0.8.3.tgz", - "integrity": "sha512-NR3OJ+FoeuQGKJ/N9WVe3HsbWE9ezQhaCs4GG7Bbn87hBTBEfbyNiGZbDaCFvapWKXib8cwm2ia/nkYtLIXVMQ==", + "version": "0.10.1", + "resolved": "https://registry.npmmirror.com/@lvjiaxuan/eslint-config-ts/-/eslint-config-ts-0.10.1.tgz", + "integrity": "sha512-/YzK2p6AauddxheWriUyVxT4l6bwrPudPYW8/US31UyLa4SAJx16TIoJ4q7dGhKYcuusHxZewAH8/xNmNmLVDA==", "dev": true, "dependencies": { - "@lvjiaxuan/eslint-config-js": "^0.8.3", - "@typescript-eslint/eslint-plugin": "^5.54.0", - "@typescript-eslint/parser": "^5.54.0" + "@lvjiaxuan/eslint-config-js": "^0.10.1", + "@typescript-eslint/eslint-plugin": "^5.54.1", + "@typescript-eslint/parser": "^5.54.1" }, "peerDependencies": { "eslint": ">=8", @@ -484,14 +508,14 @@ } }, "node_modules/@lvjiaxuan/eslint-config-vue": { - "version": "0.8.3", - "resolved": "https://registry.npmmirror.com/@lvjiaxuan/eslint-config-vue/-/eslint-config-vue-0.8.3.tgz", - "integrity": "sha512-7upQvRtX1Nu8Z1WNatx77VqWnC2J5UnebvJDLOvcYrWhD7cz06TMTLprh5VHzJ4Ns4k7FXu2LR+/lb+qrFN2lw==", + "version": "0.10.1", + "resolved": "https://registry.npmmirror.com/@lvjiaxuan/eslint-config-vue/-/eslint-config-vue-0.10.1.tgz", + "integrity": "sha512-V3Hzzv3OKXGM15wbRiyFunX0rTTCIRni0TKfVVwo1KBrWoWvhwR/Zg6CtwhFrRs7L68mr+ect2BHiGDw9EBZZQ==", "dev": true, "dependencies": { - "@lvjiaxuan/eslint-config-ts": "^0.8.3", - "@typescript-eslint/eslint-plugin": "^5.54.0", - "@typescript-eslint/parser": "^5.54.0", + "@lvjiaxuan/eslint-config-ts": "^0.10.1", + "@typescript-eslint/eslint-plugin": "^5.54.1", + "@typescript-eslint/parser": "^5.54.1", "@vue/eslint-config-typescript": "^11.0.2", "eslint-plugin-vue": "^9.9.0", "globals": "^13.20.0", @@ -502,13 +526,12 @@ } }, "node_modules/@lvjiaxuan/eslint-plugin": { - "version": "0.8.3", - "resolved": "https://registry.npmmirror.com/@lvjiaxuan/eslint-plugin/-/eslint-plugin-0.8.3.tgz", - "integrity": "sha512-HXJbnQ10HVbqyuegvmE8U7BWvNZACSb1R3yIljPGVjbQy7MK73t7Z9ANabc2rwFX/vZ8rHynbp14rBdsEaK6tQ==", + "version": "0.10.1", + "resolved": "https://registry.npmmirror.com/@lvjiaxuan/eslint-plugin/-/eslint-plugin-0.10.1.tgz", + "integrity": "sha512-dSdejNzJKubYDxdmtzD6z4h7UaAnG+dRAcA9Xt4BP0z8PqCQwyloiOzCvBGIMxMqlxH50ikH3tznQxC3IsTYJQ==", "dev": true, "dependencies": { - "@lvjiaxuan/eslint-config": "^0.8.3", - "@typescript-eslint/utils": "^5.54.0", + "@lvjiaxuan/eslint-config": "^0.10.1", "lodash.merge": "^4.6.2" }, "bin": { @@ -585,9 +608,9 @@ } }, "node_modules/@types/node": { - "version": "18.14.6", - "resolved": "https://registry.npmmirror.com/@types/node/-/node-18.14.6.tgz", - "integrity": "sha512-93+VvleD3mXwlLI/xASjw0FzKcwzl3OdTCzm1LaRfqgS21gfFtK3zDXM5Op9TeeMsJVOaJ2VRDpT9q4Y3d0AvA==", + "version": "18.15.0", + "resolved": "https://registry.npmmirror.com/@types/node/-/node-18.15.0.tgz", + "integrity": "sha512-z6nr0TTEOBGkzLGmbypWOGnpSpSIBorEhC4L+4HeQ2iezKCi4f77kyslRwvHeNitymGQ+oFyIWGP96l/DPSV9w==", "dev": true }, "node_modules/@types/semver": { @@ -789,9 +812,9 @@ } }, "node_modules/acorn": { - "version": "8.8.0", - "resolved": "https://registry.npmmirror.com/acorn/-/acorn-8.8.0.tgz", - "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", + "version": "8.8.2", + "resolved": "https://registry.npmmirror.com/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1169,13 +1192,15 @@ } }, "node_modules/eslint": { - "version": "8.35.0", - "resolved": "https://registry.npmmirror.com/eslint/-/eslint-8.35.0.tgz", - "integrity": "sha512-BxAf1fVL7w+JLRQhWl2pzGeSiGqbWumV4WNvc9Rhp6tiCtm4oHnyPBSEtMGZwrQgudFQ+otqzWoPB7x+hxoWsw==", + "version": "8.36.0", + "resolved": "https://registry.npmmirror.com/eslint/-/eslint-8.36.0.tgz", + "integrity": "sha512-Y956lmS7vDqomxlaaQAHVmeb4tNMp2FWIvU/RnU5BD3IKMD/MJPr76xdyr68P8tV1iNMvN2mRK0yy3c+UjL+bw==", "dev": true, "dependencies": { - "@eslint/eslintrc": "^2.0.0", - "@eslint/js": "8.35.0", + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.4.0", + "@eslint/eslintrc": "^2.0.1", + "@eslint/js": "8.36.0", "@humanwhocodes/config-array": "^0.11.8", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -1186,9 +1211,8 @@ "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", "eslint-scope": "^7.1.1", - "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", - "espree": "^9.4.0", + "espree": "^9.5.0", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -1210,7 +1234,6 @@ "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", - "regexpp": "^3.2.0", "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", "text-table": "^0.2.0" @@ -1399,9 +1422,9 @@ } }, "node_modules/espree": { - "version": "9.4.0", - "resolved": "https://registry.npmmirror.com/espree/-/espree-9.4.0.tgz", - "integrity": "sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==", + "version": "9.5.0", + "resolved": "https://registry.npmmirror.com/espree/-/espree-9.5.0.tgz", + "integrity": "sha512-JPbJGhKc47++oo4JkEoTe2wjy4fmMwvFpgJT9cQzmfXKp22Dr6Hf1tdCteLz1h0P3t+mGvWZ+4Uankvh8+c6zw==", "dev": true, "dependencies": { "acorn": "^8.8.0", @@ -1413,9 +1436,9 @@ } }, "node_modules/esquery": { - "version": "1.4.2", - "resolved": "https://registry.npmmirror.com/esquery/-/esquery-1.4.2.tgz", - "integrity": "sha512-JVSoLdTlTDkmjFmab7H/9SL9qGSyjElT3myyKp7krqjVFQCDLmj1QFaCLRFBszBKI0XVZaiiXvuPIX3ZwHe1Ng==", + "version": "1.5.0", + "resolved": "https://registry.npmmirror.com/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, "dependencies": { "estraverse": "^5.1.0" @@ -1833,7 +1856,7 @@ }, "node_modules/is-path-inside": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "resolved": "https://registry.npmmirror.com/is-path-inside/-/is-path-inside-3.0.3.tgz", "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true, "engines": { @@ -1865,9 +1888,9 @@ } }, "node_modules/js-sdsl": { - "version": "4.1.4", - "resolved": "https://registry.npmmirror.com/js-sdsl/-/js-sdsl-4.1.4.tgz", - "integrity": "sha512-Y2/yD55y5jteOAmY50JbUZYwk3CP3wnLPEZnlR1w9oKhITrBEtAxwuWKebFf8hMrPMgbYwFoWK/lH2sBkErELw==", + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/js-sdsl/-/js-sdsl-4.3.0.tgz", + "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==", "dev": true }, "node_modules/js-yaml": { @@ -1895,9 +1918,9 @@ "dev": true }, "node_modules/jsonc-eslint-parser": { - "version": "2.1.0", - "resolved": "https://registry.npmmirror.com/jsonc-eslint-parser/-/jsonc-eslint-parser-2.1.0.tgz", - "integrity": "sha512-qCRJWlbP2v6HbmKW7R3lFbeiVWHo+oMJ0j+MizwvauqnCV/EvtAeEeuCgoc/ErtsuoKgYB8U4Ih8AxJbXoE6/g==", + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/jsonc-eslint-parser/-/jsonc-eslint-parser-2.2.0.tgz", + "integrity": "sha512-x5QjzBOORd+T2EjErIxJnkOEbLVEdD1ILEeBbIJt8Eq/zUn7P7M8qdnWiNVBK5f8oxnJpc6SBHOeeIEl/swPjg==", "dev": true, "dependencies": { "acorn": "^8.5.0", @@ -2951,9 +2974,9 @@ } }, "node_modules/yaml-eslint-parser": { - "version": "1.1.0", - "resolved": "https://registry.npmmirror.com/yaml-eslint-parser/-/yaml-eslint-parser-1.1.0.tgz", - "integrity": "sha512-b464Q1fYiX1oYx2kE8k4mEp6S9Prk+tfDsY/IPxQ0FCjEuj3AKko5Skf3/yQJeYTTDyjDE+aWIJemnv29HvEWQ==", + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/yaml-eslint-parser/-/yaml-eslint-parser-1.2.0.tgz", + "integrity": "sha512-OmuvQd5lyIJWfFALc39K5fGqp0aWNc+EtyhVgcQIPZaUKMnTb7An3RMp+QJizJ/x0F4kpgTNe6BL/ctdvoIwIg==", "dev": true, "dependencies": { "eslint-visitor-keys": "^3.0.0", @@ -3138,15 +3161,30 @@ "dev": true, "optional": true }, + "@eslint-community/eslint-utils": { + "version": "4.2.0", + "resolved": "https://registry.npmmirror.com/@eslint-community/eslint-utils/-/eslint-utils-4.2.0.tgz", + "integrity": "sha512-gB8T4H4DEfX2IV9zGDJPOBgP1e/DbfCPDTtEqUMckpvzS1OYtva8JdFYBqMwYk7xAQ429WGF/UPqn8uQ//h2vQ==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^3.3.0" + } + }, + "@eslint-community/regexpp": { + "version": "4.4.0", + "resolved": "https://registry.npmmirror.com/@eslint-community/regexpp/-/regexpp-4.4.0.tgz", + "integrity": "sha512-A9983Q0LnDGdLPjxyXQ00sbV+K+O+ko2Dr+CZigbHWtX9pNfxlaBkMR8X1CztI73zuEyEBXTVjx7CE+/VSwDiQ==", + "dev": true + }, "@eslint/eslintrc": { - "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/@eslint/eslintrc/-/eslintrc-2.0.0.tgz", - "integrity": "sha512-fluIaaV+GyV24CCu/ggiHdV+j4RNh85yQnAYS/G2mZODZgGmmlrgCydjUcV3YvxCm9x8nMAfThsqTni4KiXT4A==", + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/@eslint/eslintrc/-/eslintrc-2.0.1.tgz", + "integrity": "sha512-eFRmABvW2E5Ho6f5fHLqgena46rOj7r7OKHYfLElqcBfGFHHpjBhivyi5+jOEQuSpdc/1phIZJlbC2te+tZNIw==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.4.0", + "espree": "^9.5.0", "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", @@ -3156,9 +3194,9 @@ } }, "@eslint/js": { - "version": "8.35.0", - "resolved": "https://registry.npmmirror.com/@eslint/js/-/js-8.35.0.tgz", - "integrity": "sha512-JXdzbRiWclLVoD8sNUjR443VVlYqiYmDVT6rGUEIEHU5YJW0gaVZwV2xgM7D4arkvASqD0IlLUVjHiFuxaftRw==", + "version": "8.36.0", + "resolved": "https://registry.npmmirror.com/@eslint/js/-/js-8.36.0.tgz", + "integrity": "sha512-lxJ9R5ygVm8ZWgYdUweoq5ownDlJ4upvoWmO4eLxBYHdMo+vZ/Rx0EN6MbKWDJOSUGrqJy2Gt+Dyv/VKml0fjg==", "dev": true }, "@humanwhocodes/config-array": { @@ -3185,50 +3223,50 @@ "dev": true }, "@lvjiaxuan/eslint-config": { - "version": "0.8.3", - "resolved": "https://registry.npmmirror.com/@lvjiaxuan/eslint-config/-/eslint-config-0.8.3.tgz", - "integrity": "sha512-FTdGFKMnAoICckMa+89VGqinqZtSs3n3rMi2eZljl1NxxXVX0L1vnOFB5/KMI4URf4AQyBb7mYPQZnjw4SZLZQ==", + "version": "0.10.1", + "resolved": "https://registry.npmmirror.com/@lvjiaxuan/eslint-config/-/eslint-config-0.10.1.tgz", + "integrity": "sha512-Y89ldRVndHav+Qm05VjH6+vu3DGs4k5XhE198M+kzGVFPEtcmbeLYeVVAbDC+iYgV7Thh/nFmaiGZQBxyDD57Q==", "dev": true, "requires": { - "@lvjiaxuan/eslint-config-vue": "^0.8.3" + "@lvjiaxuan/eslint-config-vue": "^0.10.1" } }, "@lvjiaxuan/eslint-config-js": { - "version": "0.8.3", - "resolved": "https://registry.npmmirror.com/@lvjiaxuan/eslint-config-js/-/eslint-config-js-0.8.3.tgz", - "integrity": "sha512-jXiFaxnhlik2sSZdwUYAcXKl02M8mJ93DfcoFc2SH32W209FB11yqY4HCP296jEf3bNztqrYozY7Ehd/H5FaDA==", + "version": "0.10.1", + "resolved": "https://registry.npmmirror.com/@lvjiaxuan/eslint-config-js/-/eslint-config-js-0.10.1.tgz", + "integrity": "sha512-SHIylYbEQsI4wonEJxfZ75uK3ujyCrRkcqUEt52cut48nd2dG7+0hFhxCpnNthJp0V8jx2FJoejr0ZQEbJemVQ==", "dev": true, "requires": { - "@eslint/js": "^8.35.0", + "@eslint/js": "^8.36.0", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-jsonc": "^2.6.0", "eslint-plugin-markdown": "^2.2.1", "eslint-plugin-promise": "^6.1.1", "eslint-plugin-yml": "^1.5.0", "globals": "^13.20.0", - "yaml-eslint-parser": "^1.1.0" + "yaml-eslint-parser": "^1.2.0" } }, "@lvjiaxuan/eslint-config-ts": { - "version": "0.8.3", - "resolved": "https://registry.npmmirror.com/@lvjiaxuan/eslint-config-ts/-/eslint-config-ts-0.8.3.tgz", - "integrity": "sha512-NR3OJ+FoeuQGKJ/N9WVe3HsbWE9ezQhaCs4GG7Bbn87hBTBEfbyNiGZbDaCFvapWKXib8cwm2ia/nkYtLIXVMQ==", + "version": "0.10.1", + "resolved": "https://registry.npmmirror.com/@lvjiaxuan/eslint-config-ts/-/eslint-config-ts-0.10.1.tgz", + "integrity": "sha512-/YzK2p6AauddxheWriUyVxT4l6bwrPudPYW8/US31UyLa4SAJx16TIoJ4q7dGhKYcuusHxZewAH8/xNmNmLVDA==", "dev": true, "requires": { - "@lvjiaxuan/eslint-config-js": "^0.8.3", - "@typescript-eslint/eslint-plugin": "^5.54.0", - "@typescript-eslint/parser": "^5.54.0" + "@lvjiaxuan/eslint-config-js": "^0.10.1", + "@typescript-eslint/eslint-plugin": "^5.54.1", + "@typescript-eslint/parser": "^5.54.1" } }, "@lvjiaxuan/eslint-config-vue": { - "version": "0.8.3", - "resolved": "https://registry.npmmirror.com/@lvjiaxuan/eslint-config-vue/-/eslint-config-vue-0.8.3.tgz", - "integrity": "sha512-7upQvRtX1Nu8Z1WNatx77VqWnC2J5UnebvJDLOvcYrWhD7cz06TMTLprh5VHzJ4Ns4k7FXu2LR+/lb+qrFN2lw==", + "version": "0.10.1", + "resolved": "https://registry.npmmirror.com/@lvjiaxuan/eslint-config-vue/-/eslint-config-vue-0.10.1.tgz", + "integrity": "sha512-V3Hzzv3OKXGM15wbRiyFunX0rTTCIRni0TKfVVwo1KBrWoWvhwR/Zg6CtwhFrRs7L68mr+ect2BHiGDw9EBZZQ==", "dev": true, "requires": { - "@lvjiaxuan/eslint-config-ts": "^0.8.3", - "@typescript-eslint/eslint-plugin": "^5.54.0", - "@typescript-eslint/parser": "^5.54.0", + "@lvjiaxuan/eslint-config-ts": "^0.10.1", + "@typescript-eslint/eslint-plugin": "^5.54.1", + "@typescript-eslint/parser": "^5.54.1", "@vue/eslint-config-typescript": "^11.0.2", "eslint-plugin-vue": "^9.9.0", "globals": "^13.20.0", @@ -3236,13 +3274,12 @@ } }, "@lvjiaxuan/eslint-plugin": { - "version": "0.8.3", - "resolved": "https://registry.npmmirror.com/@lvjiaxuan/eslint-plugin/-/eslint-plugin-0.8.3.tgz", - "integrity": "sha512-HXJbnQ10HVbqyuegvmE8U7BWvNZACSb1R3yIljPGVjbQy7MK73t7Z9ANabc2rwFX/vZ8rHynbp14rBdsEaK6tQ==", + "version": "0.10.1", + "resolved": "https://registry.npmmirror.com/@lvjiaxuan/eslint-plugin/-/eslint-plugin-0.10.1.tgz", + "integrity": "sha512-dSdejNzJKubYDxdmtzD6z4h7UaAnG+dRAcA9Xt4BP0z8PqCQwyloiOzCvBGIMxMqlxH50ikH3tznQxC3IsTYJQ==", "dev": true, "requires": { - "@lvjiaxuan/eslint-config": "^0.8.3", - "@typescript-eslint/utils": "^5.54.0", + "@lvjiaxuan/eslint-config": "^0.10.1", "lodash.merge": "^4.6.2" } }, @@ -3304,9 +3341,9 @@ } }, "@types/node": { - "version": "18.14.6", - "resolved": "https://registry.npmmirror.com/@types/node/-/node-18.14.6.tgz", - "integrity": "sha512-93+VvleD3mXwlLI/xASjw0FzKcwzl3OdTCzm1LaRfqgS21gfFtK3zDXM5Op9TeeMsJVOaJ2VRDpT9q4Y3d0AvA==", + "version": "18.15.0", + "resolved": "https://registry.npmmirror.com/@types/node/-/node-18.15.0.tgz", + "integrity": "sha512-z6nr0TTEOBGkzLGmbypWOGnpSpSIBorEhC4L+4HeQ2iezKCi4f77kyslRwvHeNitymGQ+oFyIWGP96l/DPSV9w==", "dev": true }, "@types/semver": { @@ -3438,9 +3475,9 @@ } }, "acorn": { - "version": "8.8.0", - "resolved": "https://registry.npmmirror.com/acorn/-/acorn-8.8.0.tgz", - "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", + "version": "8.8.2", + "resolved": "https://registry.npmmirror.com/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", "dev": true }, "acorn-jsx": { @@ -3732,13 +3769,15 @@ "dev": true }, "eslint": { - "version": "8.35.0", - "resolved": "https://registry.npmmirror.com/eslint/-/eslint-8.35.0.tgz", - "integrity": "sha512-BxAf1fVL7w+JLRQhWl2pzGeSiGqbWumV4WNvc9Rhp6tiCtm4oHnyPBSEtMGZwrQgudFQ+otqzWoPB7x+hxoWsw==", + "version": "8.36.0", + "resolved": "https://registry.npmmirror.com/eslint/-/eslint-8.36.0.tgz", + "integrity": "sha512-Y956lmS7vDqomxlaaQAHVmeb4tNMp2FWIvU/RnU5BD3IKMD/MJPr76xdyr68P8tV1iNMvN2mRK0yy3c+UjL+bw==", "dev": true, "requires": { - "@eslint/eslintrc": "^2.0.0", - "@eslint/js": "8.35.0", + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.4.0", + "@eslint/eslintrc": "^2.0.1", + "@eslint/js": "8.36.0", "@humanwhocodes/config-array": "^0.11.8", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -3749,9 +3788,8 @@ "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", "eslint-scope": "^7.1.1", - "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", - "espree": "^9.4.0", + "espree": "^9.5.0", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -3773,7 +3811,6 @@ "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", - "regexpp": "^3.2.0", "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", "text-table": "^0.2.0" @@ -3903,9 +3940,9 @@ "dev": true }, "espree": { - "version": "9.4.0", - "resolved": "https://registry.npmmirror.com/espree/-/espree-9.4.0.tgz", - "integrity": "sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==", + "version": "9.5.0", + "resolved": "https://registry.npmmirror.com/espree/-/espree-9.5.0.tgz", + "integrity": "sha512-JPbJGhKc47++oo4JkEoTe2wjy4fmMwvFpgJT9cQzmfXKp22Dr6Hf1tdCteLz1h0P3t+mGvWZ+4Uankvh8+c6zw==", "dev": true, "requires": { "acorn": "^8.8.0", @@ -3914,9 +3951,9 @@ } }, "esquery": { - "version": "1.4.2", - "resolved": "https://registry.npmmirror.com/esquery/-/esquery-1.4.2.tgz", - "integrity": "sha512-JVSoLdTlTDkmjFmab7H/9SL9qGSyjElT3myyKp7krqjVFQCDLmj1QFaCLRFBszBKI0XVZaiiXvuPIX3ZwHe1Ng==", + "version": "1.5.0", + "resolved": "https://registry.npmmirror.com/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, "requires": { "estraverse": "^5.1.0" @@ -4252,7 +4289,7 @@ }, "is-path-inside": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "resolved": "https://registry.npmmirror.com/is-path-inside/-/is-path-inside-3.0.3.tgz", "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true }, @@ -4275,9 +4312,9 @@ "dev": true }, "js-sdsl": { - "version": "4.1.4", - "resolved": "https://registry.npmmirror.com/js-sdsl/-/js-sdsl-4.1.4.tgz", - "integrity": "sha512-Y2/yD55y5jteOAmY50JbUZYwk3CP3wnLPEZnlR1w9oKhITrBEtAxwuWKebFf8hMrPMgbYwFoWK/lH2sBkErELw==", + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/js-sdsl/-/js-sdsl-4.3.0.tgz", + "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==", "dev": true }, "js-yaml": { @@ -4302,9 +4339,9 @@ "dev": true }, "jsonc-eslint-parser": { - "version": "2.1.0", - "resolved": "https://registry.npmmirror.com/jsonc-eslint-parser/-/jsonc-eslint-parser-2.1.0.tgz", - "integrity": "sha512-qCRJWlbP2v6HbmKW7R3lFbeiVWHo+oMJ0j+MizwvauqnCV/EvtAeEeuCgoc/ErtsuoKgYB8U4Ih8AxJbXoE6/g==", + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/jsonc-eslint-parser/-/jsonc-eslint-parser-2.2.0.tgz", + "integrity": "sha512-x5QjzBOORd+T2EjErIxJnkOEbLVEdD1ILEeBbIJt8Eq/zUn7P7M8qdnWiNVBK5f8oxnJpc6SBHOeeIEl/swPjg==", "dev": true, "requires": { "acorn": "^8.5.0", @@ -5106,9 +5143,9 @@ "dev": true }, "yaml-eslint-parser": { - "version": "1.1.0", - "resolved": "https://registry.npmmirror.com/yaml-eslint-parser/-/yaml-eslint-parser-1.1.0.tgz", - "integrity": "sha512-b464Q1fYiX1oYx2kE8k4mEp6S9Prk+tfDsY/IPxQ0FCjEuj3AKko5Skf3/yQJeYTTDyjDE+aWIJemnv29HvEWQ==", + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/yaml-eslint-parser/-/yaml-eslint-parser-1.2.0.tgz", + "integrity": "sha512-OmuvQd5lyIJWfFALc39K5fGqp0aWNc+EtyhVgcQIPZaUKMnTb7An3RMp+QJizJ/x0F4kpgTNe6BL/ctdvoIwIg==", "dev": true, "requires": { "eslint-visitor-keys": "^3.0.0", diff --git a/package.json b/package.json index 216ceaf..ac277e2 100644 --- a/package.json +++ b/package.json @@ -87,28 +87,24 @@ ] }, "scripts": { - "compile": "tsup src/extension.ts --external=vscode --format=cjs --shims=false --clean", + "compile": "tsup src/extension.ts --external=vscode --clean", "dev": "nr compile --watch", "vscode:prepublish": "nr compile", "pretest": "nr compile && nr lint", "lint": "eslint .", "pack": "vsce package", - "publish": "vsce publish", - "release": "nx jiti release.ts" + "publish": "vsce publish" }, "dependencies": { "vscode-languageserver": "^8.1.0" }, "devDependencies": { - "@lvjiaxuan/eslint-plugin": "^0.8.3", + "@lvjiaxuan/eslint-plugin": "^0.10.1", "@types/eslint": "^8.21.1", - "@types/node": "^18.14.6", + "@types/node": "^18.15.0", "@types/vscode": "1.60.0", - "eslint": "^8.35.0", + "eslint": "^8.36.0", "tsup": "^6.6.3", "typescript": "^4.9.5" - }, - "eslintConfig": { - "extends": "plugin:@lvjiaxuan/recommended" } } diff --git a/src/extension.ts b/src/extension.ts index b1aaac7..9304e35 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -15,7 +15,7 @@ type LineNumber = number type LineRules = Set const lintingCache = new Map>() -let reLintingTimer: NodeJS.Timeout +let reLintingTimer: ReturnType let extensionContext: ExtensionContext diff --git a/src/statusBarItem.ts b/src/statusBarItem.ts index a61d660..e6cccfd 100644 --- a/src/statusBarItem.ts +++ b/src/statusBarItem.ts @@ -21,7 +21,7 @@ export const showStatusBarItem = (text: string, time = 5000) => { time > 0 && hideStatusBarItem(time) } -let hideTimer: NodeJS.Timeout +let hideTimer: ReturnType export const hideStatusBarItem = (delay = 5000) => { clearTimeout(hideTimer) hideTimer = setTimeout(() => statusBarItem.hide(), delay) diff --git a/src/utils.ts b/src/utils.ts index a7b791a..c026775 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -11,12 +11,12 @@ export const getTextBylines = (startLine: number, endLine?: number) => export function existFile(file: string): Promise { return new Promise((resolve, _reject) => { - // keep + // console.log(file) fs.stat(file, (error, stats) => { if (error !== null) { resolve(false) } - resolve(stats.isFile()) + resolve(stats?.isFile() ?? false) }) }) }