Skip to content

chore(docs): remove eslint4b #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why we're downgrading here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like v4 has been deleted.
codecov/codecov-action#1089


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"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added it because some dependencies were updated and without it webpack v5 would be used and broken.

I think we need to move away from vuepress later. (I would like to replace it with vitepress when I have time)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened a PR that uses vitepress. #114

},
"scripts": {
"preversion": "npm test",
Expand Down