djlint 1.7.4 → 1.9.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/bin/index.js +14 -0
- package/package.json +2 -2
package/bin/index.js
CHANGED
|
@@ -127,6 +127,16 @@ function run(stdin) {
|
|
|
127
127
|
describe: 'Use .gitignore file to extend excludes.',
|
|
128
128
|
type: 'boolean',
|
|
129
129
|
demandOption: false,
|
|
130
|
+
})
|
|
131
|
+
.option('format-css', {
|
|
132
|
+
describe: 'Also format contents of <style> tags.',
|
|
133
|
+
type: 'boolean',
|
|
134
|
+
demandOption: false,
|
|
135
|
+
})
|
|
136
|
+
.option('format-js', {
|
|
137
|
+
describe: 'Also format contents of <script> tags.',
|
|
138
|
+
type: 'boolean',
|
|
139
|
+
demandOption: false,
|
|
130
140
|
}).argv;
|
|
131
141
|
|
|
132
142
|
// Set flags
|
|
@@ -142,6 +152,8 @@ function run(stdin) {
|
|
|
142
152
|
const use_gitignore = options['use-gitignore']
|
|
143
153
|
? '--use-gitignore'
|
|
144
154
|
: undefined;
|
|
155
|
+
const format_css = options['format-css'] ? '--format-css' : undefined;
|
|
156
|
+
const format_js = options['format-js'] ? '--format-js' : undefined;
|
|
145
157
|
const has_stdin = stdin === '' ? options._[0] : '-';
|
|
146
158
|
|
|
147
159
|
// Set variables
|
|
@@ -164,6 +176,8 @@ function run(stdin) {
|
|
|
164
176
|
indent,
|
|
165
177
|
profile,
|
|
166
178
|
ignore,
|
|
179
|
+
format_css,
|
|
180
|
+
format_js,
|
|
167
181
|
].filter((x) => {
|
|
168
182
|
return x !== undefined;
|
|
169
183
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "djlint",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "HTML Template Linter and Formatter",
|
|
5
5
|
"main": "./bin/index.js",
|
|
6
6
|
"directories": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"format": "prettier --config .prettierrc \"{bin,docs}/**/*.{ts,css,less,scss,js,json,md,yaml,html}\" --write",
|
|
40
40
|
"postinstall": "node ./bin/install.js",
|
|
41
41
|
"pre-commit": "lint-staged",
|
|
42
|
-
"commit": "git add . && pre-commit run
|
|
42
|
+
"commit": "git add . && pre-commit run; npm run pre-commit && cz --no-verify",
|
|
43
43
|
"test": "xo"
|
|
44
44
|
},
|
|
45
45
|
"author": {
|