@anolilab/prettier-config 4.0.6 → 4.0.7

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/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## @anolilab/prettier-config [4.0.7](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/prettier-config@4.0.6...@anolilab/prettier-config@4.0.7) (2023-06-22)
2
+
3
+
4
+
5
+ ### Dependencies
6
+
7
+ * **@anolilab/package-json-utils:** upgraded to 1.4.0
8
+ * **@anolilab/semantic-release-preset:** upgraded to 3.1.2
9
+
1
10
  ## @anolilab/prettier-config [4.0.6](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/prettier-config@4.0.5...@anolilab/prettier-config@4.0.6) (2023-06-15)
2
11
 
3
12
 
package/README.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  Anolilab Coding Standard for semantic-release.
4
4
 
5
+
6
+ <div align="center">
7
+
8
+ [![typescript-image]][typescript-url] [![npm-image]][npm-url] [![license-image]][license-url]
9
+
10
+ </div>
11
+
5
12
  ---
6
13
 
7
14
  <div align="center">
@@ -14,42 +21,65 @@ Anolilab Coding Standard for semantic-release.
14
21
 
15
22
  ---
16
23
 
24
+
17
25
  ## Install
18
26
 
19
27
  ```bash
20
28
  npm install --dev-save @anolilab/prettier-config
21
29
  ```
22
30
 
23
- ## Usage
31
+ ```sh
32
+ yarn add -D eslint @anolilab/prettier-config
33
+ ```
24
34
 
25
- If you don’t have a `.prettierrc.cjs` and `.prettierignore`, we will create the file for you after installing `@anolilab/prettier-config`.
35
+ ```sh
36
+ pnpm add -D eslint @anolilab/prettier-config
37
+ ```
26
38
 
27
- If you already have a `.prettierrc.cjs` and `.prettierignore`, then you can extend the `.prettierrc.cjs`, with `@anolilab/prettier-config`.
39
+ ## Usage
28
40
 
29
- ```js
30
- module.exports = {
31
- "printWidth": 120,
32
- "tabWidth": 4,
33
- "useTabs": false,
34
- "semi": true,
35
- "singleQuote": false,
36
- "quoteProps": "as-needed",
37
- "jsxSingleQuote": false,
38
- "trailingComma": "all",
39
- "bracketSpacing": true,
40
- "jsxBracketSameLine": false,
41
- "arrowParens": "always",
42
- "rangeStart": 0,
43
- "rangeEnd": Infinity,
44
- "requirePragma": false,
45
- "insertPragma": false,
46
- "proseWrap": "preserve",
47
- "htmlWhitespaceSensitivity": "css",
48
- "vueIndentScriptAndStyle": false,
49
- "endOfLine": "lf",
50
- "embeddedLanguageFormatting": "auto"
51
- };
41
+ If you don’t have a `.prettierrc.{c|m}js` and `.prettierignore`, we will create the file for you after installing `@anolilab/prettier-config`.
52
42
 
43
+ ```js
44
+ {
45
+ // max 160 characters per line
46
+ printWidth: 160,
47
+ // use 4 spaces for indentation
48
+ tabWidth: 4,
49
+ // use spaces instead of indentations
50
+ useTabs: false,
51
+ // semicolon at the end of the line
52
+ semi: true,
53
+ // use single quotes
54
+ singleQuote: false,
55
+ // object's key is quoted only when necessary
56
+ quoteProps: "as-needed",
57
+ // use double quotes instead of single quotes in jsx
58
+ jsxSingleQuote: false,
59
+ // all comma at the end
60
+ trailingComma: "all",
61
+ // spaces are required at the beginning and end of the braces
62
+ bracketSpacing: true,
63
+ // brackets are required for arrow function parameter, even when there is only one parameter
64
+ arrowParens: "always",
65
+ // format the entire contents of the file
66
+ rangeStart: 0,
67
+ rangeEnd: Number.POSITIVE_INFINITY,
68
+ // no need to write the beginning @prettier of the file
69
+ requirePragma: false,
70
+ // No need to automatically insert @prettier at the beginning of the file
71
+ insertPragma: false,
72
+ // use default break criteria
73
+ proseWrap: "preserve",
74
+ // decide whether to break the html according to the display style
75
+ htmlWhitespaceSensitivity: "css",
76
+ // vue files script and style tags indentation
77
+ vueIndentScriptAndStyle: false,
78
+ // lf for newline
79
+ endOfLine: "lf",
80
+ // formats quoted code embedded
81
+ embeddedLanguageFormatting: "auto",
82
+ }
53
83
  ```
54
84
 
55
85
  ## Supported Node.js Versions
@@ -75,3 +105,10 @@ License
75
105
  -------------
76
106
 
77
107
  The anolilab javascript-style-guide is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT)
108
+
109
+ [typescript-image]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
110
+ [typescript-url]: "typescript"
111
+ [license-image]: https://img.shields.io/npm/l/@anolilab/prettier-config?color=blueviolet&style=for-the-badge
112
+ [license-url]: LICENSE.md "license"
113
+ [npm-image]: https://img.shields.io/npm/v/@anolilab/prettier-config/latest.svg?style=for-the-badge&logo=npm
114
+ [npm-url]: https://www.npmjs.com/package/@anolilab/prettier-config/v/latest "npm"
@@ -1,5 +1,5 @@
1
- var e={printWidth:164,tabWidth:4,useTabs:!1,semi:!0,singleQuote:!1,quoteProps:"as-needed",jsxSingleQuote:!1,trailingComma:"all",bracketSpacing:!0,arrowParens:"always",rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,requirePragma:!1,insertPragma:!1,proseWrap:"preserve",htmlWhitespaceSensitivity:"css",vueIndentScriptAndStyle:!1,endOfLine:"lf",embeddedLanguageFormatting:"auto"},t=e;
1
+ var e={printWidth:160,tabWidth:4,useTabs:!1,semi:!0,singleQuote:!1,quoteProps:"as-needed",jsxSingleQuote:!1,trailingComma:"all",bracketSpacing:!0,arrowParens:"always",rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,requirePragma:!1,insertPragma:!1,proseWrap:"preserve",htmlWhitespaceSensitivity:"css",vueIndentScriptAndStyle:!1,endOfLine:"lf",embeddedLanguageFormatting:"auto"},t=e;
2
2
 
3
3
  export { t as a };
4
4
  //# sourceMappingURL=out.js.map
5
- //# sourceMappingURL=chunk-YVQ27E43.mjs.map
5
+ //# sourceMappingURL=chunk-D3AEYP6U.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["config","src_default"],"mappings":"AAEA,IAAMA,EAAkB,CAEpB,WAAY,IAEZ,SAAU,EAEV,QAAS,GAET,KAAM,GAEN,YAAa,GAEb,WAAY,YAEZ,eAAgB,GAEhB,cAAe,MAEf,eAAgB,GAEhB,YAAa,SAEb,WAAY,EACZ,SAAU,OAAO,kBAEjB,cAAe,GAEf,aAAc,GAEd,UAAW,WAEX,0BAA2B,MAE3B,wBAAyB,GAEzB,UAAW,KAEX,2BAA4B,MAChC,EAEOC,EAAQD","sourcesContent":["import type { Options } from \"prettier\";\n\nconst config: Options = {\n // max 164 characters per line\n printWidth: 164,\n // use 4 spaces for indentation\n tabWidth: 4,\n // use spaces instead of indentations\n useTabs: false,\n // semicolon at the end of the line\n semi: true,\n // use single quotes\n singleQuote: false,\n // object's key is quoted only when necessary\n quoteProps: \"as-needed\",\n // use double quotes instead of single quotes in jsx\n jsxSingleQuote: false,\n // all comma at the end\n trailingComma: \"all\",\n // spaces are required at the beginning and end of the braces\n bracketSpacing: true,\n // brackets are required for arrow function parameter, even when there is only one parameter\n arrowParens: \"always\",\n // format the entire contents of the file\n rangeStart: 0,\n rangeEnd: Number.POSITIVE_INFINITY,\n // no need to write the beginning @prettier of the file\n requirePragma: false,\n // No need to automatically insert @prettier at the beginning of the file\n insertPragma: false,\n // use default break criteria\n proseWrap: \"preserve\",\n // decide whether to break the html according to the display style\n htmlWhitespaceSensitivity: \"css\",\n // vue files script and style tags indentation\n vueIndentScriptAndStyle: false,\n // lf for newline\n endOfLine: \"lf\",\n // formats quoted code embedded\n embeddedLanguageFormatting: \"auto\",\n};\n\nexport default config;\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":["config","src_default"],"mappings":"AAEA,IAAMA,EAAkB,CAEpB,WAAY,IAEZ,SAAU,EAEV,QAAS,GAET,KAAM,GAEN,YAAa,GAEb,WAAY,YAEZ,eAAgB,GAEhB,cAAe,MAEf,eAAgB,GAEhB,YAAa,SAEb,WAAY,EACZ,SAAU,OAAO,kBAEjB,cAAe,GAEf,aAAc,GAEd,UAAW,WAEX,0BAA2B,MAE3B,wBAAyB,GAEzB,UAAW,KAEX,2BAA4B,MAChC,EAEOC,EAAQD","sourcesContent":["import type { Options } from \"prettier\";\n\nconst config: Options = {\n // max 160 characters per line\n printWidth: 160,\n // use 4 spaces for indentation\n tabWidth: 4,\n // use spaces instead of indentations\n useTabs: false,\n // semicolon at the end of the line\n semi: true,\n // use single quotes\n singleQuote: false,\n // object's key is quoted only when necessary\n quoteProps: \"as-needed\",\n // use double quotes instead of single quotes in jsx\n jsxSingleQuote: false,\n // all comma at the end\n trailingComma: \"all\",\n // spaces are required at the beginning and end of the braces\n bracketSpacing: true,\n // brackets are required for arrow function parameter, even when there is only one parameter\n arrowParens: \"always\",\n // format the entire contents of the file\n rangeStart: 0,\n rangeEnd: Number.POSITIVE_INFINITY,\n // no need to write the beginning @prettier of the file\n requirePragma: false,\n // No need to automatically insert @prettier at the beginning of the file\n insertPragma: false,\n // use default break criteria\n proseWrap: \"preserve\",\n // decide whether to break the html according to the display style\n htmlWhitespaceSensitivity: \"css\",\n // vue files script and style tags indentation\n vueIndentScriptAndStyle: false,\n // lf for newline\n endOfLine: \"lf\",\n // formats quoted code embedded\n embeddedLanguageFormatting: \"auto\",\n};\n\nexport default config;\n"]}
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var e={printWidth:164,tabWidth:4,useTabs:!1,semi:!0,singleQuote:!1,quoteProps:"as-needed",jsxSingleQuote:!1,trailingComma:"all",bracketSpacing:!0,arrowParens:"always",rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,requirePragma:!1,insertPragma:!1,proseWrap:"preserve",htmlWhitespaceSensitivity:"css",vueIndentScriptAndStyle:!1,endOfLine:"lf",embeddedLanguageFormatting:"auto"},t=e;
3
+ var e={printWidth:160,tabWidth:4,useTabs:!1,semi:!0,singleQuote:!1,quoteProps:"as-needed",jsxSingleQuote:!1,trailingComma:"all",bracketSpacing:!0,arrowParens:"always",rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,requirePragma:!1,insertPragma:!1,proseWrap:"preserve",htmlWhitespaceSensitivity:"css",vueIndentScriptAndStyle:!1,endOfLine:"lf",embeddedLanguageFormatting:"auto"},t=e;
4
4
 
5
5
  exports.a = t;
6
6
  //# sourceMappingURL=out.js.map
7
- //# sourceMappingURL=chunk-NAA7XF5C.js.map
7
+ //# sourceMappingURL=chunk-LL7RB26L.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["config","src_default"],"mappings":"AAEA,IAAMA,EAAkB,CAEpB,WAAY,IAEZ,SAAU,EAEV,QAAS,GAET,KAAM,GAEN,YAAa,GAEb,WAAY,YAEZ,eAAgB,GAEhB,cAAe,MAEf,eAAgB,GAEhB,YAAa,SAEb,WAAY,EACZ,SAAU,OAAO,kBAEjB,cAAe,GAEf,aAAc,GAEd,UAAW,WAEX,0BAA2B,MAE3B,wBAAyB,GAEzB,UAAW,KAEX,2BAA4B,MAChC,EAEOC,EAAQD","sourcesContent":["import type { Options } from \"prettier\";\n\nconst config: Options = {\n // max 164 characters per line\n printWidth: 164,\n // use 4 spaces for indentation\n tabWidth: 4,\n // use spaces instead of indentations\n useTabs: false,\n // semicolon at the end of the line\n semi: true,\n // use single quotes\n singleQuote: false,\n // object's key is quoted only when necessary\n quoteProps: \"as-needed\",\n // use double quotes instead of single quotes in jsx\n jsxSingleQuote: false,\n // all comma at the end\n trailingComma: \"all\",\n // spaces are required at the beginning and end of the braces\n bracketSpacing: true,\n // brackets are required for arrow function parameter, even when there is only one parameter\n arrowParens: \"always\",\n // format the entire contents of the file\n rangeStart: 0,\n rangeEnd: Number.POSITIVE_INFINITY,\n // no need to write the beginning @prettier of the file\n requirePragma: false,\n // No need to automatically insert @prettier at the beginning of the file\n insertPragma: false,\n // use default break criteria\n proseWrap: \"preserve\",\n // decide whether to break the html according to the display style\n htmlWhitespaceSensitivity: \"css\",\n // vue files script and style tags indentation\n vueIndentScriptAndStyle: false,\n // lf for newline\n endOfLine: \"lf\",\n // formats quoted code embedded\n embeddedLanguageFormatting: \"auto\",\n};\n\nexport default config;\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":["config","src_default"],"mappings":"AAEA,IAAMA,EAAkB,CAEpB,WAAY,IAEZ,SAAU,EAEV,QAAS,GAET,KAAM,GAEN,YAAa,GAEb,WAAY,YAEZ,eAAgB,GAEhB,cAAe,MAEf,eAAgB,GAEhB,YAAa,SAEb,WAAY,EACZ,SAAU,OAAO,kBAEjB,cAAe,GAEf,aAAc,GAEd,UAAW,WAEX,0BAA2B,MAE3B,wBAAyB,GAEzB,UAAW,KAEX,2BAA4B,MAChC,EAEOC,EAAQD","sourcesContent":["import type { Options } from \"prettier\";\n\nconst config: Options = {\n // max 160 characters per line\n printWidth: 160,\n // use 4 spaces for indentation\n tabWidth: 4,\n // use spaces instead of indentations\n useTabs: false,\n // semicolon at the end of the line\n semi: true,\n // use single quotes\n singleQuote: false,\n // object's key is quoted only when necessary\n quoteProps: \"as-needed\",\n // use double quotes instead of single quotes in jsx\n jsxSingleQuote: false,\n // all comma at the end\n trailingComma: \"all\",\n // spaces are required at the beginning and end of the braces\n bracketSpacing: true,\n // brackets are required for arrow function parameter, even when there is only one parameter\n arrowParens: \"always\",\n // format the entire contents of the file\n rangeStart: 0,\n rangeEnd: Number.POSITIVE_INFINITY,\n // no need to write the beginning @prettier of the file\n requirePragma: false,\n // No need to automatically insert @prettier at the beginning of the file\n insertPragma: false,\n // use default break criteria\n proseWrap: \"preserve\",\n // decide whether to break the html according to the display style\n htmlWhitespaceSensitivity: \"css\",\n // vue files script and style tags indentation\n vueIndentScriptAndStyle: false,\n // lf for newline\n endOfLine: \"lf\",\n // formats quoted code embedded\n embeddedLanguageFormatting: \"auto\",\n};\n\nexport default config;\n"]}
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkNAA7XF5C_js = require('./chunk-NAA7XF5C.js');
3
+ var chunkLL7RB26L_js = require('./chunk-LL7RB26L.js');
4
4
 
5
5
 
6
6
 
7
- module.exports = chunkNAA7XF5C_js.a;
7
+ module.exports = chunkLL7RB26L_js.a;
8
8
  //# sourceMappingURL=out.js.map
9
9
  //# sourceMappingURL=index.js.map
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- export { a as default } from './chunk-YVQ27E43.mjs';
1
+ export { a as default } from './chunk-D3AEYP6U.mjs';
2
2
  //# sourceMappingURL=out.js.map
3
3
  //# sourceMappingURL=index.mjs.map
@@ -1 +1,2 @@
1
- #!/usr/bin/env node
1
+
2
+ export { }
@@ -1,7 +1,6 @@
1
- #!/usr/bin/env node
2
1
  'use strict';
3
2
 
4
- var chunkNAA7XF5C_js = require('./chunk-NAA7XF5C.js');
3
+ var chunkLL7RB26L_js = require('./chunk-LL7RB26L.js');
5
4
  var packageJsonUtils = require('@anolilab/package-json-utils');
6
5
  var fs = require('fs');
7
6
  var path = require('path');
@@ -10,8 +9,8 @@ var util = require('util');
10
9
  process.env.CI&&process.exit(0);var s=util.promisify(fs.writeFile);console.log("Configuring @anolilab/prettier-config",packageJsonUtils.projectPath,`
11
10
  `);var a=()=>{let e=path.join(packageJsonUtils.projectPath,".prettierrc.js");return fs.existsSync(e)||fs.existsSync(e.replace(".js",""))||fs.existsSync(e.replace(".js",`.${packageJsonUtils.packageIsTypeModule?"m":"c"}js`))?(console.warn(`\u26A0\uFE0F .prettierrc.{m|c}js already exists;
12
11
  Make sure that it includes the following for @anolilab/prettier-config to work as it should:
13
- ${JSON.stringify(chunkNAA7XF5C_js.a,void 0,4)}
14
- `),Promise.resolve()):s(e,`${packageJsonUtils.packageIsTypeModule?"export default":"module.exports ="} ${JSON.stringify(chunkNAA7XF5C_js.a,void 0,2).replace("rangeEnd: null,","rangeEnd: Infinity,")}
12
+ ${JSON.stringify(chunkLL7RB26L_js.a,void 0,4)}
13
+ `),Promise.resolve()):s(e,`${packageJsonUtils.packageIsTypeModule?"export default":"module.exports ="} ${JSON.stringify(chunkLL7RB26L_js.a,void 0,2).replace("rangeEnd: null,","rangeEnd: Infinity,")}
15
14
  `,"utf-8")},p=()=>{let e=path.join(packageJsonUtils.projectPath,".prettierignore");return fs.existsSync(e)?(console.warn("\u26A0\uFE0F .prettierignore already exists"),Promise.resolve()):s(e,"","utf-8")};(async()=>{try{await Promise.all([a(),p()]),console.log("\u{1F60E} Everything went well, have fun!"),process.exit(0);}catch(e){console.log("\u{1F62C} something went wrong:"),console.error(e),process.exit(1);}})();
16
15
  //# sourceMappingURL=out.js.map
17
16
  //# sourceMappingURL=postinstall.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/postinstall.ts"],"names":["packageIsTypeModule","projectPath","existsSync","writeFile","join","promisify","writeFileAsync","writePrettierRc","prettierPath","src_default","writePrettierIgnore","error"],"mappings":";wCAEA,OAAS,uBAAAA,EAAqB,eAAAC,MAAmB,+BACjD,OAAS,cAAAC,EAAY,aAAAC,MAAiB,KACtC,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,OAItB,QAAQ,IAAI,IAEZ,QAAQ,KAAK,CAAC,EAGlB,IAAMC,EAAiBD,EAAUF,CAAS,EAE1C,QAAQ,IAAI,wCAAyCF,EAAa;AAAA,CAAI,EAKtE,IAAMM,EAAkB,IAAM,CAC1B,IAAMC,EAAeJ,EAAKH,EAAa,gBAAgB,EAEvD,OACIC,EAAWM,CAAY,GACpBN,EAAWM,EAAa,QAAQ,MAAO,EAAE,CAAC,GAC1CN,EAAWM,EAAa,QAAQ,MAAO,IAAIR,EAAsB,IAAM,OAAO,CAAC,GAElF,QAAQ,KAAK;AAAA;AAAA,EAEnB,KAAK,UAAUS,EAAS,OAAW,CAAC;AAAA,CAAK,EAE5B,QAAQ,QAAQ,GAGpBH,EACHE,EACA,GAAGR,EAAsB,iBAAmB,sBAAsB,KAAK,UAAUS,EAAS,OAAW,CAAC,EAAE,QACpG,kBACA,qBACJ;AAAA,EACA,OACJ,CACJ,EAKMC,EAAsB,IAAM,CAC9B,IAAMF,EAAeJ,EAAKH,EAAa,iBAAiB,EAExD,OAAIC,EAAWM,CAAY,GACvB,QAAQ,KAAK,8CAAoC,EAE1C,QAAQ,QAAQ,GAGpBF,EAAeE,EAAc,GAAI,OAAO,CACnD,GAGC,SAAY,CACT,GAAI,CAEA,MAAM,QAAQ,IAAI,CAACD,EAAgB,EAAGG,EAAoB,CAAC,CAAC,EAE5D,QAAQ,IAAI,4CAAqC,EAGjD,QAAQ,KAAK,CAAC,CAClB,OAASC,EAAP,CACE,QAAQ,IAAI,kCAA2B,EACvC,QAAQ,MAAMA,CAAK,EAGnB,QAAQ,KAAK,CAAC,CAClB,CACJ,GAAG","sourcesContent":["#!/usr/bin/env node\n\nimport { packageIsTypeModule, projectPath } from \"@anolilab/package-json-utils\";\nimport { existsSync, writeFile } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\n\nimport content from \".\";\n\nif (process.env[\"CI\"]) {\n // eslint-disable-next-line no-undef\n process.exit(0);\n}\n\nconst writeFileAsync = promisify(writeFile);\n\nconsole.log(\"Configuring @anolilab/prettier-config\", projectPath, \"\\n\");\n\n/**\n * Writes .prettierrc.${m|c}js if it doesn't exist. Warns if it exists.\n */\nconst writePrettierRc = () => {\n const prettierPath = join(projectPath, \".prettierrc.js\");\n\n if (\n existsSync(prettierPath)\n || existsSync(prettierPath.replace(\".js\", \"\"))\n || existsSync(prettierPath.replace(\".js\", `.${packageIsTypeModule ? \"m\" : \"c\"}js`))\n ) {\n console.warn(`⚠️ .prettierrc.{m|c}js already exists;\nMake sure that it includes the following for @anolilab/prettier-config to work as it should:\n${JSON.stringify(content, undefined, 4)}\\n`);\n\n return Promise.resolve();\n }\n\n return writeFileAsync(\n prettierPath,\n `${packageIsTypeModule ? \"export default\" : \"module.exports =\"} ${JSON.stringify(content, undefined, 2).replace(\n \"rangeEnd: null,\",\n \"rangeEnd: Infinity,\",\n )}\\n`,\n \"utf-8\",\n );\n};\n\n/**\n * Writes .prettierignore if it doesn't exist. Warns if it exists.\n */\nconst writePrettierIgnore = () => {\n const prettierPath = join(projectPath, \".prettierignore\");\n\n if (existsSync(prettierPath)) {\n console.warn(\"⚠️ .prettierignore already exists\");\n\n return Promise.resolve();\n }\n\n return writeFileAsync(prettierPath, \"\", \"utf-8\");\n};\n\n// eslint-disable-next-line unicorn/prefer-top-level-await\n(async () => {\n try {\n // eslint-disable-next-line compat/compat\n await Promise.all([writePrettierRc(), writePrettierIgnore()]);\n\n console.log(\"😎 Everything went well, have fun!\");\n\n // eslint-disable-next-line no-undef\n process.exit(0);\n } catch (error) {\n console.log(\"😬 something went wrong:\");\n console.error(error);\n\n // eslint-disable-next-line no-undef\n process.exit(1);\n }\n})();\n"]}
1
+ {"version":3,"sources":["../src/postinstall.ts"],"names":["packageIsTypeModule","projectPath","existsSync","writeFile","join","promisify","writeFileAsync","writePrettierRc","prettierPath","src_default","writePrettierIgnore","error"],"mappings":"wCAAA,OAAS,uBAAAA,EAAqB,eAAAC,MAAmB,+BACjD,OAAS,cAAAC,EAAY,aAAAC,MAAiB,KACtC,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,OAItB,QAAQ,IAAI,IAEZ,QAAQ,KAAK,CAAC,EAGlB,IAAMC,EAAiBD,EAAUF,CAAS,EAE1C,QAAQ,IAAI,wCAAyCF,EAAa;AAAA,CAAI,EAKtE,IAAMM,EAAkB,IAAM,CAC1B,IAAMC,EAAeJ,EAAKH,EAAa,gBAAgB,EAEvD,OACIC,EAAWM,CAAY,GACpBN,EAAWM,EAAa,QAAQ,MAAO,EAAE,CAAC,GAC1CN,EAAWM,EAAa,QAAQ,MAAO,IAAIR,EAAsB,IAAM,OAAO,CAAC,GAElF,QAAQ,KAAK;AAAA;AAAA,EAEnB,KAAK,UAAUS,EAAS,OAAW,CAAC;AAAA,CAAK,EAE5B,QAAQ,QAAQ,GAGpBH,EACHE,EACA,GAAGR,EAAsB,iBAAmB,sBAAsB,KAAK,UAAUS,EAAS,OAAW,CAAC,EAAE,QACpG,kBACA,qBACJ;AAAA,EACA,OACJ,CACJ,EAKMC,EAAsB,IAAM,CAC9B,IAAMF,EAAeJ,EAAKH,EAAa,iBAAiB,EAExD,OAAIC,EAAWM,CAAY,GACvB,QAAQ,KAAK,8CAAoC,EAE1C,QAAQ,QAAQ,GAGpBF,EAAeE,EAAc,GAAI,OAAO,CACnD,GAGC,SAAY,CACT,GAAI,CAEA,MAAM,QAAQ,IAAI,CAACD,EAAgB,EAAGG,EAAoB,CAAC,CAAC,EAE5D,QAAQ,IAAI,4CAAqC,EAGjD,QAAQ,KAAK,CAAC,CAClB,OAASC,EAAP,CACE,QAAQ,IAAI,kCAA2B,EACvC,QAAQ,MAAMA,CAAK,EAGnB,QAAQ,KAAK,CAAC,CAClB,CACJ,GAAG","sourcesContent":["import { packageIsTypeModule, projectPath } from \"@anolilab/package-json-utils\";\nimport { existsSync, writeFile } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\n\nimport content from \".\";\n\nif (process.env[\"CI\"]) {\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(0);\n}\n\nconst writeFileAsync = promisify(writeFile);\n\nconsole.log(\"Configuring @anolilab/prettier-config\", projectPath, \"\\n\");\n\n/**\n * Writes .prettierrc.${m|c}js if it doesn't exist. Warns if it exists.\n */\nconst writePrettierRc = () => {\n const prettierPath = join(projectPath, \".prettierrc.js\");\n\n if (\n existsSync(prettierPath)\n || existsSync(prettierPath.replace(\".js\", \"\"))\n || existsSync(prettierPath.replace(\".js\", `.${packageIsTypeModule ? \"m\" : \"c\"}js`))\n ) {\n console.warn(`⚠️ .prettierrc.{m|c}js already exists;\nMake sure that it includes the following for @anolilab/prettier-config to work as it should:\n${JSON.stringify(content, undefined, 4)}\\n`);\n\n return Promise.resolve();\n }\n\n return writeFileAsync(\n prettierPath,\n `${packageIsTypeModule ? \"export default\" : \"module.exports =\"} ${JSON.stringify(content, undefined, 2).replace(\n \"rangeEnd: null,\",\n \"rangeEnd: Infinity,\",\n )}\\n`,\n \"utf-8\",\n );\n};\n\n/**\n * Writes .prettierignore if it doesn't exist. Warns if it exists.\n */\nconst writePrettierIgnore = () => {\n const prettierPath = join(projectPath, \".prettierignore\");\n\n if (existsSync(prettierPath)) {\n console.warn(\"⚠️ .prettierignore already exists\");\n\n return Promise.resolve();\n }\n\n return writeFileAsync(prettierPath, \"\", \"utf-8\");\n};\n\n// eslint-disable-next-line unicorn/prefer-top-level-await\n(async () => {\n try {\n // eslint-disable-next-line compat/compat\n await Promise.all([writePrettierRc(), writePrettierIgnore()]);\n\n console.log(\"😎 Everything went well, have fun!\");\n\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(0);\n } catch (error) {\n console.log(\"😬 something went wrong:\");\n console.error(error);\n\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(1);\n }\n})();\n"]}
@@ -1,5 +1,4 @@
1
- #!/usr/bin/env node
2
- import { a as a$1 } from './chunk-YVQ27E43.mjs';
1
+ import { a as a$1 } from './chunk-D3AEYP6U.mjs';
3
2
  import { projectPath, packageIsTypeModule } from '@anolilab/package-json-utils';
4
3
  import { writeFile, existsSync } from 'fs';
5
4
  import { join } from 'path';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/postinstall.ts"],"names":["packageIsTypeModule","projectPath","existsSync","writeFile","join","promisify","writeFileAsync","writePrettierRc","prettierPath","src_default","writePrettierIgnore","error"],"mappings":";yCAEA,OAAS,uBAAAA,EAAqB,eAAAC,MAAmB,+BACjD,OAAS,cAAAC,EAAY,aAAAC,MAAiB,KACtC,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,OAItB,QAAQ,IAAI,IAEZ,QAAQ,KAAK,CAAC,EAGlB,IAAMC,EAAiBD,EAAUF,CAAS,EAE1C,QAAQ,IAAI,wCAAyCF,EAAa;AAAA,CAAI,EAKtE,IAAMM,EAAkB,IAAM,CAC1B,IAAMC,EAAeJ,EAAKH,EAAa,gBAAgB,EAEvD,OACIC,EAAWM,CAAY,GACpBN,EAAWM,EAAa,QAAQ,MAAO,EAAE,CAAC,GAC1CN,EAAWM,EAAa,QAAQ,MAAO,IAAIR,EAAsB,IAAM,OAAO,CAAC,GAElF,QAAQ,KAAK;AAAA;AAAA,EAEnB,KAAK,UAAUS,EAAS,OAAW,CAAC;AAAA,CAAK,EAE5B,QAAQ,QAAQ,GAGpBH,EACHE,EACA,GAAGR,EAAsB,iBAAmB,sBAAsB,KAAK,UAAUS,EAAS,OAAW,CAAC,EAAE,QACpG,kBACA,qBACJ;AAAA,EACA,OACJ,CACJ,EAKMC,EAAsB,IAAM,CAC9B,IAAMF,EAAeJ,EAAKH,EAAa,iBAAiB,EAExD,OAAIC,EAAWM,CAAY,GACvB,QAAQ,KAAK,8CAAoC,EAE1C,QAAQ,QAAQ,GAGpBF,EAAeE,EAAc,GAAI,OAAO,CACnD,GAGC,SAAY,CACT,GAAI,CAEA,MAAM,QAAQ,IAAI,CAACD,EAAgB,EAAGG,EAAoB,CAAC,CAAC,EAE5D,QAAQ,IAAI,4CAAqC,EAGjD,QAAQ,KAAK,CAAC,CAClB,OAASC,EAAP,CACE,QAAQ,IAAI,kCAA2B,EACvC,QAAQ,MAAMA,CAAK,EAGnB,QAAQ,KAAK,CAAC,CAClB,CACJ,GAAG","sourcesContent":["#!/usr/bin/env node\n\nimport { packageIsTypeModule, projectPath } from \"@anolilab/package-json-utils\";\nimport { existsSync, writeFile } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\n\nimport content from \".\";\n\nif (process.env[\"CI\"]) {\n // eslint-disable-next-line no-undef\n process.exit(0);\n}\n\nconst writeFileAsync = promisify(writeFile);\n\nconsole.log(\"Configuring @anolilab/prettier-config\", projectPath, \"\\n\");\n\n/**\n * Writes .prettierrc.${m|c}js if it doesn't exist. Warns if it exists.\n */\nconst writePrettierRc = () => {\n const prettierPath = join(projectPath, \".prettierrc.js\");\n\n if (\n existsSync(prettierPath)\n || existsSync(prettierPath.replace(\".js\", \"\"))\n || existsSync(prettierPath.replace(\".js\", `.${packageIsTypeModule ? \"m\" : \"c\"}js`))\n ) {\n console.warn(`⚠️ .prettierrc.{m|c}js already exists;\nMake sure that it includes the following for @anolilab/prettier-config to work as it should:\n${JSON.stringify(content, undefined, 4)}\\n`);\n\n return Promise.resolve();\n }\n\n return writeFileAsync(\n prettierPath,\n `${packageIsTypeModule ? \"export default\" : \"module.exports =\"} ${JSON.stringify(content, undefined, 2).replace(\n \"rangeEnd: null,\",\n \"rangeEnd: Infinity,\",\n )}\\n`,\n \"utf-8\",\n );\n};\n\n/**\n * Writes .prettierignore if it doesn't exist. Warns if it exists.\n */\nconst writePrettierIgnore = () => {\n const prettierPath = join(projectPath, \".prettierignore\");\n\n if (existsSync(prettierPath)) {\n console.warn(\"⚠️ .prettierignore already exists\");\n\n return Promise.resolve();\n }\n\n return writeFileAsync(prettierPath, \"\", \"utf-8\");\n};\n\n// eslint-disable-next-line unicorn/prefer-top-level-await\n(async () => {\n try {\n // eslint-disable-next-line compat/compat\n await Promise.all([writePrettierRc(), writePrettierIgnore()]);\n\n console.log(\"😎 Everything went well, have fun!\");\n\n // eslint-disable-next-line no-undef\n process.exit(0);\n } catch (error) {\n console.log(\"😬 something went wrong:\");\n console.error(error);\n\n // eslint-disable-next-line no-undef\n process.exit(1);\n }\n})();\n"]}
1
+ {"version":3,"sources":["../src/postinstall.ts"],"names":["packageIsTypeModule","projectPath","existsSync","writeFile","join","promisify","writeFileAsync","writePrettierRc","prettierPath","src_default","writePrettierIgnore","error"],"mappings":"yCAAA,OAAS,uBAAAA,EAAqB,eAAAC,MAAmB,+BACjD,OAAS,cAAAC,EAAY,aAAAC,MAAiB,KACtC,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,OAItB,QAAQ,IAAI,IAEZ,QAAQ,KAAK,CAAC,EAGlB,IAAMC,EAAiBD,EAAUF,CAAS,EAE1C,QAAQ,IAAI,wCAAyCF,EAAa;AAAA,CAAI,EAKtE,IAAMM,EAAkB,IAAM,CAC1B,IAAMC,EAAeJ,EAAKH,EAAa,gBAAgB,EAEvD,OACIC,EAAWM,CAAY,GACpBN,EAAWM,EAAa,QAAQ,MAAO,EAAE,CAAC,GAC1CN,EAAWM,EAAa,QAAQ,MAAO,IAAIR,EAAsB,IAAM,OAAO,CAAC,GAElF,QAAQ,KAAK;AAAA;AAAA,EAEnB,KAAK,UAAUS,EAAS,OAAW,CAAC;AAAA,CAAK,EAE5B,QAAQ,QAAQ,GAGpBH,EACHE,EACA,GAAGR,EAAsB,iBAAmB,sBAAsB,KAAK,UAAUS,EAAS,OAAW,CAAC,EAAE,QACpG,kBACA,qBACJ;AAAA,EACA,OACJ,CACJ,EAKMC,EAAsB,IAAM,CAC9B,IAAMF,EAAeJ,EAAKH,EAAa,iBAAiB,EAExD,OAAIC,EAAWM,CAAY,GACvB,QAAQ,KAAK,8CAAoC,EAE1C,QAAQ,QAAQ,GAGpBF,EAAeE,EAAc,GAAI,OAAO,CACnD,GAGC,SAAY,CACT,GAAI,CAEA,MAAM,QAAQ,IAAI,CAACD,EAAgB,EAAGG,EAAoB,CAAC,CAAC,EAE5D,QAAQ,IAAI,4CAAqC,EAGjD,QAAQ,KAAK,CAAC,CAClB,OAASC,EAAP,CACE,QAAQ,IAAI,kCAA2B,EACvC,QAAQ,MAAMA,CAAK,EAGnB,QAAQ,KAAK,CAAC,CAClB,CACJ,GAAG","sourcesContent":["import { packageIsTypeModule, projectPath } from \"@anolilab/package-json-utils\";\nimport { existsSync, writeFile } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\n\nimport content from \".\";\n\nif (process.env[\"CI\"]) {\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(0);\n}\n\nconst writeFileAsync = promisify(writeFile);\n\nconsole.log(\"Configuring @anolilab/prettier-config\", projectPath, \"\\n\");\n\n/**\n * Writes .prettierrc.${m|c}js if it doesn't exist. Warns if it exists.\n */\nconst writePrettierRc = () => {\n const prettierPath = join(projectPath, \".prettierrc.js\");\n\n if (\n existsSync(prettierPath)\n || existsSync(prettierPath.replace(\".js\", \"\"))\n || existsSync(prettierPath.replace(\".js\", `.${packageIsTypeModule ? \"m\" : \"c\"}js`))\n ) {\n console.warn(`⚠️ .prettierrc.{m|c}js already exists;\nMake sure that it includes the following for @anolilab/prettier-config to work as it should:\n${JSON.stringify(content, undefined, 4)}\\n`);\n\n return Promise.resolve();\n }\n\n return writeFileAsync(\n prettierPath,\n `${packageIsTypeModule ? \"export default\" : \"module.exports =\"} ${JSON.stringify(content, undefined, 2).replace(\n \"rangeEnd: null,\",\n \"rangeEnd: Infinity,\",\n )}\\n`,\n \"utf-8\",\n );\n};\n\n/**\n * Writes .prettierignore if it doesn't exist. Warns if it exists.\n */\nconst writePrettierIgnore = () => {\n const prettierPath = join(projectPath, \".prettierignore\");\n\n if (existsSync(prettierPath)) {\n console.warn(\"⚠️ .prettierignore already exists\");\n\n return Promise.resolve();\n }\n\n return writeFileAsync(prettierPath, \"\", \"utf-8\");\n};\n\n// eslint-disable-next-line unicorn/prefer-top-level-await\n(async () => {\n try {\n // eslint-disable-next-line compat/compat\n await Promise.all([writePrettierRc(), writePrettierIgnore()]);\n\n console.log(\"😎 Everything went well, have fun!\");\n\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(0);\n } catch (error) {\n console.log(\"😬 something went wrong:\");\n console.error(error);\n\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(1);\n }\n})();\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anolilab/prettier-config",
3
- "version": "4.0.6",
3
+ "version": "4.0.7",
4
4
  "description": "Prettier shareable config for Anolilab.",
5
5
  "keywords": [
6
6
  "css",
@@ -56,11 +56,11 @@
56
56
  "postinstall": "node ./skip.js || node ./dist/postinstall.js"
57
57
  },
58
58
  "dependencies": {
59
- "@anolilab/package-json-utils": "1.3.0"
59
+ "@anolilab/package-json-utils": "1.4.0"
60
60
  },
61
61
  "devDependencies": {
62
- "@anolilab/semantic-release-preset": "3.1.1",
63
- "semantic-release": "^21.0.4"
62
+ "@anolilab/semantic-release-preset": "3.1.2",
63
+ "semantic-release": "^21.0.5"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "prettier": "2.x"