Skip to content

Commit

Permalink
chore(docs): remove eslint4b (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Oct 2, 2023
1 parent a5f49b5 commit 3b53a57
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/.vuepress/components/eslint-playground.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
27 changes: 23 additions & 4 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -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")
Expand All @@ -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",
},
],

Expand All @@ -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: [
{
Expand All @@ -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",
},
},
Expand Down
10 changes: 10 additions & 0 deletions docs/.vuepress/enhanceApp.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* globals window */
export default () => {
if (typeof window !== "undefined") {
if (typeof window.process === "undefined") {
window.process = {
cwd: () => undefined,
}
}
}
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 3b53a57

Please sign in to comment.