Skip to content

Commit 3b53a57

Browse files
authored
chore(docs): remove eslint4b (#19)
1 parent a5f49b5 commit 3b53a57

File tree

5 files changed

+38
-9
lines changed

5 files changed

+38
-9
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
run: npm run test
8686

8787
- name: ⬆️ Upload coverage report
88-
uses: codecov/codecov-action@v4
88+
uses: codecov/codecov-action@v3
8989

9090
release:
9191
name: 🚀 Release

docs/.vuepress/components/eslint-playground.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export default {
9595
9696
async mounted() {
9797
// Load linter.
98-
const { default: Linter } = await import("eslint4b")
98+
const { Linter } = await import("eslint/lib/linter")
9999
const linter = (this.linter = new Linter())
100100
101101
for (const ruleId of Object.keys(rules)) {

docs/.vuepress/config.js

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"use strict"
22

3+
const path = require("path")
4+
const webpack = require("webpack")
35
const { withCategories } = require("../../scripts/lib/rules")
46
require("../../scripts/update-docs-headers")
57
require("../../scripts/update-docs-index")
@@ -25,8 +27,7 @@ module.exports = {
2527
nav: [
2628
{
2729
text: "Changelog",
28-
link:
29-
"https://github.com/eslint-community/eslint-plugin-eslint-comments/releases",
30+
link: "https://github.com/eslint-community/eslint-plugin-eslint-comments/releases",
3031
},
3132
],
3233

@@ -38,13 +39,31 @@ module.exports = {
3839
...withCategories.map(({ category, rules }) => ({
3940
title: `Rules in ${category}`,
4041
collapsable: false,
41-
children: rules.map(rule => `/rules/${rule.name}`),
42+
children: rules.map((rule) => `/rules/${rule.name}`),
4243
})),
4344
],
4445
},
4546
},
4647

48+
enhanceAppFiles: require.resolve("./enhanceApp.mjs"),
4749
configureWebpack: {
50+
plugins: [
51+
new webpack.DefinePlugin({
52+
"process.env.TIMING": JSON.stringify(""),
53+
}),
54+
],
55+
resolve: {
56+
alias: {
57+
esquery: path.resolve(
58+
__dirname,
59+
"../../node_modules/esquery/dist/esquery.min.js"
60+
),
61+
"@eslint/eslintrc/universal": path.resolve(
62+
__dirname,
63+
"../../node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs"
64+
),
65+
},
66+
},
4867
module: {
4968
rules: [
5069
{
@@ -53,7 +72,7 @@ module.exports = {
5372
options: {
5473
search: "[\\s\\S]+", // whole file.
5574
replace:
56-
'module.exports = () => [require("eslint4b/dist/linter")]',
75+
'module.exports = () => [require("eslint/lib/linter").Linter]',
5776
flags: "g",
5877
},
5978
},

docs/.vuepress/enhanceApp.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* globals window */
2+
export default () => {
3+
if (typeof window !== "undefined") {
4+
if (typeof window.process === "undefined") {
5+
window.process = {
6+
cwd: () => undefined,
7+
}
8+
}
9+
}
10+
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@
2424
"@vuepress/plugin-pwa": "^1.9.9",
2525
"cross-spawn": "^7.0.3",
2626
"eslint": "^8.46.0",
27-
"eslint4b": "^7.32.0",
2827
"fs-extra": "^10.1.0",
2928
"mocha": "^9.2.2",
3029
"nyc": "^15.1.0",
3130
"opener": "^1.5.2",
3231
"rimraf": "^3.0.2",
3332
"semver": "^7.5.4",
34-
"string-replace-loader": "^3.1.0",
33+
"string-replace-loader": "^2.3.0",
3534
"vue-eslint-editor": "^1.1.0",
36-
"vuepress": "^1.9.9"
35+
"vuepress": "^1.9.9",
36+
"webpack": "^4.47.0"
3737
},
3838
"scripts": {
3939
"preversion": "npm test",

0 commit comments

Comments
 (0)