js-style-kit 0.2.3 → 0.2.5
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/README.md +35 -0
- package/dist/bin/index.js +9 -3
- package/dist/bin/index.js.map +1 -1
- package/dist/chunk-2ASX5K3P.js +45 -0
- package/dist/chunk-2ASX5K3P.js.map +1 -0
- package/dist/{chunk-BDTLNELO.js → chunk-2EO7WKUA.js} +3 -1
- package/dist/{chunk-BDTLNELO.js.map → chunk-2EO7WKUA.js.map} +1 -1
- package/dist/{chunk-XHFTPVHK.js → chunk-3PBWLBKQ.js} +5 -5
- package/dist/{chunk-FJNJWCYG.js → chunk-5CDPACBF.js} +2 -2
- package/dist/{chunk-NPTVKFZO.js → chunk-D2NUXSOP.js} +2 -2
- package/dist/{chunk-LYJZ2BXK.js → chunk-DXH4IKTS.js} +2 -2
- package/dist/{chunk-PB5PHG6U.js → chunk-DXJEC5GK.js} +4 -2
- package/dist/chunk-DXJEC5GK.js.map +1 -0
- package/dist/{chunk-E53SVIZM.js → chunk-HUTRDRS3.js} +5 -1
- package/dist/chunk-HUTRDRS3.js.map +1 -0
- package/dist/{chunk-V3QNQKET.js → chunk-KYBK4TYC.js} +2 -2
- package/dist/{chunk-2EXCSH5L.js → chunk-L4LQOBUL.js} +2 -2
- package/dist/{chunk-HN2CEVC4.js → chunk-NM7R77WJ.js} +2 -2
- package/dist/{chunk-TA2KEF22.js → chunk-NUREJELC.js} +2 -2
- package/dist/{chunk-IKA5P3EP.js → chunk-S3BOQC2P.js} +20 -12
- package/dist/chunk-S3BOQC2P.js.map +1 -0
- package/dist/{chunk-DR4DHSO2.js → chunk-TIF7G5QI.js} +2 -2
- package/dist/{chunk-I4GUWATW.js → chunk-Z6KYKZMZ.js} +2 -2
- package/dist/eslint/base/config.js +2 -2
- package/dist/eslint/constants.d.ts +2 -0
- package/dist/eslint/constants.js +1 -1
- package/dist/eslint/ignores.d.ts +3 -1
- package/dist/eslint/ignores.js +2 -2
- package/dist/eslint/index.d.ts +3 -1
- package/dist/eslint/index.js +15 -14
- package/dist/eslint/jsdoc/config.js +2 -2
- package/dist/eslint/perfectionist/config.js +2 -2
- package/dist/eslint/prefer-arrow-function/config.js +2 -2
- package/dist/eslint/react/config.js +2 -2
- package/dist/eslint/react-compiler/config.js +2 -2
- package/dist/eslint/storybook/config.d.ts +13 -0
- package/dist/eslint/storybook/config.js +8 -0
- package/dist/eslint/storybook/config.js.map +1 -0
- package/dist/eslint/testing/config.js +3 -3
- package/dist/eslint/turbo/config.js +2 -2
- package/dist/eslint/typescript/config.js +2 -2
- package/dist/eslint/unicorn/config.js +2 -2
- package/dist/index.js +16 -15
- package/dist/prettier/index.d.ts +3 -0
- package/dist/prettier/index.js +1 -1
- package/package.json +6 -4
- package/dist/chunk-E53SVIZM.js.map +0 -1
- package/dist/chunk-IKA5P3EP.js.map +0 -1
- package/dist/chunk-PB5PHG6U.js.map +0 -1
- /package/dist/{chunk-XHFTPVHK.js.map → chunk-3PBWLBKQ.js.map} +0 -0
- /package/dist/{chunk-FJNJWCYG.js.map → chunk-5CDPACBF.js.map} +0 -0
- /package/dist/{chunk-NPTVKFZO.js.map → chunk-D2NUXSOP.js.map} +0 -0
- /package/dist/{chunk-LYJZ2BXK.js.map → chunk-DXH4IKTS.js.map} +0 -0
- /package/dist/{chunk-V3QNQKET.js.map → chunk-KYBK4TYC.js.map} +0 -0
- /package/dist/{chunk-2EXCSH5L.js.map → chunk-L4LQOBUL.js.map} +0 -0
- /package/dist/{chunk-HN2CEVC4.js.map → chunk-NM7R77WJ.js.map} +0 -0
- /package/dist/{chunk-TA2KEF22.js.map → chunk-NUREJELC.js.map} +0 -0
- /package/dist/{chunk-DR4DHSO2.js.map → chunk-TIF7G5QI.js.map} +0 -0
- /package/dist/{chunk-I4GUWATW.js.map → chunk-Z6KYKZMZ.js.map} +0 -0
package/README.md
CHANGED
|
@@ -82,6 +82,7 @@ export default eslintConfig({
|
|
|
82
82
|
jsdoc: { requireJsdoc: false }, // JSDoc configuration or false to disable
|
|
83
83
|
react: false, // Whether to include React rules, see below for options
|
|
84
84
|
sorting: true, // Whether to include sorting rules from Perfectionist
|
|
85
|
+
storybook: false, // Whether to include Storybook rules
|
|
85
86
|
typescript: true, // Boolean or string path to tsconfig.json
|
|
86
87
|
});
|
|
87
88
|
```
|
|
@@ -176,6 +177,21 @@ Sorting/organization rules from the Perfectionist plugin are enabled by default:
|
|
|
176
177
|
sorting: false;
|
|
177
178
|
```
|
|
178
179
|
|
|
180
|
+
#### Storybook Configuration
|
|
181
|
+
|
|
182
|
+
Storybook support is disabled by default, but can be enabled to provide linting rules specifically for Storybook files:
|
|
183
|
+
|
|
184
|
+
```js
|
|
185
|
+
// Enable Storybook rules
|
|
186
|
+
storybook: true;
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
When enabled, this configuration:
|
|
190
|
+
|
|
191
|
+
- Applies best practices for Storybook files (_.stories._ and _.story._)
|
|
192
|
+
- Includes rules for Storybook configuration files (.storybook/main.\*)
|
|
193
|
+
- Ensures the .storybook directory is not ignored by ESLint (adds a negation pattern to ignores)
|
|
194
|
+
|
|
179
195
|
### Adding Custom ESLint Configurations
|
|
180
196
|
|
|
181
197
|
You can extend the base configuration by providing additional ESLint config objects as rest parameters:
|
|
@@ -247,6 +263,7 @@ import { prettierConfig } from "js-style-kit";
|
|
|
247
263
|
export default prettierConfig({
|
|
248
264
|
// All options shown with their default values
|
|
249
265
|
cssOrderPlugin: true, // Enable CSS order plugin
|
|
266
|
+
curlyPlugin: true, // Enable curly braces enforcement for all control statements
|
|
250
267
|
jsonSortPlugin: true, // Enable JSON sorting plugin
|
|
251
268
|
packageJsonPlugin: true, // Enable package.json sorting plugin
|
|
252
269
|
tailwindPlugin: false, // Enable Tailwind CSS plugin (boolean, string[], or options object)
|
|
@@ -285,6 +302,24 @@ The CSS order plugin is enabled by default. It sorts CSS properties in a consist
|
|
|
285
302
|
cssOrderPlugin: false;
|
|
286
303
|
```
|
|
287
304
|
|
|
305
|
+
#### Curly Braces Enforcement
|
|
306
|
+
|
|
307
|
+
The curly braces plugin is disabled by default. It enforces consistent use of curly braces for all control flow statements (`if`, `for`, `while`, etc.), even for single-line statements. This is equivalent to ESLint's `curly` rule with the `all` option, but applied at the Prettier formatting level:
|
|
308
|
+
|
|
309
|
+
```diff
|
|
310
|
+
- if (abc) def;
|
|
311
|
+
+ if (abc) {
|
|
312
|
+
+ def;
|
|
313
|
+
+ }
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
You can disable it:
|
|
317
|
+
|
|
318
|
+
```js
|
|
319
|
+
// Disable curly braces enforcement
|
|
320
|
+
curlyPlugin: false;
|
|
321
|
+
```
|
|
322
|
+
|
|
288
323
|
#### JSON Sorting
|
|
289
324
|
|
|
290
325
|
The JSON sorting plugin is enabled by default. You can disable it or configure it:
|
package/dist/bin/index.js
CHANGED
|
@@ -3357,9 +3357,15 @@ program2.name("js-style-kit").description(
|
|
|
3357
3357
|
"Initialize JavaScript/TypeScript project with style configurations"
|
|
3358
3358
|
).version("1.0.0");
|
|
3359
3359
|
var detectPackageManager = () => {
|
|
3360
|
-
if (fs.existsSync("bun.lock") || fs.existsSync("bun.lockb"))
|
|
3361
|
-
|
|
3362
|
-
|
|
3360
|
+
if (fs.existsSync("bun.lock") || fs.existsSync("bun.lockb")) {
|
|
3361
|
+
return "bun";
|
|
3362
|
+
}
|
|
3363
|
+
if (fs.existsSync("pnpm-lock.yaml")) {
|
|
3364
|
+
return "pnpm";
|
|
3365
|
+
}
|
|
3366
|
+
if (fs.existsSync("yarn.lock")) {
|
|
3367
|
+
return "yarn";
|
|
3368
|
+
}
|
|
3363
3369
|
return "npm";
|
|
3364
3370
|
};
|
|
3365
3371
|
var setupDependencies = (packageManager) => {
|