Skip to content

Commit

Permalink
Merge 85d1171 into edfb493
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] authored Jan 22, 2021
2 parents edfb493 + 85d1171 commit b4b526e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"yaml": "^1.10.0"
},
"devDependencies": {
"@ota-meshi/eslint-plugin": "^0.0.6",
"@ota-meshi/eslint-plugin": "^0.0.11",
"@types/eslint": "^7.2.0",
"@types/eslint-visitor-keys": "^1.0.0",
"@types/lodash": "^4.14.167",
Expand All @@ -50,9 +50,10 @@
"eslint": "^7.5.0",
"eslint-config-prettier": "^7.0.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-jsonc": "^0.7.1",
"eslint-plugin-jsonc": "^0.8.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.2.0",
"eslint-plugin-regexp": "^0.1.1",
"eslint-plugin-vue": "^7.2.0",
"mocha": "^7.0.0",
"nyc": "^15.1.0",
Expand Down
8 changes: 3 additions & 5 deletions src/tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const INT: TagResolver<number> = {
tag: "tag:yaml.org,2002:int",
test(str) {
// see https://yaml.org/spec/1.2/spec.html#id2805071
return /^[-+]?[0-9]+$/u.test(str)
return /^[-+]?\d+$/u.test(str)
},
resolve(str) {
return parseInt(str, 10)
Expand All @@ -70,7 +70,7 @@ export const INT_BASE16: TagResolver<number> = {
tag: "tag:yaml.org,2002:int",
test(str) {
// see https://yaml.org/spec/1.2/spec.html#id2805071
return /^0x[0-9a-fA-F]+$/u.test(str)
return /^0x[\da-fA-F]+$/u.test(str)
},
resolve(str) {
return parseInt(str.slice(2), 16)
Expand All @@ -81,9 +81,7 @@ export const FLOAT: TagResolver<number> = {
tag: "tag:yaml.org,2002:float",
test(str) {
// see https://yaml.org/spec/1.2/spec.html#id2805071
return /^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$/u.test(
str,
)
return /^[-+]?(\.\d+|\d+(\.\d*)?)([eE][-+]?\d+)?$/u.test(str)
},
resolve(str) {
return parseFloat(str)
Expand Down
2 changes: 1 addition & 1 deletion tests/src/parser/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ function checkLoc(ast: YAMLProgram, fileName: string, code: string) {
)
}
traverseNodes(ast, {
// eslint-disable-next-line complexity, no-shadow -- test
// eslint-disable-next-line complexity -- test
enterNode(node, parent) {
if (node.type !== "Program" && node.type !== "YAMLDocument") {
assert.ok(
Expand Down

0 comments on commit b4b526e

Please sign in to comment.