@mkaradeniz/prettier-config 3.0.0 → 4.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/index.js +45 -0
- package/package.json +21 -21
- package/LICENSE +0 -21
- package/README.md +0 -43
package/index.js
CHANGED
|
@@ -1,10 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @type {import("prettier").Config
|
|
3
|
+
* & import("@ianvs/prettier-plugin-sort-imports").PluginConfig}
|
|
4
|
+
*/
|
|
1
5
|
module.exports = {
|
|
2
6
|
arrowParens: 'avoid',
|
|
7
|
+
bracketSameLine: false,
|
|
3
8
|
bracketSpacing: true,
|
|
9
|
+
embeddedLanguageFormatting: 'auto',
|
|
10
|
+
endOfLine: 'lf',
|
|
11
|
+
experimentalTernaries: false,
|
|
12
|
+
htmlWhitespaceSensitivity: 'css',
|
|
13
|
+
jsxSingleQuote: false,
|
|
4
14
|
printWidth: 140,
|
|
15
|
+
proseWrap: 'preserve',
|
|
16
|
+
quoteProps: 'as-needed',
|
|
17
|
+
requirePragma: false,
|
|
5
18
|
semi: true,
|
|
19
|
+
singleAttributePerLine: false,
|
|
6
20
|
singleQuote: true,
|
|
7
21
|
tabWidth: 2,
|
|
8
22
|
trailingComma: 'all',
|
|
9
23
|
useTabs: false,
|
|
24
|
+
|
|
25
|
+
plugins: [
|
|
26
|
+
// Sorts imports by specified configuration in `importOrder`. => https://github.com/IanVS/prettier-plugin-sort-imports
|
|
27
|
+
'@ianvs/prettier-plugin-sort-imports',
|
|
28
|
+
// Sorts tailwind classes. => https://github.com/tailwindlabs/prettier-plugin-tailwindcss
|
|
29
|
+
'prettier-plugin-tailwindcss',
|
|
30
|
+
// Sorts keys in package.json files. => https://github.com/matzkoh/prettier-plugin-packagejson
|
|
31
|
+
'prettier-plugin-packagejson',
|
|
32
|
+
].map(require.resolve),
|
|
33
|
+
|
|
34
|
+
// * @ianvs/prettier-plugin-sort-imports config. See: https://github.com/IanVS/prettier-plugin-sort-imports#options
|
|
35
|
+
importOrder: [
|
|
36
|
+
// `react-scan` must be imported before any `react` imports.
|
|
37
|
+
'^react-scan$',
|
|
38
|
+
'^@/(.*)/ReactScan$',
|
|
39
|
+
'^react$',
|
|
40
|
+
'^react-dom$',
|
|
41
|
+
'^next/(.*)$',
|
|
42
|
+
'<BUILTIN_MODULES>',
|
|
43
|
+
'<THIRD_PARTY_MODULES>',
|
|
44
|
+
'',
|
|
45
|
+
'^@/(.*)$',
|
|
46
|
+
'',
|
|
47
|
+
'^[.]',
|
|
48
|
+
'',
|
|
49
|
+
'../globals.css',
|
|
50
|
+
],
|
|
51
|
+
importOrderTypeScriptVersion: '5.3.3',
|
|
52
|
+
|
|
53
|
+
// * prettier-plugin-tailwindcss config. See: https://github.com/tailwindlabs/prettier-plugin-tailwindcss?tab=readme-ov-file#options
|
|
54
|
+
tailwindFunctions: ['cn', 'cva', 'twMerge'],
|
|
10
55
|
};
|
package/package.json
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mkaradeniz/prettier-config",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"description": "Personal Prettier Configuration.",
|
|
6
|
-
"homepage": "https://github.com/mkaradeniz/tooling/#readme",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "https://github.com/mkaradeniz/tooling.git"
|
|
10
|
-
},
|
|
11
|
-
"bugs": {
|
|
12
|
-
"url": "https://github.com/mkaradeniz/tooling/issues"
|
|
13
|
-
},
|
|
3
|
+
"version": "4.0.0",
|
|
4
|
+
"private": false,
|
|
14
5
|
"license": "MIT",
|
|
15
6
|
"main": "index.js",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
|
|
7
|
+
"files": [
|
|
8
|
+
"index.js"
|
|
9
|
+
],
|
|
19
10
|
"scripts": {
|
|
20
|
-
"clean": "
|
|
21
|
-
"format": "prettier
|
|
22
|
-
|
|
11
|
+
"clean": "rimraf node_modules",
|
|
12
|
+
"format": "prettier --log-level warn --write ."
|
|
13
|
+
},
|
|
14
|
+
"lint-staged": {
|
|
15
|
+
"**/*.{json,js}": "prettier --log-level warn --write"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@ianvs/prettier-plugin-sort-imports": "^4.7.0",
|
|
19
|
+
"prettier": "^3.6.2",
|
|
20
|
+
"prettier-plugin-packagejson": "^2.5.19",
|
|
21
|
+
"prettier-plugin-tailwindcss": "^0.6.14"
|
|
23
22
|
},
|
|
24
23
|
"devDependencies": {
|
|
25
|
-
"
|
|
24
|
+
"husky": "^9.1.7",
|
|
25
|
+
"lint-staged": "^16.1.6",
|
|
26
|
+
"rimraf": "^6.0.1"
|
|
26
27
|
},
|
|
27
28
|
"peerDependencies": {
|
|
28
|
-
"prettier": "^
|
|
29
|
-
}
|
|
30
|
-
"gitHead": "864cd28fd774f43883472c79eb1202c5137c2f28"
|
|
29
|
+
"prettier": "^3.6.2"
|
|
30
|
+
}
|
|
31
31
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2019 Max Karadeniz
|
|
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
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# @mkaradeniz/prettier-config
|
|
2
|
-
|
|
3
|
-
Personal Prettier TypeScript React Configuration.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
yarn add -D prettier
|
|
9
|
-
yarn add -D @mkaradeniz/prettier-config
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
Create a `prettier.config.js` with the following content:
|
|
13
|
-
|
|
14
|
-
```javascript
|
|
15
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
16
|
-
module.exports = require('@mkaradeniz/prettier-config');
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Add following script to the `package.json`:
|
|
20
|
-
|
|
21
|
-
### JavaScript
|
|
22
|
-
|
|
23
|
-
```json
|
|
24
|
-
"format": "prettier \"./src/**/*.js\" --config ./prettier.config.js --write",
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### JavaScript React
|
|
28
|
-
|
|
29
|
-
```json
|
|
30
|
-
"format": "prettier \"./src/**/*.{js,jsx}\" --config ./prettier.config.js --write",
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### TypeScript
|
|
34
|
-
|
|
35
|
-
```json
|
|
36
|
-
"format": "prettier \"./src/**/*.ts\" --config ./prettier.config.js --write",
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### TypeScript React
|
|
40
|
-
|
|
41
|
-
```json
|
|
42
|
-
"format": "prettier \"./src/**/*.{ts,tsx}\" --config ./prettier.config.js --write",
|
|
43
|
-
```
|