Skip to content

Commit 9b4cfc2

Browse files
authored
style: apply latest Prettier formatting (#743)
1 parent 2a335ce commit 9b4cfc2

File tree

7 files changed

+24
-28
lines changed

7 files changed

+24
-28
lines changed

commitizen.config.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ const types = [
1414
},
1515
{
1616
value: 'style',
17-
name:
18-
'style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)',
17+
name: 'style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)',
1918
},
2019
{
2120
value: 'refactor',
@@ -31,8 +30,7 @@ const types = [
3130
},
3231
{
3332
value: 'chore',
34-
name:
35-
'chore: Changes to the build process or auxiliary tools and libraries such as documentation generation',
33+
name: 'chore: Changes to the build process or auxiliary tools and libraries such as documentation generation',
3634
},
3735
{
3836
value: 'revert',

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"lint-staged": "10.2.11",
9797
"mocha": "^9.1.1",
9898
"nyc": "15.1.0",
99-
"prettier": "^2.0.5",
99+
"prettier": "^2.4.1",
100100
"pretty-quick": "3.1.1",
101101
"rollup": "2.21.0",
102102
"rollup-plugin-babel": "4.4.0",

src/cli/htmlhint.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,7 @@ function hintAllFiles(
323323
}
324324

325325
// split target to base & glob
326-
function getGlobInfo(
327-
target: string
328-
): {
326+
function getGlobInfo(target: string): {
329327
base: string
330328
pattern: string
331329
ignore?: string

src/core/htmlparser.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ export default class HTMLParser {
3636
this.lastEvent = null
3737
}
3838

39-
public makeMap(
40-
str: string
41-
): {
39+
public makeMap(str: string): {
4240
[key: string]: boolean
4341
} {
4442
const obj: { [key: string]: boolean } = {}
@@ -54,10 +52,12 @@ export default class HTMLParser {
5452
public parse(html: string): void {
5553
const mapCdataTags = this._mapCdataTags
5654

57-
// eslint-disable-next-line no-control-regex
58-
const regTag = /<(?:\/([^\s>]+)\s*|!--([\s\S]*?)--|!([^>]*?)|([\w\-:]+)((?:\s+[^\s"'>\/=\x00-\x0F\x7F\x80-\x9F]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'>]*))?)*?)\s*(\/?))>/g
59-
// eslint-disable-next-line no-control-regex
60-
const regAttr = /\s*([^\s"'>\/=\x00-\x0F\x7F\x80-\x9F]+)(?:\s*=\s*(?:(")([^"]*)"|(')([^']*)'|([^\s"'>]*)))?/g
55+
const regTag =
56+
// eslint-disable-next-line no-control-regex
57+
/<(?:\/([^\s>]+)\s*|!--([\s\S]*?)--|!([^>]*?)|([\w\-:]+)((?:\s+[^\s"'>\/=\x00-\x0F\x7F\x80-\x9F]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'>]*))?)*?)\s*(\/?))>/g
58+
const regAttr =
59+
// eslint-disable-next-line no-control-regex
60+
/\s*([^\s"'>\/=\x00-\x0F\x7F\x80-\x9F]+)(?:\s*=\s*(?:(")([^"]*)"|(')([^']*)'|([^\s"'>]*)))?/g
6161
const regLine = /\r?\n/g
6262

6363
let match: RegExpExecArray | null
@@ -312,9 +312,7 @@ export default class HTMLParser {
312312
}
313313
}
314314

315-
public getMapAttrs(
316-
arrAttrs: Attr[]
317-
): {
315+
public getMapAttrs(arrAttrs: Attr[]): {
318316
[name: string]: string
319317
} {
320318
const mapAttrs: { [name: string]: string } = {}

src/core/rules/attr-unsafe-chars.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ export default {
99
let attr
1010
const col = event.col + event.tagName.length + 1
1111
// exclude \x09(\t), \x0a(\r), \x0d(\n)
12-
// eslint-disable-next-line no-misleading-character-class, no-control-regex
13-
const regUnsafe = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/
12+
const regUnsafe =
13+
// eslint-disable-next-line no-misleading-character-class, no-control-regex
14+
/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/
1415
let match
1516

1617
for (let i = 0, l = attrs.length; i < l; i++) {

src/core/rules/inline-script-disabled.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ export default {
99
let attr
1010
const col = event.col + event.tagName.length + 1
1111
let attrName
12-
const reEvent = /^on(unload|message|submit|select|scroll|resize|mouseover|mouseout|mousemove|mouseleave|mouseenter|mousedown|load|keyup|keypress|keydown|focus|dblclick|click|change|blur|error)$/i
12+
const reEvent =
13+
/^on(unload|message|submit|select|scroll|resize|mouseover|mouseout|mousemove|mouseleave|mouseenter|mousedown|load|keyup|keypress|keydown|focus|dblclick|click|change|blur|error)$/i
1314

1415
for (let i = 0, l = attrs.length; i < l; i++) {
1516
attr = attrs[i]

0 commit comments

Comments
 (0)