@html-validate/prettier-config 2.1.0 → 2.3.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 +20 -0
- package/README.md +25 -2
- package/bin/lint-staged.js +14 -0
- package/{prettier.js → bin/prettier.js} +0 -0
- package/lint-staged.js +3 -0
- package/package.json +16 -16
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 David Sveningsson <ext@sidvind.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
+
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, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -10,12 +10,35 @@ npm install --save-dev @html-validate/prettier-config
|
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
```
|
|
14
|
+
npm pkg set prettier="@html-validate/prettier-config"
|
|
15
|
+
npm pkg set scripts.prettier:check="prettier --check ."
|
|
16
|
+
npm pkg set scripts.prettier:write="prettier --write ."
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Or manually edit `package.json`:
|
|
14
20
|
|
|
15
21
|
```json
|
|
16
22
|
{
|
|
23
|
+
"scripts": {
|
|
24
|
+
"prettier:check": "prettier --check .",
|
|
25
|
+
"prettier:write": "prettier --write ."
|
|
26
|
+
},
|
|
17
27
|
"prettier": "@html-validate/prettier-config"
|
|
18
28
|
}
|
|
19
29
|
```
|
|
20
30
|
|
|
21
|
-
Prettier does not need to be installed separately, this package includes `prettier` and
|
|
31
|
+
Prettier does not need to be installed separately, this package includes `prettier` and its binary.
|
|
32
|
+
|
|
33
|
+
## lint-staged
|
|
34
|
+
|
|
35
|
+
To use lint-staged (included) configure the `pre-commit` hook to run husky with the `--config` flag:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
#!/bin/sh
|
|
39
|
+
|
|
40
|
+
configfile=$(node -p 'require.resolve("@html-validate/prettier-config/lint-staged")')
|
|
41
|
+
exec npm exec lint-staged -- --config "${configfile}"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Lint-staged does not need to be installed separately, this package includes `lint-staged` and its binary.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const path = require("path");
|
|
4
|
+
const { spawn } = require("child_process"); // eslint-disable-line security/detect-child-process
|
|
5
|
+
|
|
6
|
+
const pkgPath = path.dirname(require.resolve("lint-staged/package.json"));
|
|
7
|
+
const binary = path.join(pkgPath, "bin/lint-staged.js");
|
|
8
|
+
|
|
9
|
+
spawn("node", [binary, ...process.argv.slice(2)], {
|
|
10
|
+
stdio: "inherit",
|
|
11
|
+
}).on("exit", (code) => {
|
|
12
|
+
/* eslint-disable-next-line no-process-exit */
|
|
13
|
+
process.exit(code);
|
|
14
|
+
});
|
|
File without changes
|
package/lint-staged.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@html-validate/prettier-config",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Prettier sharable config used by the various HTML-validate packages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"prettier"
|
|
@@ -17,10 +17,12 @@
|
|
|
17
17
|
"author": "David Sveningsson <ext@sidvind.com>",
|
|
18
18
|
"main": "index.js",
|
|
19
19
|
"bin": {
|
|
20
|
-
"
|
|
20
|
+
"lint-staged": "bin/lint-staged.js",
|
|
21
|
+
"prettier": "bin/prettier.js"
|
|
21
22
|
},
|
|
22
23
|
"files": [
|
|
23
|
-
"*.js"
|
|
24
|
+
"*.js",
|
|
25
|
+
"bin"
|
|
24
26
|
],
|
|
25
27
|
"scripts": {
|
|
26
28
|
"prepare": "husky install",
|
|
@@ -31,31 +33,29 @@
|
|
|
31
33
|
"commitlint": {
|
|
32
34
|
"extends": "@html-validate"
|
|
33
35
|
},
|
|
34
|
-
"lint-staged": {
|
|
35
|
-
"*.{js,json,md}": "prettier --write"
|
|
36
|
-
},
|
|
37
36
|
"prettier": ".",
|
|
37
|
+
"release": {
|
|
38
|
+
"extends": "@html-validate/semantic-release-config"
|
|
39
|
+
},
|
|
38
40
|
"dependencies": {
|
|
39
|
-
"
|
|
41
|
+
"lint-staged": "13.0.3",
|
|
42
|
+
"prettier": "2.7.1"
|
|
40
43
|
},
|
|
41
44
|
"devDependencies": {
|
|
42
|
-
"@html-validate/commitlint-config": "
|
|
43
|
-
"@html-validate/semantic-release-config": "3.
|
|
44
|
-
"husky": "
|
|
45
|
-
"lint
|
|
46
|
-
"npm-pkg-lint": "1.10.0"
|
|
45
|
+
"@html-validate/commitlint-config": "3.0.4",
|
|
46
|
+
"@html-validate/semantic-release-config": "3.5.0",
|
|
47
|
+
"husky": "8.0.1",
|
|
48
|
+
"npm-pkg-lint": "1.11.1"
|
|
47
49
|
},
|
|
48
50
|
"engines": {
|
|
49
|
-
"node": ">=
|
|
51
|
+
"node": ">= 14.13.1"
|
|
50
52
|
},
|
|
51
53
|
"publishConfig": {
|
|
52
54
|
"access": "public"
|
|
53
55
|
},
|
|
54
|
-
"release": {
|
|
55
|
-
"extends": "@html-validate/semantic-release-config"
|
|
56
|
-
},
|
|
57
56
|
"renovate": {
|
|
58
57
|
"extends": [
|
|
58
|
+
"gitlab>html-validate/renovate-config",
|
|
59
59
|
"gitlab>html-validate/renovate-config:bundled"
|
|
60
60
|
]
|
|
61
61
|
}
|