@forsakringskassan/prettier-config 1.4.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 +20 -0
- package/index.js +30 -0
- package/package.json +60 -0
- package/prettier.js +13 -0
package/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# @forsakringskassan/prettier-config
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
`npm install --save-dev @forsakringskassan/prettier-config`
|
|
6
|
+
|
|
7
|
+
In `package.json`:
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"name": "my-cool-library",
|
|
12
|
+
"version": "123",
|
|
13
|
+
"prettier": "@forsakringskassan/prettier-config"
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
You should not have `prettier` installed in your application, this preset bundles it.
|
|
18
|
+
If you have in since earlier you can uninstall it:
|
|
19
|
+
|
|
20
|
+
`npm rm prettier`
|
package/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
singleQuote: false,
|
|
3
|
+
arrowParens: "always",
|
|
4
|
+
tabWidth: 4,
|
|
5
|
+
printWidth: 80,
|
|
6
|
+
trailingComma: "all",
|
|
7
|
+
overrides: [
|
|
8
|
+
{
|
|
9
|
+
files: "package.json",
|
|
10
|
+
options: {
|
|
11
|
+
tabWidth: 2,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
files: ["*.vue", "*.html"],
|
|
16
|
+
options: {
|
|
17
|
+
printWidth: 120,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
files: ["*.scss"],
|
|
22
|
+
options: {
|
|
23
|
+
/* use a high value to not break add line-breaks when using
|
|
24
|
+
* variables shorthands, e.g.
|
|
25
|
+
* "padding: var(--a) var(--b) var(--c) var(--d)" */
|
|
26
|
+
printWidth: 160,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@forsakringskassan/prettier-config",
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"description": "FK Prettier Config",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"prettier"
|
|
7
|
+
],
|
|
8
|
+
"homepage": "https://github.com/Forsakringskassan/prettier-config",
|
|
9
|
+
"bugs": "https://github.com/Forsakringskassan/prettier-config/issues",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/Forsakringskassan/prettier-config.git"
|
|
13
|
+
},
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"author": "Försäkringskassan",
|
|
16
|
+
"main": "index.js",
|
|
17
|
+
"bin": {
|
|
18
|
+
"prettier": "prettier.js"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"index.js",
|
|
22
|
+
"prettier.js"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"eslint": "eslint .",
|
|
26
|
+
"eslint:fix": "eslint --fix .",
|
|
27
|
+
"lint": "eslint .",
|
|
28
|
+
"prepare": "husky install",
|
|
29
|
+
"prettier": "prettier .",
|
|
30
|
+
"prettier:check": "npm run prettier -- --check",
|
|
31
|
+
"prettier:write": "npm run prettier -- --write",
|
|
32
|
+
"test": "npm run lint && npm run prettier:check"
|
|
33
|
+
},
|
|
34
|
+
"commitlint": {
|
|
35
|
+
"extends": "@forsakringskassan/commitlint-config"
|
|
36
|
+
},
|
|
37
|
+
"lint-staged": {
|
|
38
|
+
"*.{js,json,md,css,scss,html,vue,ts}": "prettier --write",
|
|
39
|
+
"*.{js,vue,ts}": "eslint --fix"
|
|
40
|
+
},
|
|
41
|
+
"prettier": "./index.js",
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"prettier": "2.8.8"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@forsakringskassan/commitlint-config": "1.2.0",
|
|
47
|
+
"@forsakringskassan/eslint-config": "10.2.0",
|
|
48
|
+
"husky": "8.0.3",
|
|
49
|
+
"lint-staged": "13.2.3",
|
|
50
|
+
"npm-pkg-lint": "2.1.0",
|
|
51
|
+
"ts-node": "10.9.2"
|
|
52
|
+
},
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": ">= 16",
|
|
55
|
+
"npm": ">= 7"
|
|
56
|
+
},
|
|
57
|
+
"release": {
|
|
58
|
+
"extends": "@forsakringskassan/semantic-release-config"
|
|
59
|
+
}
|
|
60
|
+
}
|
package/prettier.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const path = require("path");
|
|
4
|
+
const { spawn } = require("child_process");
|
|
5
|
+
|
|
6
|
+
const pkgPath = path.dirname(require.resolve("prettier/package.json"));
|
|
7
|
+
const binary = path.join(pkgPath, "bin-prettier.js");
|
|
8
|
+
|
|
9
|
+
spawn("node", [binary, ...process.argv.slice(2)], {
|
|
10
|
+
stdio: "inherit",
|
|
11
|
+
}).on("exit", (code) => {
|
|
12
|
+
process.exit(code);
|
|
13
|
+
});
|