diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b704a55..5caa32e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,7 +85,7 @@ jobs: run: npm run test - name: ⬆️ Upload coverage report - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v3 release: name: 🚀 Release diff --git a/docs/.vuepress/components/eslint-playground.vue b/docs/.vuepress/components/eslint-playground.vue index b2a4e22..5ba1cb9 100644 --- a/docs/.vuepress/components/eslint-playground.vue +++ b/docs/.vuepress/components/eslint-playground.vue @@ -95,7 +95,7 @@ export default { async mounted() { // Load linter. - const { default: Linter } = await import("eslint4b") + const { Linter } = await import("eslint/lib/linter") const linter = (this.linter = new Linter()) for (const ruleId of Object.keys(rules)) { diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 2ce76aa..ad6dc4c 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -1,5 +1,7 @@ "use strict" +const path = require("path") +const webpack = require("webpack") const { withCategories } = require("../../scripts/lib/rules") require("../../scripts/update-docs-headers") require("../../scripts/update-docs-index") @@ -25,8 +27,7 @@ module.exports = { nav: [ { text: "Changelog", - link: - "https://github.com/eslint-community/eslint-plugin-eslint-comments/releases", + link: "https://github.com/eslint-community/eslint-plugin-eslint-comments/releases", }, ], @@ -38,13 +39,31 @@ module.exports = { ...withCategories.map(({ category, rules }) => ({ title: `Rules in ${category}`, collapsable: false, - children: rules.map(rule => `/rules/${rule.name}`), + children: rules.map((rule) => `/rules/${rule.name}`), })), ], }, }, + enhanceAppFiles: require.resolve("./enhanceApp.mjs"), configureWebpack: { + plugins: [ + new webpack.DefinePlugin({ + "process.env.TIMING": JSON.stringify(""), + }), + ], + resolve: { + alias: { + esquery: path.resolve( + __dirname, + "../../node_modules/esquery/dist/esquery.min.js" + ), + "@eslint/eslintrc/universal": path.resolve( + __dirname, + "../../node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs" + ), + }, + }, module: { rules: [ { @@ -53,7 +72,7 @@ module.exports = { options: { search: "[\\s\\S]+", // whole file. replace: - 'module.exports = () => [require("eslint4b/dist/linter")]', + 'module.exports = () => [require("eslint/lib/linter").Linter]', flags: "g", }, }, diff --git a/docs/.vuepress/enhanceApp.mjs b/docs/.vuepress/enhanceApp.mjs new file mode 100644 index 0000000..9e95e20 --- /dev/null +++ b/docs/.vuepress/enhanceApp.mjs @@ -0,0 +1,10 @@ +/* globals window */ +export default () => { + if (typeof window !== "undefined") { + if (typeof window.process === "undefined") { + window.process = { + cwd: () => undefined, + } + } + } +} diff --git a/package.json b/package.json index 3d8f717..1869fe9 100644 --- a/package.json +++ b/package.json @@ -24,16 +24,16 @@ "@vuepress/plugin-pwa": "^1.9.9", "cross-spawn": "^7.0.3", "eslint": "^8.46.0", - "eslint4b": "^7.32.0", "fs-extra": "^10.1.0", "mocha": "^9.2.2", "nyc": "^15.1.0", "opener": "^1.5.2", "rimraf": "^3.0.2", "semver": "^7.5.4", - "string-replace-loader": "^3.1.0", + "string-replace-loader": "^2.3.0", "vue-eslint-editor": "^1.1.0", - "vuepress": "^1.9.9" + "vuepress": "^1.9.9", + "webpack": "^4.47.0" }, "scripts": { "preversion": "npm test",