@lazy-and-focused/prettier-config 1.0.0 → 1.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/LICENSE +21 -21
- package/README.md +99 -0
- package/package.json +57 -38
- package/{index.js → src/index.js} +54 -44
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Lazy And Focused
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Lazy And Focused
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Конфигурация Prettier для Lazy And Focused
|
|
2
|
+
|
|
3
|
+
Общая [Prettier](https://prettier.io) конфигурация для проектов, поддерживаемых командой **Lazy And Focused**.
|
|
4
|
+
|
|
5
|
+
## Установка
|
|
6
|
+
|
|
7
|
+
Установите пакет как зависимость для разработки:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @lazy-and-focused/prettier-config
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
> **Зависимость (peer dependency)**: требуется Prettier `^3.0.0`. Убедитесь, что он установлен в вашем проекте.
|
|
14
|
+
|
|
15
|
+
## Использование
|
|
16
|
+
|
|
17
|
+
### Через ESM-файл конфигурации (`.prettierrc.mjs`)
|
|
18
|
+
|
|
19
|
+
Создайте файл `.prettierrc.mjs` в корне вашего проекта:
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
import config from '@lazy-and-focused/prettier-config';
|
|
23
|
+
export default config;
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
#### Расширение или переопределение конфигурации
|
|
27
|
+
|
|
28
|
+
Если вам нужно изменить некоторые правила, импортируйте базовую конфигурацию и объедините её с вашими настройками:
|
|
29
|
+
|
|
30
|
+
```js
|
|
31
|
+
// .prettierrc.mjs
|
|
32
|
+
import config from '@lazy-and-focused/prettier-config';
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @see https:\\prettier.io\docs\configuration
|
|
36
|
+
* @type { import("prettier").Config }
|
|
37
|
+
*/
|
|
38
|
+
export default {
|
|
39
|
+
...config,
|
|
40
|
+
semi: false, // пример переопределения
|
|
41
|
+
printWidth: 100, // пример переопределения
|
|
42
|
+
};
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
> **Примечание**: Этот пакет распространяется как ES-модуль (`"type": "module"`). Если ваш проект использует CommonJS, вы можете использовать подход с `package.json` или создать динамический импорт в файле `.prettierrc.cjs`:
|
|
46
|
+
>
|
|
47
|
+
> ```js
|
|
48
|
+
> // .prettierrc.cjs
|
|
49
|
+
> module.exports = async () => {
|
|
50
|
+
> const config = await import('@lazy-and-focused/prettier-config');
|
|
51
|
+
> return config.default;
|
|
52
|
+
> };
|
|
53
|
+
> ```
|
|
54
|
+
>
|
|
55
|
+
> или
|
|
56
|
+
>
|
|
57
|
+
> ```js
|
|
58
|
+
> // .prettierrc.cjs
|
|
59
|
+
> const config = require('@lazy-and-focused/prettier-config');
|
|
60
|
+
>
|
|
61
|
+
> module.exports = {
|
|
62
|
+
> config: config.default
|
|
63
|
+
> };
|
|
64
|
+
> ```
|
|
65
|
+
|
|
66
|
+
## Детали конфигурации
|
|
67
|
+
|
|
68
|
+
Эта конфигурация включает следующие настройки Prettier (и не только):
|
|
69
|
+
|
|
70
|
+
| Параметр | Значение |
|
|
71
|
+
| ----------------------------- | ---------------- |
|
|
72
|
+
| `arrowParens` | `"always"` |
|
|
73
|
+
| `bracketSpacing` | `true` |
|
|
74
|
+
| `bracketSameLine` | `false` |
|
|
75
|
+
| `trailingComma` | `"all"` |
|
|
76
|
+
| `singleQuote` | `true` |
|
|
77
|
+
| `jsxSingleQuote` | `true` |
|
|
78
|
+
| `semi` | `true` |
|
|
79
|
+
| `tabWidth` | `2` |
|
|
80
|
+
| `useTabs` | `false` |
|
|
81
|
+
| `printWidth` | `80` |
|
|
82
|
+
| `endOfLine` | `"lf"` |
|
|
83
|
+
| `proseWrap` | `"always"` |
|
|
84
|
+
|
|
85
|
+
### Переопределения для Markdown
|
|
86
|
+
|
|
87
|
+
Для Markdown-файлов (`*.md`, `*.mdx`) `printWidth` уменьшен до `70` для лучшей читаемости.
|
|
88
|
+
|
|
89
|
+
Полную конфигурацию можно посмотреть в [`src/index.js`](./src/index.js).
|
|
90
|
+
|
|
91
|
+
## Авторы
|
|
92
|
+
|
|
93
|
+
- [Lazy And Focused](https://laf-team.ru)
|
|
94
|
+
- [lanvalird](https://lanvalird.ru)
|
|
95
|
+
- [FOCKUSTY](https://fockusty.vercel.app)
|
|
96
|
+
|
|
97
|
+
## Лицензия
|
|
98
|
+
|
|
99
|
+
[MIT](./LICENSE) © 2025 Lazy And Focused
|
package/package.json
CHANGED
|
@@ -1,38 +1,57 @@
|
|
|
1
|
-
{
|
|
2
|
-
"displayName": "Prettier Config for LAF",
|
|
3
|
-
"name": "@lazy-and-focused/prettier-config",
|
|
4
|
-
"version": "1.
|
|
5
|
-
"description": "
|
|
6
|
-
"type": "module",
|
|
7
|
-
"keywords": [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
{
|
|
2
|
+
"displayName": "Prettier Config for LAF",
|
|
3
|
+
"name": "@lazy-and-focused/prettier-config",
|
|
4
|
+
"version": "1.1.0",
|
|
5
|
+
"description": "Official Prettier configuration used by the Lazy-And-Focused team. Ensures uniform code formatting.",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"prettier",
|
|
9
|
+
"prettier-config",
|
|
10
|
+
"config",
|
|
11
|
+
"configuration",
|
|
12
|
+
"code-style",
|
|
13
|
+
"formatter",
|
|
14
|
+
"shared-config",
|
|
15
|
+
"laf",
|
|
16
|
+
"lazy-and-focused",
|
|
17
|
+
"javascript",
|
|
18
|
+
"typescript",
|
|
19
|
+
"formatting"
|
|
20
|
+
],
|
|
21
|
+
"author": {
|
|
22
|
+
"name": "Lazy-And-Focused",
|
|
23
|
+
"email": "love.laf.command@gmail.com",
|
|
24
|
+
"url": "https://laf-team.ru"
|
|
25
|
+
},
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/Lazy-And-Focused/prettier-config"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/Lazy-And-Focused/prettier-config#readme",
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/Lazy-And-Focused/prettier-config/issues"
|
|
33
|
+
},
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"contributors": [
|
|
36
|
+
{
|
|
37
|
+
"name": "lanvalird",
|
|
38
|
+
"email": "strazhognay@gmail.com",
|
|
39
|
+
"url": "https://lanvalird.ru"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "fockusty",
|
|
43
|
+
"email": "viserd.yt@gmail.com",
|
|
44
|
+
"url": "https://fockusty.vercel.app"
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public"
|
|
49
|
+
},
|
|
50
|
+
"files": [
|
|
51
|
+
"./src/index.js"
|
|
52
|
+
],
|
|
53
|
+
"exports": "./src/index.js",
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"prettier": "^3.0.0"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -1,44 +1,54 @@
|
|
|
1
|
-
// prettier.config.js, .prettierrc.js, prettier.config.mjs, or .prettierrc.mjs
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @see https:\\prettier.io\docs\configuration
|
|
5
|
-
* @type { import("prettier").Config }
|
|
6
|
-
*/
|
|
7
|
-
const config = {
|
|
8
|
-
arrowParens: "always",
|
|
9
|
-
bracketSpacing: true,
|
|
10
|
-
bracketSameLine: false,
|
|
11
|
-
trailingComma: "all",
|
|
12
|
-
singleQuote: true,
|
|
13
|
-
semi: true,
|
|
14
|
-
quoteProps: "as-needed",
|
|
15
|
-
|
|
16
|
-
tabWidth: 2,
|
|
17
|
-
useTabs: false,
|
|
18
|
-
|
|
19
|
-
printWidth: 80,
|
|
20
|
-
endOfLine: "lf",
|
|
21
|
-
embeddedLanguageFormatting: "auto",
|
|
22
|
-
|
|
23
|
-
experimentalTernaries: false,
|
|
24
|
-
|
|
25
|
-
requirePragma: false,
|
|
26
|
-
insertPragma: false,
|
|
27
|
-
|
|
28
|
-
htmlWhitespaceSensitivity: "css",
|
|
29
|
-
jsxSingleQuote: true,
|
|
30
|
-
|
|
31
|
-
proseWrap: "always",
|
|
32
|
-
|
|
33
|
-
overrides: [
|
|
34
|
-
{
|
|
35
|
-
files: ["*.md", ".mdx"],
|
|
36
|
-
options: {
|
|
37
|
-
printWidth: 70,
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export
|
|
44
|
-
|
|
1
|
+
// prettier.config.js, .prettierrc.js, prettier.config.mjs, or .prettierrc.mjs
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @see https:\\prettier.io\docs\configuration
|
|
5
|
+
* @type { import("prettier").Config }
|
|
6
|
+
*/
|
|
7
|
+
const config = {
|
|
8
|
+
arrowParens: "always",
|
|
9
|
+
bracketSpacing: true,
|
|
10
|
+
bracketSameLine: false,
|
|
11
|
+
trailingComma: "all",
|
|
12
|
+
singleQuote: true,
|
|
13
|
+
semi: true,
|
|
14
|
+
quoteProps: "as-needed",
|
|
15
|
+
|
|
16
|
+
tabWidth: 2,
|
|
17
|
+
useTabs: false,
|
|
18
|
+
|
|
19
|
+
printWidth: 80,
|
|
20
|
+
endOfLine: "lf",
|
|
21
|
+
embeddedLanguageFormatting: "auto",
|
|
22
|
+
|
|
23
|
+
experimentalTernaries: false,
|
|
24
|
+
|
|
25
|
+
requirePragma: false,
|
|
26
|
+
insertPragma: false,
|
|
27
|
+
|
|
28
|
+
htmlWhitespaceSensitivity: "css",
|
|
29
|
+
jsxSingleQuote: true,
|
|
30
|
+
|
|
31
|
+
proseWrap: "always",
|
|
32
|
+
|
|
33
|
+
overrides: [
|
|
34
|
+
{
|
|
35
|
+
files: ["*.md", ".mdx"],
|
|
36
|
+
options: {
|
|
37
|
+
printWidth: 70,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
config as prettierLazyAndFocusedConfiguration,
|
|
45
|
+
config as prettierLazyAndFocusedConfig,
|
|
46
|
+
config as prettierLafConfiguration,
|
|
47
|
+
config as prettierLafConfig,
|
|
48
|
+
config as prettierConfiguration,
|
|
49
|
+
config as prettierConfig,
|
|
50
|
+
config as configuration,
|
|
51
|
+
config as config,
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export default config;
|