Skip to content

Commit 92cb401

Browse files
committed
chore: fix site
1 parent cdae744 commit 92cb401

File tree

6 files changed

+51
-22
lines changed

6 files changed

+51
-22
lines changed

docs/.vuepress/components/rules/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,12 @@ categories.sort((a, b) =>
117117
a.categoryOrder > b.categoryOrder
118118
? 1
119119
: a.categoryOrder < b.categoryOrder
120-
? -1
121-
: a.title > b.title
122-
? 1
123-
: a.title < b.title
124-
? -1
125-
: 0,
120+
? -1
121+
: a.title > b.title
122+
? 1
123+
: a.title < b.title
124+
? -1
125+
: 0,
126126
);
127127

128128
export const DEFAULT_RULES_CONFIG = allRules.reduce((c, r) => {

docs/.vuepress/config.js

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ module.exports = {
88
title: "eslint-plugin-vue-scoped-css",
99
description: "ESLint plugin for Scoped CSS in Vue.js.",
1010
serviceWorker: true,
11-
evergreen: true,
1211
configureWebpack(_config, _isServer) {
1312
return {
1413
externals: {
@@ -24,11 +23,12 @@ module.exports = {
2423
__dirname,
2524
"../../node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs",
2625
),
27-
"eslint/use-at-your-own-risk": path.resolve(
28-
"./shim/eslint/use-at-your-own-risk.js",
26+
"eslint/use-at-your-own-risk": require.resolve(
27+
"./shim/eslint/use-at-your-own-risk",
2928
),
3029
eslint$: require.resolve("./shim/eslint"),
3130
"eslint-visitor-keys": require.resolve("./shim/eslint-visitor-keys"),
31+
"eslint-compat-utils": require.resolve("eslint-compat-utils"), // use cjs
3232
// eslint-disable-next-line n/no-extraneous-require -- demo
3333
stylus: require.resolve("stylus/lib/stylus"),
3434
glob: require.resolve("./shim/glob"),
@@ -47,7 +47,34 @@ module.exports = {
4747
],
4848
};
4949
},
50-
50+
chainWebpack(config) {
51+
const babelTargetModules = [
52+
path.resolve(__dirname, "../../node_modules/eslint-plugin-vue"),
53+
];
54+
const ignoreModules = [path.resolve(__dirname, "../../node_modules")];
55+
const libDir = path.resolve(__dirname, "../..");
56+
config.module
57+
.rule("js")
58+
.exclude.clear()
59+
.add((filepath) => {
60+
// always transpile js in vue files
61+
if (/\.vue\.js$/.test(filepath)) {
62+
return false;
63+
}
64+
if (babelTargetModules.some((m) => filepath.startsWith(m))) {
65+
return false;
66+
}
67+
if (ignoreModules.some((m) => filepath.startsWith(m))) {
68+
return true;
69+
}
70+
if (filepath.startsWith(libDir)) {
71+
return false;
72+
}
73+
return true;
74+
})
75+
.end()
76+
.use("babel-loader");
77+
},
5178
head: [
5279
// ["link", { rel: "icon", type: "image/png", href: "/logo.png" }]
5380
],

docs/.vuepress/shim/eslint/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/* eslint n/no-unsupported-features/es-syntax:0 -- ignore */
22
import { Linter } from "eslint/lib/linter";
3-
export { Linter };
4-
export default { Linter };
3+
class CLIEngine {}
4+
class ESLint {}
5+
export { Linter, CLIEngine, ESLint };
6+
export default { Linter, CLIEngine, ESLint };

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"mocha": "^10.0.0",
7979
"nyc": "^15.1.0",
8080
"pack": "^2.2.0",
81-
"prettier": "^3.0.0",
81+
"prettier": "^3.1.0",
8282
"raw-loader": "^4.0.1",
8383
"rimraf": "^3.0.2",
8484
"semver": "^7.3.2",

tools/lib/load-configs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ for (const config of configs) {
4242
const extendsList: string[] = !config.config.extends
4343
? []
4444
: Array.isArray(config.config.extends)
45-
? config.config.extends
46-
: [config.config.extends];
45+
? config.config.extends
46+
: [config.config.extends];
4747
config.extends = extendsList
4848
.map((p) => configs.find((c) => c.path === p))
4949
.filter(isDefined);

0 commit comments

Comments
 (0)