- Linting (ESLint): As per latest ash-nazg

This commit is contained in:
Brett Zamir
2020-03-27 20:39:51 +08:00
parent 1f1452f4fa
commit 7914f26e02
20 changed files with 113 additions and 101 deletions

View File

@@ -224,7 +224,7 @@ function build (opts) {
numValue () {
if (!this.hasValue()) return 0;
let n = parseFloat(this.value);
let n = Number.parseFloat(this.value);
if (String(this.value).endsWith('%')) {
n /= 100.0;
}
@@ -414,7 +414,7 @@ function build (opts) {
// points and paths
svg.ToNumberArray = function (s) {
const a = svg.trim(svg.compressSpaces((s || '').replace(/,/g, ' '))).split(' ');
return a.map((_a) => parseFloat(_a));
return a.map((_a) => Number.parseFloat(_a));
};
svg.Point = class {
constructor (x, y) {
@@ -1308,7 +1308,7 @@ function build (opts) {
},
getScalar () {
return parseFloat(this.getToken());
return Number.parseFloat(this.getToken());
},
nextCommand () {
@@ -1908,8 +1908,8 @@ function build (opts) {
if (this.values.hasValue()) {
const p = ret.progress * (this.values.value.length - 1);
const lb = Math.floor(p), ub = Math.ceil(p);
ret.from = new svg.Property('from', parseFloat(this.values.value[lb]));
ret.to = new svg.Property('to', parseFloat(this.values.value[ub]));
ret.from = new svg.Property('from', Number.parseFloat(this.values.value[lb]));
ret.to = new svg.Property('to', Number.parseFloat(this.values.value[ub]));
ret.progress = (p - lb) / (ub - lb);
} else {
ret.from = this.from;
@@ -1942,7 +1942,7 @@ function build (opts) {
const r = from.r + (to.r - from.r) * p.progress;
const g = from.g + (to.g - from.g) * p.progress;
const b = from.b + (to.b - from.b) * p.progress;
return 'rgb(' + parseInt(r) + ',' + parseInt(g) + ',' + parseInt(b) + ')';
return 'rgb(' + Number.parseInt(r) + ',' + Number.parseInt(g) + ',' + Number.parseInt(b) + ')';
}
return this.attribute('from').value;
}

View File

@@ -158,7 +158,7 @@ const colorDefs = [
// re: /^rgb\((?<r>\d{1,3}),\s*(?<g>\d{1,3}),\s*(?<b>\d{1,3})\)$/,
example: ['rgb(123, 234, 45)', 'rgb(255,234,245)'],
process (_, ...bits) {
return bits.map((b) => parseInt(b));
return bits.map((b) => Number.parseInt(b));
}
},
{
@@ -166,7 +166,7 @@ const colorDefs = [
// re: /^(?<r>\w{2})(?<g>\w{2})(?<b>\w{2})$/,
example: ['#00ff00', '336699'],
process (_, ...bits) {
return bits.map((b) => parseInt(b, 16));
return bits.map((b) => Number.parseInt(b, 16));
}
},
{
@@ -174,7 +174,7 @@ const colorDefs = [
// re: /^(?<r>\w{1})(?<g>\w{1})(?<b>\w{1})$/,
example: ['#fb0', 'f0f'],
process (_, ...bits) {
return bits.map((b) => parseInt(b + b, 16));
return bits.map((b) => Number.parseInt(b + b, 16));
}
}
];