Run Prettier, configure ESLint.

This commit is contained in:
Mikael Sand
2018-03-19 04:07:47 +02:00
parent 4e6ba9a786
commit 28235ea137
21 changed files with 422 additions and 253 deletions
+4 -2
View File
@@ -1,8 +1,10 @@
let percentReg = /^([+\-]?\d+(?:\.\d+)?(?:[eE][+\-]?\d+)?)(%?)$/;
export default function (percent) {
export default function(percent) {
let matched = percent.match(percentReg);
if (!matched) {
console.warn(`\`${percent}\` is not a valid number or percentage string.`);
console.warn(
`\`${percent}\` is not a valid number or percentage string.`
);
return 0;
}