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 +19 -0
- package/dist/bin/index.js +9 -3
- package/dist/bin/index.js.map +1 -1
- package/dist/{chunk-E53SVIZM.js → chunk-HUTRDRS3.js} +5 -1
- package/dist/chunk-HUTRDRS3.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/prettier/index.d.ts +3 -0
- package/dist/prettier/index.js +1 -1
- package/dist/scripts/postinstall.cjs +91 -0
- package/dist/scripts/postinstall.cjs.map +1 -0
- package/dist/scripts/postinstall.js +29 -20
- package/dist/scripts/postinstall.js.map +1 -1
- package/package.json +3 -2
- package/dist/chunk-E53SVIZM.js.map +0 -1
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"))
|
|
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) => {
|