Chore: Add issue/pr template and general housekeeping tools and docs (#900)
* Add linting * Add issue templates and docs * Add root eslint config and remove tslint * Autofix lint issues
This commit is contained in:
@@ -242,7 +242,7 @@ export function parse(css: string, options: ParserOptions = {}) {
|
||||
if (lines) {
|
||||
lineno += lines.length;
|
||||
}
|
||||
let i = str.lastIndexOf('\n');
|
||||
const i = str.lastIndexOf('\n');
|
||||
column = i === -1 ? column + str.length : str.length - i;
|
||||
}
|
||||
|
||||
@@ -457,7 +457,7 @@ export function parse(css: string, options: ParserOptions = {}) {
|
||||
const pos = position();
|
||||
|
||||
// prop
|
||||
let propMatch = match(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);
|
||||
const propMatch = match(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);
|
||||
if (!propMatch) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -148,7 +148,8 @@ function buildNode(
|
||||
}
|
||||
let value = n.attributes[name];
|
||||
if (tagName === 'option' && name === 'selected' && value === false) {
|
||||
// legacy fix (TODO: if `value === false` can be generated for other attrs, should we also omit those other attrs from build?)
|
||||
// legacy fix (TODO: if `value === false` can be generated for other attrs,
|
||||
// should we also omit those other attrs from build ?)
|
||||
continue;
|
||||
}
|
||||
value =
|
||||
|
||||
@@ -154,7 +154,7 @@ function getAbsoluteSrcsetString(doc: Document, attributeValue: string) {
|
||||
|
||||
function collectCharacters(regEx: RegExp) {
|
||||
let chars: string;
|
||||
let match = regEx.exec(attributeValue.substring(pos));
|
||||
const match = regEx.exec(attributeValue.substring(pos));
|
||||
if (match) {
|
||||
chars = match[0];
|
||||
pos += chars.length;
|
||||
@@ -163,7 +163,7 @@ function getAbsoluteSrcsetString(doc: Document, attributeValue: string) {
|
||||
return '';
|
||||
}
|
||||
|
||||
let output = [];
|
||||
const output = [];
|
||||
while (true) {
|
||||
collectCharacters(SRCSET_COMMAS_OR_SPACES);
|
||||
if (pos >= attributeValue.length) {
|
||||
@@ -182,7 +182,7 @@ function getAbsoluteSrcsetString(doc: Document, attributeValue: string) {
|
||||
url = absoluteToDoc(doc, url);
|
||||
let inParens = false;
|
||||
while (true) {
|
||||
let c = attributeValue.charAt(pos);
|
||||
const c = attributeValue.charAt(pos);
|
||||
if (c === '') {
|
||||
output.push((url + descriptorsStr).trim());
|
||||
break;
|
||||
@@ -462,7 +462,7 @@ function serializeNode(
|
||||
});
|
||||
let cssText: string | null = null;
|
||||
if (stylesheet) {
|
||||
cssText = getCssRulesString(stylesheet as CSSStyleSheet);
|
||||
cssText = getCssRulesString(stylesheet );
|
||||
}
|
||||
if (cssText) {
|
||||
delete attributes.rel;
|
||||
|
||||
Reference in New Issue
Block a user