js-style-kit 0.2.2 → 0.2.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/README.md CHANGED
@@ -247,6 +247,7 @@ import { prettierConfig } from "js-style-kit";
247
247
  export default prettierConfig({
248
248
  // All options shown with their default values
249
249
  cssOrderPlugin: true, // Enable CSS order plugin
250
+ curlyPlugin: true, // Enable curly braces enforcement for all control statements
250
251
  jsonSortPlugin: true, // Enable JSON sorting plugin
251
252
  packageJsonPlugin: true, // Enable package.json sorting plugin
252
253
  tailwindPlugin: false, // Enable Tailwind CSS plugin (boolean, string[], or options object)
@@ -285,6 +286,24 @@ The CSS order plugin is enabled by default. It sorts CSS properties in a consist
285
286
  cssOrderPlugin: false;
286
287
  ```
287
288
 
289
+ #### Curly Braces Enforcement
290
+
291
+ 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:
292
+
293
+ ```diff
294
+ - if (abc) def;
295
+ + if (abc) {
296
+ + def;
297
+ + }
298
+ ```
299
+
300
+ You can disable it:
301
+
302
+ ```js
303
+ // Disable curly braces enforcement
304
+ curlyPlugin: false;
305
+ ```
306
+
288
307
  #### JSON Sorting
289
308
 
290
309
  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")) return "bun";
3361
- if (fs.existsSync("pnpm-lock.yaml")) return "pnpm";
3362
- if (fs.existsSync("yarn.lock")) return "yarn";
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) => {