@fxhxyz/prettier-config 1.0.2 → 1.0.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/.editorconfig +60 -0
- package/.gitignore +21 -0
- package/.npmignore +3 -0
- package/.prettierignore +18 -0
- package/.prettierrc.cjs +12 -0
- package/.prettierrc.js +8 -0
- package/.prettierrc.json +41 -0
- package/package.json +28 -11
- package/readme.md +44 -2
- package/rollup.config.js +19 -0
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -21
- package/index.ts +0 -21
- package/tsconfig.json +0 -10
package/.editorconfig
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
root = true
|
|
2
|
+
|
|
3
|
+
[*]
|
|
4
|
+
charset = utf-8
|
|
5
|
+
indent_style = space
|
|
6
|
+
tab_width = 4
|
|
7
|
+
indent_size = 4
|
|
8
|
+
end_of_line = lf
|
|
9
|
+
max_line_length = 120
|
|
10
|
+
insert_final_newline = true
|
|
11
|
+
trim_trailing_whitespace = true
|
|
12
|
+
|
|
13
|
+
# Visual Studio Solution Files
|
|
14
|
+
[*.sln]
|
|
15
|
+
indent_style = tab
|
|
16
|
+
|
|
17
|
+
# Visual Studio XML Project Files
|
|
18
|
+
[*.{csproj,vbproj,vcxproj.filters,proj,projitems,shproj}]
|
|
19
|
+
indent_size = 2
|
|
20
|
+
|
|
21
|
+
# XML Configuration Files
|
|
22
|
+
[*.{xml,config,props,targets,nuspec,resx,ruleset,vsixmanifest,vsct}]
|
|
23
|
+
indent_size = 2
|
|
24
|
+
|
|
25
|
+
# JSON Files
|
|
26
|
+
[*.{json,json5,webmanifest}]
|
|
27
|
+
indent_size = 2
|
|
28
|
+
|
|
29
|
+
# YAML Files
|
|
30
|
+
[*.{yml,yaml}]
|
|
31
|
+
indent_size = 2
|
|
32
|
+
|
|
33
|
+
# Markdown
|
|
34
|
+
[*.{md,mdx}]
|
|
35
|
+
trim_trailing_whitespace = false
|
|
36
|
+
|
|
37
|
+
# JavaScript/TypeScript
|
|
38
|
+
[*.{htm,html,js,jsm,ts,tsx,cjs,cts,ctsx,mjs,mts,mtsx,css,sass,scss,less,pcss,svg,vue}]
|
|
39
|
+
indent_style = space
|
|
40
|
+
indent_size = 2
|
|
41
|
+
|
|
42
|
+
# Batch Files
|
|
43
|
+
[*.{cmd,bat}]
|
|
44
|
+
end_of_line = crlf
|
|
45
|
+
|
|
46
|
+
# Bash Files
|
|
47
|
+
[*.sh]
|
|
48
|
+
end_of_line = lf
|
|
49
|
+
|
|
50
|
+
# Makefiles
|
|
51
|
+
[Makefile]
|
|
52
|
+
indent_style = tab
|
|
53
|
+
|
|
54
|
+
# Ignore minified files
|
|
55
|
+
[*.min.*]
|
|
56
|
+
indent_style = ignore
|
|
57
|
+
trim_trailing_whitespace = false
|
|
58
|
+
insert_final_newline = ignore
|
|
59
|
+
|
|
60
|
+
# git config --global core.autocrlf input
|
package/.gitignore
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Misc
|
|
2
|
+
.DS_Store
|
|
3
|
+
text.txt
|
|
4
|
+
package-lock.*
|
|
5
|
+
yarn.*
|
|
6
|
+
*.LICENSE.*
|
|
7
|
+
|
|
8
|
+
# Logs
|
|
9
|
+
logs
|
|
10
|
+
*.log
|
|
11
|
+
npm-debug.log*
|
|
12
|
+
yarn-debug.log*
|
|
13
|
+
yarn-error.log*
|
|
14
|
+
lerna-debug.log*
|
|
15
|
+
|
|
16
|
+
# Dependency directories
|
|
17
|
+
node_modules/
|
|
18
|
+
jspm_packages/
|
|
19
|
+
|
|
20
|
+
# Optional npm cache directory
|
|
21
|
+
.npm
|
package/.npmignore
ADDED
package/.prettierignore
ADDED
package/.prettierrc.cjs
ADDED
package/.prettierrc.js
ADDED
package/.prettierrc.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/prettierrc",
|
|
3
|
+
"tabWidth": 4,
|
|
4
|
+
"useTabs": false,
|
|
5
|
+
"printWidth": 120,
|
|
6
|
+
"singleQuote": true,
|
|
7
|
+
"jsxSingleQuote": true,
|
|
8
|
+
"singleAttributePerLine": true,
|
|
9
|
+
"arrowParens": "avoid",
|
|
10
|
+
"semi": true,
|
|
11
|
+
"jsxBracketSameLine": false,
|
|
12
|
+
"bracketSameLine": false,
|
|
13
|
+
"trailingComma": "es5",
|
|
14
|
+
"bracketSpacing": true,
|
|
15
|
+
"proseWrap": "always",
|
|
16
|
+
"quoteProps": "as-needed",
|
|
17
|
+
"endOfLine": "lf",
|
|
18
|
+
"plugins": [
|
|
19
|
+
"@ianvs/prettier-plugin-sort-imports",
|
|
20
|
+
"prettier-plugin-multiline-arrays"
|
|
21
|
+
],
|
|
22
|
+
"multilineArraysWrapThreshold": 2,
|
|
23
|
+
"importOrder": [
|
|
24
|
+
"<BUILTIN_MODULES>",
|
|
25
|
+
"^(react|next(.*))$",
|
|
26
|
+
"<THIRD_PARTY_MODULES>",
|
|
27
|
+
"<TYPES>",
|
|
28
|
+
"",
|
|
29
|
+
"^@/(.*)$",
|
|
30
|
+
"^~/(.*)$",
|
|
31
|
+
"^[./]",
|
|
32
|
+
"<TYPES>^[.]",
|
|
33
|
+
"^(.*)(sass|css|scss)$"
|
|
34
|
+
],
|
|
35
|
+
"importOrderParserPlugins": [
|
|
36
|
+
"classProperties",
|
|
37
|
+
"decorators-legacy",
|
|
38
|
+
"jsx",
|
|
39
|
+
"typescript"
|
|
40
|
+
]
|
|
41
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fxhxyz/prettier-config",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"description": "My professional prettier config",
|
|
6
|
+
"main": "./.prettierrc.json",
|
|
7
|
+
"prettier": "./.prettierrc.json",
|
|
5
8
|
"keywords": [
|
|
6
9
|
"typescript",
|
|
7
10
|
"prettier",
|
|
@@ -9,9 +12,20 @@
|
|
|
9
12
|
"prettier config",
|
|
10
13
|
"config"
|
|
11
14
|
],
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
"files": [
|
|
16
|
+
".prettierignore",
|
|
17
|
+
".prettierrc.cjs",
|
|
18
|
+
".prettierrc.js",
|
|
19
|
+
".prettierrc.json",
|
|
20
|
+
".editorconfig",
|
|
21
|
+
"rollup.config.js",
|
|
22
|
+
".gitignore",
|
|
23
|
+
".npmignore"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"format": "prettier --write .",
|
|
27
|
+
"build": "rollup -c"
|
|
28
|
+
},
|
|
15
29
|
"author": {
|
|
16
30
|
"name": "fxhxyz4",
|
|
17
31
|
"email": "fxhsec@proton.me",
|
|
@@ -33,17 +47,20 @@
|
|
|
33
47
|
"publishConfig": {
|
|
34
48
|
"access": "public"
|
|
35
49
|
},
|
|
36
|
-
"
|
|
37
|
-
"
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
|
|
52
|
+
"prettier": "^3.5.2",
|
|
53
|
+
"prettier-plugin-multiline-arrays": "3.0.3"
|
|
38
54
|
},
|
|
39
55
|
"peerDependencies": {
|
|
40
|
-
"prettier": "^
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"@types/prettier": "^3.0.0",
|
|
44
|
-
"typescript": "^5.7.3"
|
|
56
|
+
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
|
|
57
|
+
"prettier": "^3.5.2",
|
|
58
|
+
"prettier-plugin-multiline-arrays": "3.0.3"
|
|
45
59
|
},
|
|
46
60
|
"engines": {
|
|
47
61
|
"node": "20.x"
|
|
62
|
+
},
|
|
63
|
+
"dependencies": {
|
|
64
|
+
"rollup": "^4.34.9"
|
|
48
65
|
}
|
|
49
66
|
}
|
package/readme.md
CHANGED
|
@@ -5,10 +5,52 @@
|
|
|
5
5
|
### how to use?
|
|
6
6
|
+ ***npm***
|
|
7
7
|
```
|
|
8
|
-
npm install
|
|
8
|
+
npm install @fxhxyz/prettier-config -D
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
+ ***yarn***
|
|
12
12
|
```
|
|
13
|
-
yarn add
|
|
13
|
+
yarn add @fxhxyz/prettier-config -D
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
+ ***pnpm***
|
|
17
|
+
```
|
|
18
|
+
pnpm add @fxhxyz/prettier-config -D
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
+ ***usage commonjs***
|
|
22
|
+
```js
|
|
23
|
+
// .prettierrc.cjs
|
|
24
|
+
module.exports = require("@fxhxyz/prettier-config");
|
|
25
|
+
|
|
26
|
+
// package.json
|
|
27
|
+
"scripts": {
|
|
28
|
+
"format": "prettier --write ."
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
+ ***usage es6***
|
|
33
|
+
```js
|
|
34
|
+
// .prettierrc.mjs/.js
|
|
35
|
+
import { config } from "@fxhxyz/prettier-config";
|
|
36
|
+
export { config };
|
|
37
|
+
|
|
38
|
+
// package.json
|
|
39
|
+
"scripts": {
|
|
40
|
+
"format": "prettier --write ."
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
#
|
|
46
|
+
|
|
47
|
+
### copying prettierignore & editorconfig from node_modules
|
|
48
|
+
```
|
|
49
|
+
# linux/mac
|
|
50
|
+
cp node_modules/@fxhxyz/prettier-config/.prettierignore .prettierignore &&
|
|
51
|
+
cp node_modules/@fxhxyz/prettier-config/.editorconfig .editorconfig
|
|
52
|
+
|
|
53
|
+
# win
|
|
54
|
+
copy node_modules/@fxhxyz/prettier-config/.prettierignore .prettierignore &&
|
|
55
|
+
copy node_modules/@fxhxyz/prettier-config/.editorconfig .editorconfig
|
|
14
56
|
```
|
package/rollup.config.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
let config = {};
|
|
2
|
+
|
|
3
|
+
export default config = {
|
|
4
|
+
input: `./.prettierrc.js`,
|
|
5
|
+
output: [
|
|
6
|
+
{
|
|
7
|
+
file: `./.prettierrc.cjs`,
|
|
8
|
+
format: 'cjs',
|
|
9
|
+
exports: 'named',
|
|
10
|
+
sourcemap: false,
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
file: `./.prettierrc.js`,
|
|
14
|
+
format: 'esm',
|
|
15
|
+
exports: 'named',
|
|
16
|
+
sourcemap: false,
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
package/dist/index.d.ts
DELETED
package/dist/index.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.config = void 0;
|
|
4
|
-
/** @type {import("prettier").Config} */
|
|
5
|
-
exports.config = {
|
|
6
|
-
tabWidth: 2,
|
|
7
|
-
useTabs: true,
|
|
8
|
-
printWidth: 140,
|
|
9
|
-
singleQuote: true,
|
|
10
|
-
jsxSingleQuote: true,
|
|
11
|
-
arrowParens: "avoid",
|
|
12
|
-
semi: true,
|
|
13
|
-
jsxBracketSameLine: false,
|
|
14
|
-
trailingComma: "es5",
|
|
15
|
-
bracketSpacing: true,
|
|
16
|
-
proseWrap: "always",
|
|
17
|
-
quoteProps: "as-needed",
|
|
18
|
-
htmlWhitespaceSensitivity: "css",
|
|
19
|
-
parser: "jsonc",
|
|
20
|
-
endOfLine: "lf",
|
|
21
|
-
};
|
package/index.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Config } from "prettier";
|
|
2
|
-
|
|
3
|
-
/** @type {import("prettier").Config} */
|
|
4
|
-
|
|
5
|
-
export const config: Config = {
|
|
6
|
-
tabWidth: 2,
|
|
7
|
-
useTabs: true,
|
|
8
|
-
printWidth: 140,
|
|
9
|
-
singleQuote: true,
|
|
10
|
-
jsxSingleQuote: true,
|
|
11
|
-
arrowParens: "avoid",
|
|
12
|
-
semi: true,
|
|
13
|
-
jsxBracketSameLine: false,
|
|
14
|
-
trailingComma: "es5",
|
|
15
|
-
bracketSpacing: true,
|
|
16
|
-
proseWrap: "always",
|
|
17
|
-
quoteProps: "as-needed",
|
|
18
|
-
htmlWhitespaceSensitivity: "css",
|
|
19
|
-
parser: "jsonc",
|
|
20
|
-
endOfLine: "lf",
|
|
21
|
-
};
|