@vp-tw/eslint-config 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/configs/mdx.js +5 -5
- package/dist/esm/configs/mdx.mjs +7 -13
- package/dist/esm/lib/eslint-plugin-react-compiler.d.ts +8 -12
- package/dist/esm/lib/eslint-plugin-react-compiler.mjs +3 -0
- package/dist/esm/vdustr.mjs +2 -2
- package/dist/lib/eslint-plugin-react-compiler.d.ts +8 -12
- package/dist/lib/eslint-plugin-react-compiler.js +10 -1
- package/dist/vdustr.js +2 -4
- package/package.json +1 -1
- package/scripts/typegen.ts +2 -2
- package/src/lib/eslint-plugin-react-compiler.ts +15 -12
- package/src/vdustr.ts +3 -3
package/dist/configs/mdx.js
CHANGED
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.mdx = void 0;
|
|
7
|
-
var _eslintConfig = require("@antfu/eslint-config");
|
|
8
7
|
var mdxPlugin = _interopRequireWildcard(require("eslint-plugin-mdx"));
|
|
8
|
+
var _renameRules = require("../utils/renameRules");
|
|
9
9
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
10
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
11
|
const mdx = ({
|
|
@@ -19,9 +19,9 @@ const mdx = ({
|
|
|
19
19
|
...mdxPlugin.flat,
|
|
20
20
|
...options,
|
|
21
21
|
rules: {
|
|
22
|
-
...(0,
|
|
22
|
+
...(0, _renameRules.renameRules)({
|
|
23
23
|
...mdxPlugin.flat.rules
|
|
24
|
-
}
|
|
24
|
+
}),
|
|
25
25
|
...options.rules
|
|
26
26
|
},
|
|
27
27
|
processor: mdxPlugin.createRemarkProcessor({
|
|
@@ -36,9 +36,9 @@ const mdx = ({
|
|
|
36
36
|
...mdxPlugin.flatCodeBlocks,
|
|
37
37
|
...flatCodeBlocksOptions,
|
|
38
38
|
rules: {
|
|
39
|
-
...(0,
|
|
39
|
+
...(0, _renameRules.renameRules)({
|
|
40
40
|
...mdxPlugin.flatCodeBlocks.rules
|
|
41
|
-
}
|
|
41
|
+
}),
|
|
42
42
|
...flatCodeBlocksOptions.rules
|
|
43
43
|
}
|
|
44
44
|
}])];
|
package/dist/esm/configs/mdx.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defaultPluginRenaming, renameRules } from "@antfu/eslint-config";
|
|
2
1
|
import * as mdxPlugin from "eslint-plugin-mdx";
|
|
2
|
+
import { renameRules } from "../utils/renameRules.mjs";
|
|
3
3
|
const mdx = ({
|
|
4
4
|
flatCodeBlocks = true,
|
|
5
5
|
processorOptions,
|
|
@@ -12,12 +12,9 @@ const mdx = ({
|
|
|
12
12
|
...mdxPlugin.flat,
|
|
13
13
|
...options,
|
|
14
14
|
rules: {
|
|
15
|
-
...renameRules(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
defaultPluginRenaming
|
|
20
|
-
),
|
|
15
|
+
...renameRules({
|
|
16
|
+
...mdxPlugin.flat.rules
|
|
17
|
+
}),
|
|
21
18
|
...options.rules
|
|
22
19
|
},
|
|
23
20
|
processor: mdxPlugin.createRemarkProcessor({
|
|
@@ -34,12 +31,9 @@ const mdx = ({
|
|
|
34
31
|
...mdxPlugin.flatCodeBlocks,
|
|
35
32
|
...flatCodeBlocksOptions,
|
|
36
33
|
rules: {
|
|
37
|
-
...renameRules(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
defaultPluginRenaming
|
|
42
|
-
),
|
|
34
|
+
...renameRules({
|
|
35
|
+
...mdxPlugin.flatCodeBlocks.rules
|
|
36
|
+
}),
|
|
43
37
|
...flatCodeBlocksOptions.rules
|
|
44
38
|
}
|
|
45
39
|
}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
recommended: LegacyConfig;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
const rules: ReactCompiler["rules"];
|
|
11
|
-
const configs: ReactCompiler["configs"];
|
|
12
|
-
export { configs, rules };
|
|
1
|
+
import type { ESLint, Linter } from "eslint";
|
|
2
|
+
interface ReactCompiler extends ESLint.Plugin {
|
|
3
|
+
rules: NonNullable<ESLint.Plugin["rules"]>;
|
|
4
|
+
configs: {
|
|
5
|
+
recommended: Linter.LegacyConfig;
|
|
6
|
+
};
|
|
13
7
|
}
|
|
8
|
+
declare const reactCompilerInternal: ReactCompiler;
|
|
9
|
+
export { reactCompilerInternal as reactCompiler };
|
package/dist/esm/vdustr.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import antfu from "@antfu/eslint-config";
|
|
2
2
|
import packageJson from "eslint-plugin-package-json/configs/recommended";
|
|
3
|
-
import * as reactCompilerPlugin from "eslint-plugin-react-compiler";
|
|
4
3
|
import { isPackageExists } from "local-pkg";
|
|
5
4
|
import { mdx } from "./configs/mdx.mjs";
|
|
6
5
|
import { prettier } from "./configs/prettier.mjs";
|
|
7
6
|
import { storybook } from "./configs/storybook.mjs";
|
|
7
|
+
import { reactCompiler } from "./lib/eslint-plugin-react-compiler.mjs";
|
|
8
8
|
const vdustr = (options, ...userConfigs) => {
|
|
9
9
|
const typescriptEnabled = isPackageExists("typescript");
|
|
10
10
|
const jsoncEnabled = Boolean(options?.jsonc ?? true);
|
|
@@ -122,7 +122,7 @@ const vdustr = (options, ...userConfigs) => {
|
|
|
122
122
|
...config2,
|
|
123
123
|
plugins: {
|
|
124
124
|
...config2.plugins,
|
|
125
|
-
"react-compiler":
|
|
125
|
+
"react-compiler": reactCompiler
|
|
126
126
|
},
|
|
127
127
|
rules: {
|
|
128
128
|
...config2.rules,
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
recommended: LegacyConfig;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
const rules: ReactCompiler["rules"];
|
|
11
|
-
const configs: ReactCompiler["configs"];
|
|
12
|
-
export { configs, rules };
|
|
1
|
+
import type { ESLint, Linter } from "eslint";
|
|
2
|
+
interface ReactCompiler extends ESLint.Plugin {
|
|
3
|
+
rules: NonNullable<ESLint.Plugin["rules"]>;
|
|
4
|
+
configs: {
|
|
5
|
+
recommended: Linter.LegacyConfig;
|
|
6
|
+
};
|
|
13
7
|
}
|
|
8
|
+
declare const reactCompilerInternal: ReactCompiler;
|
|
9
|
+
export { reactCompilerInternal as reactCompiler };
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.reactCompiler = void 0;
|
|
7
|
+
var reactCompiler = _interopRequireWildcard(require("eslint-plugin-react-compiler"));
|
|
8
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
9
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
|
+
const reactCompilerInternal = exports.reactCompiler = reactCompiler.default ?? reactCompiler;
|
package/dist/vdustr.js
CHANGED
|
@@ -6,13 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.vdustr = void 0;
|
|
7
7
|
var _eslintConfig = _interopRequireDefault(require("@antfu/eslint-config"));
|
|
8
8
|
var _recommended = _interopRequireDefault(require("eslint-plugin-package-json/configs/recommended"));
|
|
9
|
-
var reactCompilerPlugin = _interopRequireWildcard(require("eslint-plugin-react-compiler"));
|
|
10
9
|
var _localPkg = require("local-pkg");
|
|
11
10
|
var _mdx = require("./configs/mdx");
|
|
12
11
|
var _prettier = require("./configs/prettier");
|
|
13
12
|
var _storybook = require("./configs/storybook");
|
|
14
|
-
|
|
15
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
+
var _eslintPluginReactCompiler = require("./lib/eslint-plugin-react-compiler");
|
|
16
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
15
|
const vdustr = (options, ...userConfigs) => {
|
|
18
16
|
const typescriptEnabled = (0, _localPkg.isPackageExists)("typescript");
|
|
@@ -119,7 +117,7 @@ const vdustr = (options, ...userConfigs) => {
|
|
|
119
117
|
...config2,
|
|
120
118
|
plugins: {
|
|
121
119
|
...config2.plugins,
|
|
122
|
-
"react-compiler":
|
|
120
|
+
"react-compiler": _eslintPluginReactCompiler.reactCompiler
|
|
123
121
|
},
|
|
124
122
|
rules: {
|
|
125
123
|
...config2.rules,
|
package/package.json
CHANGED
package/scripts/typegen.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { ESLint } from "eslint";
|
|
2
2
|
import { rules as mdxRules } from "eslint-plugin-mdx/lib/rules";
|
|
3
|
-
|
|
4
|
-
import * as reactCompiler from "eslint-plugin-react-compiler";
|
|
3
|
+
|
|
5
4
|
import storybook from "eslint-plugin-storybook";
|
|
6
5
|
import { pluginsToRulesDTS } from "eslint-typegen/core";
|
|
7
6
|
import fs from "fs-extra";
|
|
8
7
|
import path from "pathe";
|
|
9
8
|
import { packageDirectory } from "pkg-dir";
|
|
9
|
+
import { reactCompiler } from "../src/lib/eslint-plugin-react-compiler";
|
|
10
10
|
|
|
11
11
|
(async () => {
|
|
12
12
|
const pkgDir = await packageDirectory();
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const configs: ReactCompiler["configs"];
|
|
12
|
-
export { configs, rules };
|
|
1
|
+
import type { ESLint, Linter } from "eslint";
|
|
2
|
+
// @ts-expect-error -- Untyped library.
|
|
3
|
+
// eslint-disable-next-line import/no-namespace -- `react-compiler` exports the plugin as a namespace.
|
|
4
|
+
import * as reactCompiler from "eslint-plugin-react-compiler";
|
|
5
|
+
|
|
6
|
+
interface ReactCompiler extends ESLint.Plugin {
|
|
7
|
+
rules: NonNullable<ESLint.Plugin["rules"]>;
|
|
8
|
+
configs: {
|
|
9
|
+
recommended: Linter.LegacyConfig;
|
|
10
|
+
};
|
|
13
11
|
}
|
|
12
|
+
|
|
13
|
+
const reactCompilerInternal: ReactCompiler =
|
|
14
|
+
reactCompiler.default ?? reactCompiler;
|
|
15
|
+
|
|
16
|
+
export { reactCompilerInternal as reactCompiler };
|
package/src/vdustr.ts
CHANGED
|
@@ -4,12 +4,12 @@ import type { Config } from "./types";
|
|
|
4
4
|
import antfu from "@antfu/eslint-config";
|
|
5
5
|
|
|
6
6
|
import packageJson from "eslint-plugin-package-json/configs/recommended";
|
|
7
|
-
|
|
8
|
-
import * as reactCompilerPlugin from "eslint-plugin-react-compiler";
|
|
7
|
+
|
|
9
8
|
import { isPackageExists } from "local-pkg";
|
|
10
9
|
import { mdx } from "./configs/mdx";
|
|
11
10
|
import { prettier } from "./configs/prettier";
|
|
12
11
|
import { storybook } from "./configs/storybook";
|
|
12
|
+
import { reactCompiler } from "./lib/eslint-plugin-react-compiler";
|
|
13
13
|
|
|
14
14
|
type Options = NonNullable<Parameters<typeof antfu>[0]> & {
|
|
15
15
|
mdx?: boolean | mdx.Options;
|
|
@@ -155,7 +155,7 @@ const vdustr = (options?: Options, ...userConfigs: Array<Config>) => {
|
|
|
155
155
|
...config,
|
|
156
156
|
plugins: {
|
|
157
157
|
...config.plugins,
|
|
158
|
-
"react-compiler":
|
|
158
|
+
"react-compiler": reactCompiler,
|
|
159
159
|
},
|
|
160
160
|
rules: {
|
|
161
161
|
...config.rules,
|