@vp-tw/eslint-config 0.0.26 → 0.0.27
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/esm/extends/react.d.ts +1 -0
- package/dist/esm/extends/react.mjs +17 -1
- package/dist/esm/globs.d.ts +5 -1
- package/dist/esm/globs.mjs +2 -0
- package/dist/extends/react.d.ts +1 -0
- package/dist/extends/react.js +14 -1
- package/dist/globs.d.ts +5 -1
- package/dist/globs.js +2 -1
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ declare namespace react {
|
|
|
5
5
|
react?: ConfigOverrides;
|
|
6
6
|
reactCompiler?: reactCompiler.Options["reactCompiler"];
|
|
7
7
|
reactCompilerSetup?: reactCompiler.Options["setup"];
|
|
8
|
+
md?: ConfigOverrides;
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
11
|
declare const react: (composer: VpComposer, options?: react.Options) => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { omit, pick } from "es-toolkit";
|
|
2
2
|
import { reactCompiler } from "../configs/reactCompiler.mjs";
|
|
3
|
+
import { GLOB_REACT_IN_MD } from "../globs.mjs";
|
|
3
4
|
import { extendsConfig } from "../utils/extendsConfig.mjs";
|
|
4
5
|
import { mergeConfig } from "../utils/mergeConfig.mjs";
|
|
5
6
|
import { ignoreKeys } from "./_utils.mjs";
|
|
@@ -27,7 +28,22 @@ const react = (composer, options) => {
|
|
|
27
28
|
pick(omittedConfig, ["files", "ignores"])
|
|
28
29
|
)
|
|
29
30
|
});
|
|
30
|
-
|
|
31
|
+
const mdConfig = mergeConfig(
|
|
32
|
+
{
|
|
33
|
+
...options?.md ?? {}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
...modifiedConfig,
|
|
37
|
+
name: "vdustr/react/md/rules",
|
|
38
|
+
files: [GLOB_REACT_IN_MD],
|
|
39
|
+
rules: {
|
|
40
|
+
"react-compiler/react-compiler": "off",
|
|
41
|
+
"react-hooks/rules-of-hooks": "off",
|
|
42
|
+
"react-refresh/only-export-components": "off"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
return [modifiedConfig, rulesConfig, ...reactCompilerConfigs, mdConfig];
|
|
31
47
|
});
|
|
32
48
|
};
|
|
33
49
|
export { react };
|
package/dist/esm/globs.d.ts
CHANGED
|
@@ -3,5 +3,9 @@ declare const GLOB_PACKAGE_JSON: string;
|
|
|
3
3
|
declare const GLOB_PNPM_WORKSPACE_YAML: string;
|
|
4
4
|
declare const GLOB_CSPELL_JSON: string;
|
|
5
5
|
declare const GLOB_CONFIG_JS: string;
|
|
6
|
+
/**
|
|
7
|
+
* Glob pattern for React files in Markdown files, including MDX.
|
|
8
|
+
*/
|
|
9
|
+
declare const GLOB_REACT_IN_MD: string;
|
|
6
10
|
declare const GLOB_VITEST_WORKSPACE: string;
|
|
7
|
-
export { GLOB_CODE_WORKSPACE, GLOB_CONFIG_JS, GLOB_CSPELL_JSON, GLOB_PACKAGE_JSON, GLOB_PNPM_WORKSPACE_YAML, GLOB_VITEST_WORKSPACE, };
|
|
11
|
+
export { GLOB_CODE_WORKSPACE, GLOB_CONFIG_JS, GLOB_CSPELL_JSON, GLOB_PACKAGE_JSON, GLOB_PNPM_WORKSPACE_YAML, GLOB_REACT_IN_MD, GLOB_VITEST_WORKSPACE, };
|
package/dist/esm/globs.mjs
CHANGED
|
@@ -3,6 +3,7 @@ const GLOB_PACKAGE_JSON = "**/package.json";
|
|
|
3
3
|
const GLOB_PNPM_WORKSPACE_YAML = "**/pnpm-workspace.y?(a)ml";
|
|
4
4
|
const GLOB_CSPELL_JSON = "**/cspell.json";
|
|
5
5
|
const GLOB_CONFIG_JS = "**/*.config.?([cm])[jt]s";
|
|
6
|
+
const GLOB_REACT_IN_MD = "**/*.md?(x)/**/*.?([mc])[jt]s?(x)";
|
|
6
7
|
const GLOB_VITEST_WORKSPACE = "**/vitest.workspace.?([cm])[jt]s";
|
|
7
8
|
export {
|
|
8
9
|
GLOB_CODE_WORKSPACE,
|
|
@@ -10,5 +11,6 @@ export {
|
|
|
10
11
|
GLOB_CSPELL_JSON,
|
|
11
12
|
GLOB_PACKAGE_JSON,
|
|
12
13
|
GLOB_PNPM_WORKSPACE_YAML,
|
|
14
|
+
GLOB_REACT_IN_MD,
|
|
13
15
|
GLOB_VITEST_WORKSPACE
|
|
14
16
|
};
|
package/dist/extends/react.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ declare namespace react {
|
|
|
5
5
|
react?: ConfigOverrides;
|
|
6
6
|
reactCompiler?: reactCompiler.Options["reactCompiler"];
|
|
7
7
|
reactCompilerSetup?: reactCompiler.Options["setup"];
|
|
8
|
+
md?: ConfigOverrides;
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
11
|
declare const react: (composer: VpComposer, options?: react.Options) => void;
|
package/dist/extends/react.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.react = void 0;
|
|
7
7
|
var _esToolkit = require("es-toolkit");
|
|
8
8
|
var _reactCompiler = require("../configs/reactCompiler");
|
|
9
|
+
var _globs = require("../globs");
|
|
9
10
|
var _extendsConfig = require("../utils/extendsConfig");
|
|
10
11
|
var _mergeConfig = require("../utils/mergeConfig");
|
|
11
12
|
var _utils = require("./_utils");
|
|
@@ -23,7 +24,19 @@ const react = (composer, options) => {
|
|
|
23
24
|
setup: options?.reactCompilerSetup ?? {},
|
|
24
25
|
reactCompiler: (0, _mergeConfig.mergeConfig)(options?.reactCompiler, (0, _esToolkit.pick)(omittedConfig, ["files", "ignores"]))
|
|
25
26
|
});
|
|
26
|
-
|
|
27
|
+
const mdConfig = (0, _mergeConfig.mergeConfig)({
|
|
28
|
+
...(options?.md ?? {})
|
|
29
|
+
}, {
|
|
30
|
+
...modifiedConfig,
|
|
31
|
+
name: "vdustr/react/md/rules",
|
|
32
|
+
files: [_globs.GLOB_REACT_IN_MD],
|
|
33
|
+
rules: {
|
|
34
|
+
"react-compiler/react-compiler": "off",
|
|
35
|
+
"react-hooks/rules-of-hooks": "off",
|
|
36
|
+
"react-refresh/only-export-components": "off"
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
return [modifiedConfig, rulesConfig, ...reactCompilerConfigs, mdConfig];
|
|
27
40
|
});
|
|
28
41
|
};
|
|
29
42
|
exports.react = react;
|
package/dist/globs.d.ts
CHANGED
|
@@ -3,5 +3,9 @@ declare const GLOB_PACKAGE_JSON: string;
|
|
|
3
3
|
declare const GLOB_PNPM_WORKSPACE_YAML: string;
|
|
4
4
|
declare const GLOB_CSPELL_JSON: string;
|
|
5
5
|
declare const GLOB_CONFIG_JS: string;
|
|
6
|
+
/**
|
|
7
|
+
* Glob pattern for React files in Markdown files, including MDX.
|
|
8
|
+
*/
|
|
9
|
+
declare const GLOB_REACT_IN_MD: string;
|
|
6
10
|
declare const GLOB_VITEST_WORKSPACE: string;
|
|
7
|
-
export { GLOB_CODE_WORKSPACE, GLOB_CONFIG_JS, GLOB_CSPELL_JSON, GLOB_PACKAGE_JSON, GLOB_PNPM_WORKSPACE_YAML, GLOB_VITEST_WORKSPACE, };
|
|
11
|
+
export { GLOB_CODE_WORKSPACE, GLOB_CONFIG_JS, GLOB_CSPELL_JSON, GLOB_PACKAGE_JSON, GLOB_PNPM_WORKSPACE_YAML, GLOB_REACT_IN_MD, GLOB_VITEST_WORKSPACE, };
|
package/dist/globs.js
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.GLOB_VITEST_WORKSPACE = exports.GLOB_PNPM_WORKSPACE_YAML = exports.GLOB_PACKAGE_JSON = exports.GLOB_CSPELL_JSON = exports.GLOB_CONFIG_JS = exports.GLOB_CODE_WORKSPACE = void 0;
|
|
6
|
+
exports.GLOB_VITEST_WORKSPACE = exports.GLOB_REACT_IN_MD = exports.GLOB_PNPM_WORKSPACE_YAML = exports.GLOB_PACKAGE_JSON = exports.GLOB_CSPELL_JSON = exports.GLOB_CONFIG_JS = exports.GLOB_CODE_WORKSPACE = void 0;
|
|
7
7
|
const GLOB_CODE_WORKSPACE = exports.GLOB_CODE_WORKSPACE = "**/*.code-workspace";
|
|
8
8
|
const GLOB_PACKAGE_JSON = exports.GLOB_PACKAGE_JSON = "**/package.json";
|
|
9
9
|
const GLOB_PNPM_WORKSPACE_YAML = exports.GLOB_PNPM_WORKSPACE_YAML = "**/pnpm-workspace.y?(a)ml";
|
|
10
10
|
const GLOB_CSPELL_JSON = exports.GLOB_CSPELL_JSON = "**/cspell.json";
|
|
11
11
|
const GLOB_CONFIG_JS = exports.GLOB_CONFIG_JS = "**/*.config.?([cm])[jt]s";
|
|
12
|
+
const GLOB_REACT_IN_MD = exports.GLOB_REACT_IN_MD = "**/*.md?(x)/**/*.?([mc])[jt]s?(x)";
|
|
12
13
|
const GLOB_VITEST_WORKSPACE = exports.GLOB_VITEST_WORKSPACE = "**/vitest.workspace.?([cm])[jt]s";
|