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.
Files changed (59) hide show
  1. package/README.md +35 -0
  2. package/dist/bin/index.js +9 -3
  3. package/dist/bin/index.js.map +1 -1
  4. package/dist/chunk-2ASX5K3P.js +45 -0
  5. package/dist/chunk-2ASX5K3P.js.map +1 -0
  6. package/dist/{chunk-BDTLNELO.js → chunk-2EO7WKUA.js} +3 -1
  7. package/dist/{chunk-BDTLNELO.js.map → chunk-2EO7WKUA.js.map} +1 -1
  8. package/dist/{chunk-XHFTPVHK.js → chunk-3PBWLBKQ.js} +5 -5
  9. package/dist/{chunk-FJNJWCYG.js → chunk-5CDPACBF.js} +2 -2
  10. package/dist/{chunk-NPTVKFZO.js → chunk-D2NUXSOP.js} +2 -2
  11. package/dist/{chunk-LYJZ2BXK.js → chunk-DXH4IKTS.js} +2 -2
  12. package/dist/{chunk-PB5PHG6U.js → chunk-DXJEC5GK.js} +4 -2
  13. package/dist/chunk-DXJEC5GK.js.map +1 -0
  14. package/dist/{chunk-E53SVIZM.js → chunk-HUTRDRS3.js} +5 -1
  15. package/dist/chunk-HUTRDRS3.js.map +1 -0
  16. package/dist/{chunk-V3QNQKET.js → chunk-KYBK4TYC.js} +2 -2
  17. package/dist/{chunk-2EXCSH5L.js → chunk-L4LQOBUL.js} +2 -2
  18. package/dist/{chunk-HN2CEVC4.js → chunk-NM7R77WJ.js} +2 -2
  19. package/dist/{chunk-TA2KEF22.js → chunk-NUREJELC.js} +2 -2
  20. package/dist/{chunk-IKA5P3EP.js → chunk-S3BOQC2P.js} +20 -12
  21. package/dist/chunk-S3BOQC2P.js.map +1 -0
  22. package/dist/{chunk-DR4DHSO2.js → chunk-TIF7G5QI.js} +2 -2
  23. package/dist/{chunk-I4GUWATW.js → chunk-Z6KYKZMZ.js} +2 -2
  24. package/dist/eslint/base/config.js +2 -2
  25. package/dist/eslint/constants.d.ts +2 -0
  26. package/dist/eslint/constants.js +1 -1
  27. package/dist/eslint/ignores.d.ts +3 -1
  28. package/dist/eslint/ignores.js +2 -2
  29. package/dist/eslint/index.d.ts +3 -1
  30. package/dist/eslint/index.js +15 -14
  31. package/dist/eslint/jsdoc/config.js +2 -2
  32. package/dist/eslint/perfectionist/config.js +2 -2
  33. package/dist/eslint/prefer-arrow-function/config.js +2 -2
  34. package/dist/eslint/react/config.js +2 -2
  35. package/dist/eslint/react-compiler/config.js +2 -2
  36. package/dist/eslint/storybook/config.d.ts +13 -0
  37. package/dist/eslint/storybook/config.js +8 -0
  38. package/dist/eslint/storybook/config.js.map +1 -0
  39. package/dist/eslint/testing/config.js +3 -3
  40. package/dist/eslint/turbo/config.js +2 -2
  41. package/dist/eslint/typescript/config.js +2 -2
  42. package/dist/eslint/unicorn/config.js +2 -2
  43. package/dist/index.js +16 -15
  44. package/dist/prettier/index.d.ts +3 -0
  45. package/dist/prettier/index.js +1 -1
  46. package/package.json +6 -4
  47. package/dist/chunk-E53SVIZM.js.map +0 -1
  48. package/dist/chunk-IKA5P3EP.js.map +0 -1
  49. package/dist/chunk-PB5PHG6U.js.map +0 -1
  50. /package/dist/{chunk-XHFTPVHK.js.map → chunk-3PBWLBKQ.js.map} +0 -0
  51. /package/dist/{chunk-FJNJWCYG.js.map → chunk-5CDPACBF.js.map} +0 -0
  52. /package/dist/{chunk-NPTVKFZO.js.map → chunk-D2NUXSOP.js.map} +0 -0
  53. /package/dist/{chunk-LYJZ2BXK.js.map → chunk-DXH4IKTS.js.map} +0 -0
  54. /package/dist/{chunk-V3QNQKET.js.map → chunk-KYBK4TYC.js.map} +0 -0
  55. /package/dist/{chunk-2EXCSH5L.js.map → chunk-L4LQOBUL.js.map} +0 -0
  56. /package/dist/{chunk-HN2CEVC4.js.map → chunk-NM7R77WJ.js.map} +0 -0
  57. /package/dist/{chunk-TA2KEF22.js.map → chunk-NUREJELC.js.map} +0 -0
  58. /package/dist/{chunk-DR4DHSO2.js.map → chunk-TIF7G5QI.js.map} +0 -0
  59. /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")) 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) => {