js-style-kit 0.2.10 → 0.2.12
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/index.d.ts +126 -9
- package/package.json +11 -11
- package/dist/eslint/base/config.d.ts +0 -17
- package/dist/eslint/base/config.js +0 -457
- package/dist/eslint/base/config.js.map +0 -1
- package/dist/eslint/base/rules.d.ts +0 -18
- package/dist/eslint/base/rules.js +0 -425
- package/dist/eslint/base/rules.js.map +0 -1
- package/dist/eslint/base/types.d.ts +0 -21
- package/dist/eslint/base/types.js +0 -1
- package/dist/eslint/base/types.js.map +0 -1
- package/dist/eslint/constants.d.ts +0 -28
- package/dist/eslint/constants.js +0 -25
- package/dist/eslint/constants.js.map +0 -1
- package/dist/eslint/ignores.d.ts +0 -19
- package/dist/eslint/ignores.js +0 -42
- package/dist/eslint/ignores.js.map +0 -1
- package/dist/eslint/index.d.ts +0 -55
- package/dist/eslint/index.js +0 -1410
- package/dist/eslint/index.js.map +0 -1
- package/dist/eslint/jsdoc/config.d.ts +0 -14
- package/dist/eslint/jsdoc/config.js +0 -109
- package/dist/eslint/jsdoc/config.js.map +0 -1
- package/dist/eslint/jsdoc/rules.d.ts +0 -15
- package/dist/eslint/jsdoc/rules.js +0 -73
- package/dist/eslint/jsdoc/rules.js.map +0 -1
- package/dist/eslint/jsdoc/types.d.ts +0 -52
- package/dist/eslint/jsdoc/types.js +0 -1
- package/dist/eslint/jsdoc/types.js.map +0 -1
- package/dist/eslint/nextjs/config.d.ts +0 -12
- package/dist/eslint/nextjs/config.js +0 -62
- package/dist/eslint/nextjs/config.js.map +0 -1
- package/dist/eslint/nextjs/rules.d.ts +0 -8
- package/dist/eslint/nextjs/rules.js +0 -28
- package/dist/eslint/nextjs/rules.js.map +0 -1
- package/dist/eslint/nextjs/types.d.ts +0 -29
- package/dist/eslint/nextjs/types.js +0 -1
- package/dist/eslint/nextjs/types.js.map +0 -1
- package/dist/eslint/perfectionist/config.d.ts +0 -7
- package/dist/eslint/perfectionist/config.js +0 -65
- package/dist/eslint/perfectionist/config.js.map +0 -1
- package/dist/eslint/perfectionist/rules.d.ts +0 -12
- package/dist/eslint/perfectionist/rules.js +0 -31
- package/dist/eslint/perfectionist/rules.js.map +0 -1
- package/dist/eslint/prefer-arrow-function/config.d.ts +0 -12
- package/dist/eslint/prefer-arrow-function/config.js +0 -45
- package/dist/eslint/prefer-arrow-function/config.js.map +0 -1
- package/dist/eslint/prefer-arrow-function/types.d.ts +0 -17
- package/dist/eslint/prefer-arrow-function/types.js +0 -1
- package/dist/eslint/prefer-arrow-function/types.js.map +0 -1
- package/dist/eslint/react/config.d.ts +0 -18
- package/dist/eslint/react/config.js +0 -186
- package/dist/eslint/react/config.js.map +0 -1
- package/dist/eslint/react/rules.d.ts +0 -26
- package/dist/eslint/react/rules.js +0 -132
- package/dist/eslint/react/rules.js.map +0 -1
- package/dist/eslint/react-compiler/config.d.ts +0 -12
- package/dist/eslint/react-compiler/config.js +0 -39
- package/dist/eslint/react-compiler/config.js.map +0 -1
- package/dist/eslint/react-refresh/config.d.ts +0 -16
- package/dist/eslint/react-refresh/config.js +0 -55
- package/dist/eslint/react-refresh/config.js.map +0 -1
- package/dist/eslint/react-refresh/rules.d.ts +0 -38
- package/dist/eslint/react-refresh/rules.js +0 -19
- package/dist/eslint/react-refresh/rules.js.map +0 -1
- package/dist/eslint/storybook/config.d.ts +0 -13
- package/dist/eslint/storybook/config.js +0 -67
- package/dist/eslint/storybook/config.js.map +0 -1
- package/dist/eslint/testing/config.d.ts +0 -25
- package/dist/eslint/testing/config.js +0 -169
- package/dist/eslint/testing/config.js.map +0 -1
- package/dist/eslint/testing/jest-rules.d.ts +0 -14
- package/dist/eslint/testing/jest-rules.js +0 -44
- package/dist/eslint/testing/jest-rules.js.map +0 -1
- package/dist/eslint/testing/vitest-rules.d.ts +0 -14
- package/dist/eslint/testing/vitest-rules.js +0 -50
- package/dist/eslint/testing/vitest-rules.js.map +0 -1
- package/dist/eslint/turbo/config.d.ts +0 -12
- package/dist/eslint/turbo/config.js +0 -39
- package/dist/eslint/turbo/config.js.map +0 -1
- package/dist/eslint/turbo/types.d.ts +0 -11
- package/dist/eslint/turbo/types.js +0 -1
- package/dist/eslint/turbo/types.js.map +0 -1
- package/dist/eslint/types.d.ts +0 -11
- package/dist/eslint/types.js +0 -1
- package/dist/eslint/types.js.map +0 -1
- package/dist/eslint/typescript/config.d.ts +0 -11
- package/dist/eslint/typescript/config.js +0 -186
- package/dist/eslint/typescript/config.js.map +0 -1
- package/dist/eslint/typescript/rules.d.ts +0 -8
- package/dist/eslint/typescript/rules.js +0 -135
- package/dist/eslint/typescript/rules.js.map +0 -1
- package/dist/eslint/typescript/types.d.ts +0 -7
- package/dist/eslint/typescript/types.js +0 -1
- package/dist/eslint/typescript/types.js.map +0 -1
- package/dist/eslint/unicorn/config.d.ts +0 -11
- package/dist/eslint/unicorn/config.js +0 -113
- package/dist/eslint/unicorn/config.js.map +0 -1
- package/dist/eslint/unicorn/rules.d.ts +0 -8
- package/dist/eslint/unicorn/rules.js +0 -79
- package/dist/eslint/unicorn/rules.js.map +0 -1
- package/dist/modules.d.d.ts +0 -3
- package/dist/modules.d.js +0 -1
- package/dist/modules.d.js.map +0 -1
- package/dist/prettier/index.d.ts +0 -34
- package/dist/prettier/index.js +0 -132
- package/dist/prettier/index.js.map +0 -1
- package/dist/prettier/patch-tailwind-plugin.d.ts +0 -9
- package/dist/prettier/patch-tailwind-plugin.js +0 -72
- package/dist/prettier/patch-tailwind-plugin.js.map +0 -1
- package/dist/utils/is-type.d.ts +0 -44
- package/dist/utils/is-type.js +0 -28
- package/dist/utils/is-type.js.map +0 -1
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
// src/prettier/patch-tailwind-plugin.ts
|
|
2
|
-
import * as fs from "node:fs";
|
|
3
|
-
import * as path from "node:path";
|
|
4
|
-
var DECLARE_BLOCK = `declare module 'prettier' {
|
|
5
|
-
interface RequiredOptions extends PluginOptions {
|
|
6
|
-
}
|
|
7
|
-
interface ParserOptions extends PluginOptions {
|
|
8
|
-
}
|
|
9
|
-
}`;
|
|
10
|
-
var patchTailwindPlugin = () => {
|
|
11
|
-
try {
|
|
12
|
-
console.info(
|
|
13
|
-
"js-style-kit: Patching prettier-plugin-tailwindcss declaration file..."
|
|
14
|
-
);
|
|
15
|
-
let pluginPath;
|
|
16
|
-
const rootPath = path.join(
|
|
17
|
-
"node_modules",
|
|
18
|
-
"prettier-plugin-tailwindcss",
|
|
19
|
-
"dist",
|
|
20
|
-
"index.d.ts"
|
|
21
|
-
);
|
|
22
|
-
const packagePath = path.join(
|
|
23
|
-
process.cwd(),
|
|
24
|
-
"node_modules",
|
|
25
|
-
"prettier-plugin-tailwindcss",
|
|
26
|
-
"dist",
|
|
27
|
-
"index.d.ts"
|
|
28
|
-
);
|
|
29
|
-
if (fs.existsSync(rootPath)) {
|
|
30
|
-
pluginPath = rootPath;
|
|
31
|
-
} else if (fs.existsSync(packagePath)) {
|
|
32
|
-
pluginPath = packagePath;
|
|
33
|
-
} else {
|
|
34
|
-
console.warn(
|
|
35
|
-
"js-style-kit: prettier-plugin-tailwindcss not found, skipping patch"
|
|
36
|
-
);
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
console.info(`js-style-kit: Found plugin at ${pluginPath}`);
|
|
40
|
-
const backupPath = `${pluginPath}.backup`;
|
|
41
|
-
if (!fs.existsSync(backupPath)) {
|
|
42
|
-
fs.writeFileSync(backupPath, fs.readFileSync(pluginPath, "utf8"));
|
|
43
|
-
console.info("js-style-kit: Created backup of original declaration file");
|
|
44
|
-
}
|
|
45
|
-
const content = fs.readFileSync(pluginPath, "utf8");
|
|
46
|
-
if (!content.includes(DECLARE_BLOCK)) {
|
|
47
|
-
console.info(
|
|
48
|
-
"js-style-kit: No patching needed, declaration block not found or already patched"
|
|
49
|
-
);
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
const patchedContent = content.replace(
|
|
53
|
-
DECLARE_BLOCK,
|
|
54
|
-
"// Removed unsafe declare module statement"
|
|
55
|
-
);
|
|
56
|
-
fs.writeFileSync(pluginPath, patchedContent);
|
|
57
|
-
console.info(
|
|
58
|
-
"js-style-kit: Successfully patched prettier-plugin-tailwindcss declaration file"
|
|
59
|
-
);
|
|
60
|
-
return true;
|
|
61
|
-
} catch (error) {
|
|
62
|
-
console.error(
|
|
63
|
-
"js-style-kit: Error patching prettier-plugin-tailwindcss:",
|
|
64
|
-
error
|
|
65
|
-
);
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
export {
|
|
70
|
-
patchTailwindPlugin
|
|
71
|
-
};
|
|
72
|
-
//# sourceMappingURL=patch-tailwind-plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/prettier/patch-tailwind-plugin.ts"],"sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n\n/**\n * The exact declare statement to remove from the prettier-plugin-tailwindcss declaration file\n * This statement causes conflicts with other Prettier plugins\n */\nconst DECLARE_BLOCK = `declare module 'prettier' {\n interface RequiredOptions extends PluginOptions {\n }\n interface ParserOptions extends PluginOptions {\n }\n}`;\n\n/**\n * Patches the declaration file of prettier-plugin-tailwindcss to remove the unsafe declare statement\n * that can cause conflicts with other Prettier plugins.\n *\n * @returns True if the patch was applied or already in place, false if plugin was not found or error occurred\n */\nexport const patchTailwindPlugin = (): boolean => {\n try {\n console.info(\n \"js-style-kit: Patching prettier-plugin-tailwindcss declaration file...\",\n );\n\n // Find the location of prettier-plugin-tailwindcss\n // This will work regardless of where js-style-kit is installed\n let pluginPath: string | undefined;\n\n // First try from the project root\n const rootPath = path.join(\n \"node_modules\",\n \"prettier-plugin-tailwindcss\",\n \"dist\",\n \"index.d.ts\",\n );\n\n // Then try from js-style-kit's directory\n const packagePath = path.join(\n process.cwd(),\n \"node_modules\",\n \"prettier-plugin-tailwindcss\",\n \"dist\",\n \"index.d.ts\",\n );\n\n // Choose the path that exists\n if (fs.existsSync(rootPath)) {\n pluginPath = rootPath;\n } else if (fs.existsSync(packagePath)) {\n pluginPath = packagePath;\n } else {\n console.warn(\n \"js-style-kit: prettier-plugin-tailwindcss not found, skipping patch\",\n );\n return false;\n }\n\n console.info(`js-style-kit: Found plugin at ${pluginPath}`);\n\n // Create backup of original file if it doesn't exist already\n const backupPath = `${pluginPath}.backup`;\n if (!fs.existsSync(backupPath)) {\n fs.writeFileSync(backupPath, fs.readFileSync(pluginPath, \"utf8\"));\n console.info(\"js-style-kit: Created backup of original declaration file\");\n }\n\n // Read the file\n const content = fs.readFileSync(pluginPath, \"utf8\");\n\n // Check if already patched\n if (!content.includes(DECLARE_BLOCK)) {\n console.info(\n \"js-style-kit: No patching needed, declaration block not found or already patched\",\n );\n return true;\n }\n\n // Replace the declare block with a comment\n const patchedContent = content.replace(\n DECLARE_BLOCK,\n \"// Removed unsafe declare module statement\",\n );\n\n // Write the patched file back\n fs.writeFileSync(pluginPath, patchedContent);\n console.info(\n \"js-style-kit: Successfully patched prettier-plugin-tailwindcss declaration file\",\n );\n\n return true;\n } catch (error) {\n console.error(\n \"js-style-kit: Error patching prettier-plugin-tailwindcss:\",\n error,\n );\n return false;\n }\n};\n"],"mappings":";AAAA,YAAY,QAAQ;AACpB,YAAY,UAAU;AAMtB,IAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAaf,IAAM,sBAAsB,MAAe;AAChD,MAAI;AACF,YAAQ;AAAA,MACN;AAAA,IACF;AAIA,QAAI;AAGJ,UAAM,WAAgB;AAAA,MACpB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAGA,UAAM,cAAmB;AAAA,MACvB,QAAQ,IAAI;AAAA,MACZ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAGA,QAAO,cAAW,QAAQ,GAAG;AAC3B,mBAAa;AAAA,IACf,WAAc,cAAW,WAAW,GAAG;AACrC,mBAAa;AAAA,IACf,OAAO;AACL,cAAQ;AAAA,QACN;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAEA,YAAQ,KAAK,iCAAiC,UAAU,EAAE;AAG1D,UAAM,aAAa,GAAG,UAAU;AAChC,QAAI,CAAI,cAAW,UAAU,GAAG;AAC9B,MAAG,iBAAc,YAAe,gBAAa,YAAY,MAAM,CAAC;AAChE,cAAQ,KAAK,2DAA2D;AAAA,IAC1E;AAGA,UAAM,UAAa,gBAAa,YAAY,MAAM;AAGlD,QAAI,CAAC,QAAQ,SAAS,aAAa,GAAG;AACpC,cAAQ;AAAA,QACN;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAGA,UAAM,iBAAiB,QAAQ;AAAA,MAC7B;AAAA,MACA;AAAA,IACF;AAGA,IAAG,iBAAc,YAAY,cAAc;AAC3C,YAAQ;AAAA,MACN;AAAA,IACF;AAEA,WAAO;AAAA,EACT,SAAS,OAAO;AACd,YAAQ;AAAA,MACN;AAAA,MACA;AAAA,IACF;AACA,WAAO;AAAA,EACT;AACF;","names":[]}
|
package/dist/utils/is-type.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type predicate for string values
|
|
3
|
-
*
|
|
4
|
-
* @param value - The value to check
|
|
5
|
-
* @returns True if the value is a string, false otherwise
|
|
6
|
-
*/
|
|
7
|
-
declare const isString: (value: unknown) => value is string;
|
|
8
|
-
/**
|
|
9
|
-
* Type predicate for number values
|
|
10
|
-
*
|
|
11
|
-
* @param value - The value to check
|
|
12
|
-
* @returns True if the value is a number and not NaN, false otherwise
|
|
13
|
-
*/
|
|
14
|
-
declare const isNumber: (value: unknown) => value is number;
|
|
15
|
-
/**
|
|
16
|
-
* Type predicate for boolean values
|
|
17
|
-
*
|
|
18
|
-
* @param value - The value to check
|
|
19
|
-
* @returns True if the value is a boolean, false otherwise
|
|
20
|
-
*/
|
|
21
|
-
declare const isBoolean: (value: unknown) => value is boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Type predicate for array values
|
|
24
|
-
*
|
|
25
|
-
* @param value - The value to check
|
|
26
|
-
* @returns True if the value is an array, false otherwise
|
|
27
|
-
*/
|
|
28
|
-
declare const isArray: <T = unknown>(value: unknown) => value is T[];
|
|
29
|
-
/**
|
|
30
|
-
* Type predicate for object values (excluding null and arrays)
|
|
31
|
-
*
|
|
32
|
-
* @param value - The value to check
|
|
33
|
-
* @returns True if the value is an object (not null and not an array), false otherwise
|
|
34
|
-
*/
|
|
35
|
-
declare const isObject: (value: unknown) => value is Record<string, unknown>;
|
|
36
|
-
/**
|
|
37
|
-
* Type predicate for function values
|
|
38
|
-
*
|
|
39
|
-
* @param value - The value to check
|
|
40
|
-
* @returns True if the value is a function, false otherwise
|
|
41
|
-
*/
|
|
42
|
-
declare const isFunction: (value: unknown) => value is Function;
|
|
43
|
-
|
|
44
|
-
export { isArray, isBoolean, isFunction, isNumber, isObject, isString };
|
package/dist/utils/is-type.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// src/utils/is-type.ts
|
|
2
|
-
var isString = (value) => {
|
|
3
|
-
return typeof value === "string";
|
|
4
|
-
};
|
|
5
|
-
var isNumber = (value) => {
|
|
6
|
-
return typeof value === "number" && !Number.isNaN(value);
|
|
7
|
-
};
|
|
8
|
-
var isBoolean = (value) => {
|
|
9
|
-
return typeof value === "boolean";
|
|
10
|
-
};
|
|
11
|
-
var isArray = (value) => {
|
|
12
|
-
return Array.isArray(value);
|
|
13
|
-
};
|
|
14
|
-
var isObject = (value) => {
|
|
15
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
16
|
-
};
|
|
17
|
-
var isFunction = (value) => {
|
|
18
|
-
return typeof value === "function";
|
|
19
|
-
};
|
|
20
|
-
export {
|
|
21
|
-
isArray,
|
|
22
|
-
isBoolean,
|
|
23
|
-
isFunction,
|
|
24
|
-
isNumber,
|
|
25
|
-
isObject,
|
|
26
|
-
isString
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=is-type.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/is-type.ts"],"sourcesContent":["/**\n * Type predicate for string values\n *\n * @param value - The value to check\n * @returns True if the value is a string, false otherwise\n */\nexport const isString = (value: unknown): value is string => {\n return typeof value === \"string\";\n};\n\n/**\n * Type predicate for number values\n *\n * @param value - The value to check\n * @returns True if the value is a number and not NaN, false otherwise\n */\nexport const isNumber = (value: unknown): value is number => {\n return typeof value === \"number\" && !Number.isNaN(value);\n};\n\n/**\n * Type predicate for boolean values\n *\n * @param value - The value to check\n * @returns True if the value is a boolean, false otherwise\n */\nexport const isBoolean = (value: unknown): value is boolean => {\n return typeof value === \"boolean\";\n};\n\n/**\n * Type predicate for array values\n *\n * @param value - The value to check\n * @returns True if the value is an array, false otherwise\n */\nexport const isArray = <T = unknown>(value: unknown): value is T[] => {\n return Array.isArray(value);\n};\n\n/**\n * Type predicate for object values (excluding null and arrays)\n *\n * @param value - The value to check\n * @returns True if the value is an object (not null and not an array), false otherwise\n */\nexport const isObject = (value: unknown): value is Record<string, unknown> => {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n};\n\n/**\n * Type predicate for function values\n *\n * @param value - The value to check\n * @returns True if the value is a function, false otherwise\n */\n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\nexport const isFunction = (value: unknown): value is Function => {\n return typeof value === \"function\";\n};\n"],"mappings":";AAMO,IAAM,WAAW,CAAC,UAAoC;AAC3D,SAAO,OAAO,UAAU;AAC1B;AAQO,IAAM,WAAW,CAAC,UAAoC;AAC3D,SAAO,OAAO,UAAU,YAAY,CAAC,OAAO,MAAM,KAAK;AACzD;AAQO,IAAM,YAAY,CAAC,UAAqC;AAC7D,SAAO,OAAO,UAAU;AAC1B;AAQO,IAAM,UAAU,CAAc,UAAiC;AACpE,SAAO,MAAM,QAAQ,KAAK;AAC5B;AAQO,IAAM,WAAW,CAAC,UAAqD;AAC5E,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AASO,IAAM,aAAa,CAAC,UAAsC;AAC/D,SAAO,OAAO,UAAU;AAC1B;","names":[]}
|