@d-zero/prettier-config 5.0.0-alpha.65 → 5.0.0-alpha.67
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 +23 -0
- package/base.js +33 -0
- package/index.js +7 -41
- package/package.json +10 -5
- package/pug.js +9 -0
package/README.md
CHANGED
|
@@ -27,3 +27,26 @@ export default {
|
|
|
27
27
|
useTabs: false,
|
|
28
28
|
};
|
|
29
29
|
```
|
|
30
|
+
|
|
31
|
+
## 種類別プリセット
|
|
32
|
+
|
|
33
|
+
| パッケージパス | 用途 |
|
|
34
|
+
| ------------------------------ | -------------------------- |
|
|
35
|
+
| `@d-zero/prettier-config` | フルセット(ベース + Pug) |
|
|
36
|
+
| `@d-zero/prettier-config/base` | 基本セット(Pugなし) |
|
|
37
|
+
| `@d-zero/prettier-config/pug` | Pug関連設定のみ |
|
|
38
|
+
|
|
39
|
+
`@d-zero/prettier-config`はすべての設定を含んでいるので、一部の設定のみを利用する場合は、それぞれ種類別のものを利用します。
|
|
40
|
+
|
|
41
|
+
```js
|
|
42
|
+
import baseConfig from '@d-zero/prettier-config/base';
|
|
43
|
+
import pugConfig from '@d-zero/prettier-config/pug';
|
|
44
|
+
|
|
45
|
+
export default {
|
|
46
|
+
...baseConfig,
|
|
47
|
+
// 既存の設定を上書き
|
|
48
|
+
printWidth: 120,
|
|
49
|
+
// Pug設定を追加
|
|
50
|
+
...pugConfig,
|
|
51
|
+
};
|
|
52
|
+
```
|
package/base.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
arrowParens: 'always',
|
|
3
|
+
bracketSameLine: true,
|
|
4
|
+
bracketSpacing: true,
|
|
5
|
+
jsxSingleQuote: false,
|
|
6
|
+
printWidth: 90,
|
|
7
|
+
quoteProps: 'as-needed',
|
|
8
|
+
semi: true,
|
|
9
|
+
singleQuote: true,
|
|
10
|
+
tabWidth: 2,
|
|
11
|
+
trailingComma: 'all',
|
|
12
|
+
useTabs: true,
|
|
13
|
+
overrides: [
|
|
14
|
+
{
|
|
15
|
+
files: '.*rc',
|
|
16
|
+
options: { parser: 'json' },
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
files: '*.html',
|
|
20
|
+
options: {
|
|
21
|
+
printWidth: 100_000,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
files: '*.mdc',
|
|
26
|
+
options: { parser: 'markdown' },
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
files: '.clinerules',
|
|
30
|
+
options: { parser: 'markdown' },
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
};
|
package/index.js
CHANGED
|
@@ -1,43 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
arrowParens: 'always',
|
|
5
|
-
bracketSameLine: true,
|
|
6
|
-
bracketSpacing: true,
|
|
7
|
-
jsxSingleQuote: false,
|
|
8
|
-
printWidth: 90,
|
|
9
|
-
quoteProps: 'as-needed',
|
|
10
|
-
semi: true,
|
|
11
|
-
singleQuote: true,
|
|
12
|
-
tabWidth: 2,
|
|
13
|
-
trailingComma: 'all',
|
|
14
|
-
useTabs: true,
|
|
1
|
+
import base from './base.js';
|
|
2
|
+
import pug from './pug.js';
|
|
15
3
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
pugSortAttributesEnd: ['id'],
|
|
22
|
-
|
|
23
|
-
overrides: [
|
|
24
|
-
{
|
|
25
|
-
files: '.*rc',
|
|
26
|
-
options: { parser: 'json' },
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
files: '*.html',
|
|
30
|
-
options: {
|
|
31
|
-
printWidth: 100_000,
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
files: '*.mdc',
|
|
36
|
-
options: { parser: 'markdown' },
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
files: '.clinerules',
|
|
40
|
-
options: { parser: 'markdown' },
|
|
41
|
-
},
|
|
42
|
-
],
|
|
4
|
+
export default {
|
|
5
|
+
...base,
|
|
6
|
+
...pug,
|
|
7
|
+
plugins: [...(base.plugins ?? []), ...(pug.plugins ?? [])],
|
|
8
|
+
overrides: [...(base.overrides ?? []), ...(pug.overrides ?? [])],
|
|
43
9
|
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d-zero/prettier-config",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.67",
|
|
4
4
|
"description": "Configurations of Prettier",
|
|
5
5
|
"repository": "https://github.com/d-zero-dev/linters.git",
|
|
6
6
|
"author": "D-ZERO Co., Ltd.",
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"private": false,
|
|
9
8
|
"publishConfig": {
|
|
10
9
|
"access": "public"
|
|
11
10
|
},
|
|
@@ -16,14 +15,20 @@
|
|
|
16
15
|
"exports": {
|
|
17
16
|
".": {
|
|
18
17
|
"import": "./index.js"
|
|
18
|
+
},
|
|
19
|
+
"./base": {
|
|
20
|
+
"import": "./base.js"
|
|
21
|
+
},
|
|
22
|
+
"./pug": {
|
|
23
|
+
"import": "./pug.js"
|
|
19
24
|
}
|
|
20
25
|
},
|
|
21
26
|
"files": [
|
|
22
|
-
"
|
|
27
|
+
"*.js"
|
|
23
28
|
],
|
|
24
29
|
"dependencies": {
|
|
25
30
|
"@prettier/plugin-pug": "3.4.0",
|
|
26
|
-
"prettier": "3.
|
|
31
|
+
"prettier": "3.6.1"
|
|
27
32
|
},
|
|
28
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "b0981c8d25ed356c5abaf5ab43d92401b6d55667"
|
|
29
34
|
}
|
package/pug.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
plugins: ['@prettier/plugin-pug'],
|
|
3
|
+
pugAttributeSeparator: 'as-needed',
|
|
4
|
+
pugCommentPreserveSpaces: 'trim-all',
|
|
5
|
+
pugEmptyAttributes: 'none',
|
|
6
|
+
pugSingleQuote: false,
|
|
7
|
+
pugSortAttributesBeginning: ['class'],
|
|
8
|
+
pugSortAttributesEnd: ['id'],
|
|
9
|
+
};
|