@amoform/prettier-config 1.0.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 +43 -0
- package/index.js +27 -0
- package/package.json +22 -0
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# @amoform/prettier-config
|
|
2
|
+
|
|
3
|
+
Common Prettier config for Amoform microservices.
|
|
4
|
+
Includes automatic import sorting using `@trivago/prettier-plugin-sort-imports`.
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
Install the package in your project:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install --save-dev @amoform/prettier-config
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Or with Prettier:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install --save-dev prettier @amoform/prettier-config
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
Create a `.prettierrc` file in the root of your project and simply specify the package name:
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
"@amoform/prettier-config"
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Or, if you prefer `package.json`:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
"prettier": "@amoform/prettier-config"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Usage in NestJS
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm run format
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Update
|
|
41
|
+
|
|
42
|
+
`npm version patch` ->
|
|
43
|
+
`npm publish`
|
package/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const config = {
|
|
2
|
+
semi: false,
|
|
3
|
+
singleQuote: true,
|
|
4
|
+
jsxSingleQuote: true,
|
|
5
|
+
tabWidth: 4,
|
|
6
|
+
useTabs: false,
|
|
7
|
+
trailingComma: 'all',
|
|
8
|
+
arrowParens: 'always',
|
|
9
|
+
printWidth: 80,
|
|
10
|
+
bracketSpacing: true,
|
|
11
|
+
endOfLine: 'lf',
|
|
12
|
+
|
|
13
|
+
importOrderSeparation: true,
|
|
14
|
+
importOrderSortSpecifiers: true,
|
|
15
|
+
importOrderCaseInsensitive: true,
|
|
16
|
+
importOrderParserPlugins: [
|
|
17
|
+
'typescript',
|
|
18
|
+
'jsx',
|
|
19
|
+
'decorators-legacy',
|
|
20
|
+
'classProperties',
|
|
21
|
+
],
|
|
22
|
+
|
|
23
|
+
importOrder: ['^react', '<THIRD_PARTY_MODULES>', '^@/(.*)$', '^../(.*)', '^./(.*)', '^[./]',],
|
|
24
|
+
plugins: ['@trivago/prettier-plugin-sort-imports'],
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default config
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@amoform/prettier-config",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Amoform Prettier config",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": "./index.js",
|
|
7
|
+
"files": [
|
|
8
|
+
"index.js",
|
|
9
|
+
"README.md"
|
|
10
|
+
],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"author": "theMaxPo",
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"prettier": ">=3.0.0"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@trivago/prettier-plugin-sort-imports": "^5.2.2"
|
|
21
|
+
}
|
|
22
|
+
}
|