@yopem/prettier-config 0.1.0
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 +22 -0
- package/package.json +61 -0
- package/src/base.js +44 -0
- package/src/react.js +49 -0
package/README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# @yopem/prettier-config
|
|
2
|
+
|
|
3
|
+
Yopem Prettier configuration.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install @yopem/prettier-config
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @yopem/prettier-config
|
|
11
|
+
# or
|
|
12
|
+
yarn add @yopem/prettier-config
|
|
13
|
+
# or
|
|
14
|
+
bun add @yopem/prettier-config
|
|
15
|
+
# or
|
|
16
|
+
deno install npm:@yopem/prettier-config
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Licence
|
|
20
|
+
|
|
21
|
+
This project is licensed under the terms of the
|
|
22
|
+
[MIT license](https://github.com/yopem/tooling/blob/main/LICENSE.md).
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@yopem/prettier-config",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"prettier",
|
|
7
|
+
"prettier-config",
|
|
8
|
+
"tooling"
|
|
9
|
+
],
|
|
10
|
+
"type": "module",
|
|
11
|
+
"main": "src/base.js",
|
|
12
|
+
"module": "src/base.js",
|
|
13
|
+
"types": "src/base.js",
|
|
14
|
+
"files": [
|
|
15
|
+
"src"
|
|
16
|
+
],
|
|
17
|
+
"exports": {
|
|
18
|
+
"./base": {
|
|
19
|
+
"source": "./src/base.js",
|
|
20
|
+
"import": {
|
|
21
|
+
"types": "./src/base.js",
|
|
22
|
+
"default": "./src/base.js"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"./react": {
|
|
26
|
+
"source": "./src/react.js",
|
|
27
|
+
"import": {
|
|
28
|
+
"types": "./src/react.js",
|
|
29
|
+
"default": "./src/react.js"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"./package.json": "./package.json"
|
|
33
|
+
},
|
|
34
|
+
"sideEffects": false,
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"author": "Karyana Yandi <karyana@yandi.me>",
|
|
39
|
+
"license": "MIT",
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "git+https://github.com/yopem/tooling.git",
|
|
43
|
+
"directory": "packages/tooling/prettier"
|
|
44
|
+
},
|
|
45
|
+
"bugs": {
|
|
46
|
+
"url": "https://github.com/yopem/tooling/issues"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"typecheck": "tsc --noEmit"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@ianvs/prettier-plugin-sort-imports": "4.4.1",
|
|
53
|
+
"prettier": "3.4.2",
|
|
54
|
+
"prettier-plugin-tailwindcss": "0.6.11"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@yopem/typescript-config": "*",
|
|
58
|
+
"typescript": "5.7.3"
|
|
59
|
+
},
|
|
60
|
+
"prettier": "@yopem/prettier-config/base"
|
|
61
|
+
}
|
package/src/base.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** @typedef {import("prettier").Config} PrettierConfig */
|
|
2
|
+
/** @typedef {import("@ianvs/prettier-plugin-sort-imports").PluginConfig} SortImportsConfig */
|
|
3
|
+
|
|
4
|
+
/** @type { PrettierConfig | SortImportsConfig } */
|
|
5
|
+
const config = {
|
|
6
|
+
bracketSpacing: true,
|
|
7
|
+
jsxSingleQuote: false,
|
|
8
|
+
printWidth: 80,
|
|
9
|
+
proseWrap: "always",
|
|
10
|
+
semi: false,
|
|
11
|
+
singleQuote: false,
|
|
12
|
+
tabWidth: 2,
|
|
13
|
+
trailingComma: "all",
|
|
14
|
+
plugins: ["@ianvs/prettier-plugin-sort-imports"],
|
|
15
|
+
importOrder: [
|
|
16
|
+
"^(react/(.*)$)|^(react$)|^(react-native(.*)$)",
|
|
17
|
+
"^(next/(.*)$)|^(next$)",
|
|
18
|
+
"^(expo(.*)$)|^(expo$)",
|
|
19
|
+
"<THIRD_PARTY_MODULES>",
|
|
20
|
+
"",
|
|
21
|
+
"",
|
|
22
|
+
"^@/",
|
|
23
|
+
"^[../]",
|
|
24
|
+
"^[./]",
|
|
25
|
+
],
|
|
26
|
+
importOrderParserPlugins: ["typescript", "jsx", "decorators-legacy"],
|
|
27
|
+
importOrderTypeScriptVersion: "5.7.2",
|
|
28
|
+
overrides: [
|
|
29
|
+
{
|
|
30
|
+
files: "*.json.hbs",
|
|
31
|
+
options: {
|
|
32
|
+
parser: "json",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
files: "*.js.hbs",
|
|
37
|
+
options: {
|
|
38
|
+
parser: "babel",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default config
|
package/src/react.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** @typedef {import("prettier").Config} PrettierConfig */
|
|
2
|
+
/** @typedef {import("prettier-plugin-tailwindcss").PluginOptions} TailwindConfig */
|
|
3
|
+
/** @typedef {import("@ianvs/prettier-plugin-sort-imports").PluginConfig} SortImportsConfig */
|
|
4
|
+
|
|
5
|
+
/** @type { PrettierConfig | SortImportsConfig | TailwindConfig } */
|
|
6
|
+
const config = {
|
|
7
|
+
bracketSpacing: true,
|
|
8
|
+
jsxSingleQuote: false,
|
|
9
|
+
printWidth: 80,
|
|
10
|
+
proseWrap: "always",
|
|
11
|
+
semi: false,
|
|
12
|
+
singleQuote: false,
|
|
13
|
+
tabWidth: 2,
|
|
14
|
+
trailingComma: "all",
|
|
15
|
+
plugins: [
|
|
16
|
+
"@ianvs/prettier-plugin-sort-imports",
|
|
17
|
+
"prettier-plugin-tailwindcss",
|
|
18
|
+
],
|
|
19
|
+
tailwindFunctions: ["cn", "cva"],
|
|
20
|
+
importOrder: [
|
|
21
|
+
"^(react/(.*)$)|^(react$)|^(react-native(.*)$)",
|
|
22
|
+
"^(next/(.*)$)|^(next$)",
|
|
23
|
+
"^(expo(.*)$)|^(expo$)",
|
|
24
|
+
"<THIRD_PARTY_MODULES>",
|
|
25
|
+
"",
|
|
26
|
+
"",
|
|
27
|
+
"^@/",
|
|
28
|
+
"^[../]",
|
|
29
|
+
"^[./]",
|
|
30
|
+
],
|
|
31
|
+
importOrderParserPlugins: ["typescript", "jsx", "decorators-legacy"],
|
|
32
|
+
importOrderTypeScriptVersion: "5.7.2",
|
|
33
|
+
overrides: [
|
|
34
|
+
{
|
|
35
|
+
files: "*.json.hbs",
|
|
36
|
+
options: {
|
|
37
|
+
parser: "json",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
files: "*.js.hbs",
|
|
42
|
+
options: {
|
|
43
|
+
parser: "babel",
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default config
|