add trailing commas to prettier config, only run on .ts files

pull/618/head
Rich Harris 7 years ago
parent 485d7b4ef1
commit b0a1616e31

@ -24,7 +24,7 @@
"dev:shared": "rollup -c rollup/rollup.config.shared.js -w",
"pretest": "npm run build",
"prepublish": "npm run build && npm run lint",
"prettier": "prettier --use-tabs --single-quote --write \"src/**/*.ts\" \"src/**/*.js\""
"prettier": "prettier --use-tabs --single-quote --trailing-comma es5 --write \"src/**/*.ts\""
},
"repository": {
"type": "git",

@ -84,7 +84,7 @@ export default class Generator {
enter: (node: Node) => {
this.code.addSourcemapLocation(node.start);
this.code.addSourcemapLocation(node.end);
}
},
});
}
@ -127,7 +127,7 @@ export default class Generator {
if (lexicalDepth === 0 && context)
code.overwrite(node.start, node.end, context, {
storeName: true,
contentOnly: false
contentOnly: false,
});
} else if (isReference(node, parent)) {
const { name } = flattenReference(node);
@ -182,13 +182,13 @@ export default class Generator {
leave(node: Node) {
if (/^Function/.test(node.type)) lexicalDepth -= 1;
if (node._scope) scope = scope.parent;
}
},
});
return {
dependencies: expression._dependencies, // TODO probably a better way to do this
contexts: usedContexts,
snippet: `[✂${expression.start}-${expression.end}✂]`
snippet: `[✂${expression.start}-${expression.end}✂]`,
};
}
@ -227,7 +227,7 @@ export default class Generator {
leave(node: Node) {
if (node._scope) scope = scope.parent;
}
},
});
dependencies.forEach(name => {
@ -294,7 +294,7 @@ export default class Generator {
function addString(str: string) {
compiled.addSource({
content: new MagicString(str)
content: new MagicString(str),
});
}
@ -308,7 +308,7 @@ export default class Generator {
if (!parts.length) {
compiled.addSource({
filename,
content: new MagicString(this.source).remove(0, this.source.length)
content: new MagicString(this.source).remove(0, this.source.length),
});
}
@ -322,7 +322,7 @@ export default class Generator {
compiled.addSource({
filename,
content: snippet
content: snippet,
});
});
@ -333,9 +333,9 @@ export default class Generator {
code: compiled.toString(),
map: compiled.generateMap({
includeContent: true,
file: options.outputFilename
file: options.outputFilename,
}),
css: this.css
css: this.css,
};
}
@ -493,7 +493,7 @@ export default class Generator {
const { key } = templateProperties.onrender;
this.code.overwrite(key.start, key.end, 'oncreate', {
storeName: true,
contentOnly: false
contentOnly: false,
});
templateProperties.oncreate = templateProperties.onrender;
}
@ -502,7 +502,7 @@ export default class Generator {
const { key } = templateProperties.onteardown;
this.code.overwrite(key.start, key.end, 'ondestroy', {
storeName: true,
contentOnly: false
contentOnly: false,
});
templateProperties.ondestroy = templateProperties.onteardown;
}
@ -597,7 +597,7 @@ export default class Generator {
computations,
hasJs,
namespace,
templateProperties
templateProperties,
};
}
}

@ -93,7 +93,7 @@ export default class Block {
outro: new CodeBuilder(),
unmount: new CodeBuilder(),
detachRaw: new CodeBuilder(),
destroy: new CodeBuilder()
destroy: new CodeBuilder(),
};
this.hasIntroMethod = false; // a block could have an intro method but not intro transitions, e.g. if a sibling block has intros

@ -63,7 +63,7 @@ export default function dom(
computations,
hasJs,
templateProperties,
namespace
namespace,
} = generator.parseJs();
const { block, state } = preprocess(generator, namespace, parsed.html);
@ -74,7 +74,7 @@ export default function dom(
const builders = {
main: new CodeBuilder(),
_set: new CodeBuilder()
_set: new CodeBuilder(),
};
if (computations.length) {
@ -319,7 +319,7 @@ export default function dom(
leave(node) {
if (node._scope) scope = scope.parent;
}
},
});
if (key === 'transitionManager') {
@ -343,6 +343,6 @@ export default function dom(
return generator.generate(builders.main.toString(), options, {
name,
format
format,
});
}

@ -26,7 +26,7 @@ const elementsWithoutText = new Set([
'optgroup',
'select',
'ul',
'video'
'video',
]);
const preprocessors = {
@ -40,7 +40,7 @@ const preprocessors = {
block.addDependencies(dependencies);
node._state = getChildState(state, {
name: block.getUniqueName('text')
name: block.getUniqueName('text'),
});
},
@ -87,7 +87,7 @@ const preprocessors = {
block.addDependencies(dependencies);
node._block = block.child({
name: generator.getUniqueName(`create_if_block`)
name: generator.getUniqueName(`create_if_block`),
});
node._state = getChildState(state);
@ -107,7 +107,7 @@ const preprocessors = {
attachBlocks(node.else.children[0]);
} else if (node.else) {
node.else._block = block.child({
name: generator.getUniqueName(`create_if_block`)
name: generator.getUniqueName(`create_if_block`),
});
node.else._state = getChildState(state);
@ -181,11 +181,11 @@ const preprocessors = {
indexNames,
listNames,
params: block.params.concat(listName, context, indexName)
params: block.params.concat(listName, context, indexName),
});
node._state = getChildState(state, {
inEachBlock: true
inEachBlock: true,
});
generator.blocks.push(node._block);
@ -195,7 +195,7 @@ const preprocessors = {
if (node.else) {
node.else._block = block.child({
name: generator.getUniqueName(`${node._block.name}_else`)
name: generator.getUniqueName(`${node._block.name}_else`),
});
node.else._state = getChildState(state);
@ -235,7 +235,7 @@ const preprocessors = {
namespace: node.name === 'svg'
? 'http://www.w3.org/2000/svg'
: state.namespace,
allUsedContexts: []
allUsedContexts: [],
});
}
@ -267,7 +267,7 @@ const preprocessors = {
);
node._block = block.child({
name: generator.getUniqueName(`create_${name}_yield_fragment`)
name: generator.getUniqueName(`create_${name}_yield_fragment`),
});
generator.blocks.push(node._block);
@ -278,7 +278,7 @@ const preprocessors = {
preprocessChildren(generator, block, node._state, node);
}
}
}
},
};
function preprocessChildren(
@ -359,13 +359,13 @@ export default function preprocess(
indexNames: new Map(),
listNames: new Map(),
dependencies: new Set()
dependencies: new Set(),
});
const state: State = {
namespace,
parentNode: null,
isTopLevel: true
isTopLevel: true,
};
generator.blocks.push(block);

@ -15,12 +15,12 @@ export default function visitAttribute(
// attributes without values, e.g. <textarea readonly>
local.staticAttributes.push({
name: attribute.name,
value: true
value: true,
});
} else if (attribute.value.length === 0) {
local.staticAttributes.push({
name: attribute.name,
value: `''`
value: `''`,
});
} else if (attribute.value.length === 1) {
const value = attribute.value[0];
@ -32,7 +32,7 @@ export default function visitAttribute(
: value.data;
local.staticAttributes.push({
name: attribute.name,
value: result
value: result,
});
} else {
// simple dynamic attributes
@ -42,7 +42,7 @@ export default function visitAttribute(
local.dynamicAttributes.push({
name: attribute.name,
value: snippet,
dependencies
dependencies,
});
}
} else {
@ -72,7 +72,7 @@ export default function visitAttribute(
local.dynamicAttributes.push({
name: attribute.name,
value,
dependencies: allDependencies
dependencies: allDependencies,
});
}
}

@ -50,7 +50,7 @@ export default function visitBinding(
name: attribute.name,
value: snippet,
obj,
prop
prop,
});
const setter = getSetter({
@ -60,7 +60,7 @@ export default function visitBinding(
context: '_context',
attribute,
dependencies,
value: 'value'
value: 'value',
});
generator.hasComplexBindings = true;

@ -26,14 +26,14 @@ const order = {
Attribute: 1,
EventHandler: 2,
Binding: 3,
Ref: 4
Ref: 4,
};
const visitors = {
Attribute: visitAttribute,
EventHandler: visitEventHandler,
Binding: visitBinding,
Ref: visitRef
Ref: visitRef,
};
export default function visitComponent(
@ -60,7 +60,7 @@ export default function visitComponent(
bindings: [],
create: new CodeBuilder(),
update: new CodeBuilder()
update: new CodeBuilder(),
};
const isTopLevel = !state.parentNode;
@ -114,7 +114,7 @@ export default function visitComponent(
const componentInitProperties = [
`target: ${!isTopLevel ? state.parentNode : 'null'}`,
`_root: ${block.component}._root`
`_root: ${block.component}._root`,
];
// Component has children, put them in a separate {{yield}} block

@ -30,7 +30,7 @@ export default function visitEachBlock(
i,
params,
anchor,
mountOrIntro
mountOrIntro,
};
const { snippet } = block.contextualise(node.expression);
@ -144,7 +144,7 @@ function keyed(
i,
params,
anchor,
mountOrIntro
mountOrIntro,
}
) {
const key = block.getUniqueName('key');
@ -350,7 +350,7 @@ function unkeyed(
i,
params,
anchor,
mountOrIntro
mountOrIntro,
}
) {
block.builders.create.addBlock(deindent`

@ -67,7 +67,7 @@ export default function visitBinding(
context: '_svelte',
attribute,
dependencies,
value
value,
});
let updateElement = `${state.parentNode}.${attribute.name} = ${snippet};`;
const lock = block.alias(`${state.parentNode}_updating`);

@ -13,21 +13,21 @@ import { Node } from '../../../../interfaces';
import { State } from '../../interfaces';
const meta = {
':Window': visitWindow
':Window': visitWindow,
};
const order = {
Attribute: 1,
Binding: 2,
EventHandler: 3,
Ref: 4
Ref: 4,
};
const visitors = {
Attribute: visitAttribute,
EventHandler: visitEventHandler,
Binding: visitBinding,
Ref: visitRef
Ref: visitRef,
};
export default function visitElement(
@ -136,7 +136,7 @@ export default function visitElement(
node.attributes.push({
type: 'Attribute',
name: 'value',
value: node.children
value: node.children,
});
node.children = [];

@ -85,7 +85,7 @@ export default function visitEventHandler(
if (shouldHoist) {
generator.blocks.push(
<Block>{
render: () => handler
render: () => handler,
}
);
} else {

@ -19,8 +19,8 @@ const lookup = {
'tfoot',
'th',
'thead',
'tr'
]
'tr',
],
},
allowfullscreen: { propertyName: 'allowFullscreen', appliesTo: ['iframe'] },
alt: { appliesTo: ['applet', 'area', 'img', 'input'] },
@ -41,8 +41,8 @@ const lookup = {
'tfoot',
'td',
'th',
'tr'
]
'tr',
],
},
border: { appliesTo: ['img', 'object', 'table'] },
buffered: { appliesTo: ['audio', 'video'] },
@ -77,8 +77,8 @@ const lookup = {
'optgroup',
'option',
'select',
'textarea'
]
'textarea',
],
},
download: { appliesTo: ['a', 'area'] },
draggable: {},
@ -97,13 +97,13 @@ const lookup = {
'output',
'progress',
'select',
'textarea'
]
'textarea',
],
},
formaction: { appliesTo: ['input', 'button'] },
headers: { appliesTo: ['td', 'th'] },
height: {
appliesTo: ['canvas', 'embed', 'iframe', 'img', 'input', 'object', 'video']
appliesTo: ['canvas', 'embed', 'iframe', 'img', 'input', 'object', 'video'],
},
hidden: {},
high: { appliesTo: ['meter'] },
@ -143,8 +143,8 @@ const lookup = {
'textarea',
'map',
'meta',
'param'
]
'param',
],
},
novalidate: { propertyName: 'noValidate', appliesTo: ['form'] },
open: { appliesTo: ['details'] },
@ -181,8 +181,8 @@ const lookup = {
'script',
'source',
'track',
'video'
]
'video',
],
},
srcdoc: { appliesTo: ['iframe'] },
srclang: { appliesTo: ['track'] },
@ -204,8 +204,8 @@ const lookup = {
'script',
'source',
'style',
'menu'
]
'menu',
],
},
usemap: { propertyName: 'useMap', appliesTo: ['img', 'input', 'object'] },
value: {
@ -218,13 +218,13 @@ const lookup = {
'progress',
'param',
'select',
'textarea'
]
'textarea',
],
},
width: {
appliesTo: ['canvas', 'embed', 'iframe', 'img', 'input', 'object', 'video']
appliesTo: ['canvas', 'embed', 'iframe', 'img', 'input', 'object', 'video'],
},
wrap: { appliesTo: ['textarea'] }
wrap: { appliesTo: ['textarea'] },
};
Object.keys(lookup).forEach(name => {

@ -11,7 +11,7 @@ const associatedEvents = {
outerHeight: 'resize',
scrollX: 'scroll',
scrollY: 'scroll'
scrollY: 'scroll',
};
const readonly = new Set([
@ -19,7 +19,7 @@ const readonly = new Set([
'innerHeight',
'outerWidth',
'outerHeight',
'online'
'online',
]);
export default function visitWindow(

@ -27,8 +27,8 @@ function getBranches(
block: node._block.name,
hasUpdateMethod: node._block.hasUpdateMethod,
hasIntroMethod: node._block.hasIntroMethod,
hasOutroMethod: node._block.hasOutroMethod
}
hasOutroMethod: node._block.hasOutroMethod,
},
];
visitChildren(generator, block, state, node);
@ -43,7 +43,7 @@ function getBranches(
block: node.else ? node.else._block.name : null,
hasUpdateMethod: node.else ? node.else._block.hasUpdateMethod : false,
hasIntroMethod: node.else ? node.else._block.hasIntroMethod : false,
hasOutroMethod: node.else ? node.else._block.hasOutroMethod : false
hasOutroMethod: node.else ? node.else._block.hasOutroMethod : false,
});
if (node.else) {

@ -13,5 +13,5 @@ export default {
MustacheTag,
RawMustacheTag,
Text,
YieldTag
YieldTag,
};

@ -7,7 +7,7 @@ export default function getSetter({
context,
attribute,
dependencies,
value
value,
}) {
const tail = attribute.value.type === 'MemberExpression'
? getTailSnippet(attribute.value)

@ -43,7 +43,7 @@ export default function ssr(
generator,
contexts: new Map(),
indexes: new Map(),
conditions: []
conditions: [],
});
parsed.html.children.forEach((node: Node) => {

@ -29,7 +29,7 @@ export default function visitEachBlock(
const childBlock = block.child({
contexts,
indexes,
contextDependencies
contextDependencies,
});
node.children.forEach((child: Node) => {

@ -7,7 +7,7 @@ import Block from '../Block';
import { Node } from '../../../interfaces';
const meta = {
':Window': visitWindow
':Window': visitWindow,
};
function stringifyAttributeValue(block: Block, chunks: Node[]) {

@ -13,7 +13,7 @@ export default function visitIfBlock(
generator.append('${ ' + snippet + ' ? `');
const childBlock = block.child({
conditions: block.conditions.concat(snippet)
conditions: block.conditions.concat(snippet),
});
node.children.forEach((child: Node) => {

@ -15,5 +15,5 @@ export default {
MustacheTag,
RawMustacheTag,
Text,
YieldTag
YieldTag,
};

@ -23,7 +23,7 @@ export default function getGlobals(imports: Declaration[], options: Options) {
} else {
const warning = {
message: `No name was supplied for imported module '${x.source
.value}'. Guessing '${x.name}', but you should use options.globals`
.value}'. Guessing '${x.name}', but you should use options.globals`,
};
if (onwarn) {

@ -26,7 +26,7 @@ function normalizeOptions(options: CompileOptions): CompileOptions {
onerror: (error: Error) => {
throw error;
}
},
},
options
);

@ -51,7 +51,7 @@ export class Parser {
start: null,
end: null,
type: 'Fragment',
children: []
children: [],
};
this.css = null;
@ -197,6 +197,6 @@ export default function parse(
hash: hash(parser.template),
html: parser.html,
css: parser.css,
js: parser.js
js: parser.js,
};
}

@ -60,7 +60,7 @@ export function readEventHandlerDirective(
end: parser.index,
type: 'EventHandler',
name,
expression
expression,
};
}
@ -114,7 +114,7 @@ export function readBindingDirective(
type: 'Identifier',
start: start + 5,
end: parser.index,
name
name,
};
}
@ -123,7 +123,7 @@ export function readBindingDirective(
end: parser.index,
type: 'Binding',
name,
value
value,
};
}
@ -154,6 +154,6 @@ export function readTransitionDirective(
name,
intro: type === 'in' || type === 'transition',
outro: type === 'out' || type === 'transition',
expression
expression,
};
}

@ -16,7 +16,7 @@ export default function readExpression(parser: Parser) {
start,
end,
value: literals.get(name),
raw: name
raw: name,
};
}
@ -24,7 +24,7 @@ export default function readExpression(parser: Parser) {
type: 'Identifier',
start,
end: start + name.length,
name
name,
};
}
@ -32,7 +32,7 @@ export default function readExpression(parser: Parser) {
try {
const node = parseExpressionAt(parser.template, parser.index, {
preserveParens: true
preserveParens: true,
});
parser.index = node.end;

@ -19,7 +19,7 @@ export default function readScript(parser: Parser, start: number, attributes) {
try {
ast = parse(source, {
ecmaVersion: 8,
sourceType: 'module'
sourceType: 'module',
});
} catch (err) {
parser.acornError(err);
@ -32,6 +32,6 @@ export default function readScript(parser: Parser, start: number, attributes) {
start,
end: parser.index,
attributes,
content: ast
content: ast,
};
}

@ -12,7 +12,7 @@ export default function readStyle(parser: Parser, start: number, attributes) {
try {
ast = parse(styles, {
positions: true,
offset: contentStart
offset: contentStart,
});
} catch (err) {
if (err.name === 'CssSyntaxError') {
@ -42,7 +42,7 @@ export default function readStyle(parser: Parser, start: number, attributes) {
content: {
start: contentStart,
end: contentEnd,
styles
}
styles,
},
};
}

@ -105,9 +105,9 @@ export default function mustache(parser: Parser) {
type: 'IfBlock',
elseif: true,
expression,
children: []
}
]
children: [],
},
],
};
parser.stack.push(block.else.children[0]);
@ -126,7 +126,7 @@ export default function mustache(parser: Parser) {
start: parser.index,
end: null,
type: 'ElseBlock',
children: []
children: [],
};
parser.stack.push(block.else);
@ -151,7 +151,7 @@ export default function mustache(parser: Parser) {
end: null,
type,
expression,
children: []
children: [],
};
parser.allowWhitespace();
@ -192,7 +192,7 @@ export default function mustache(parser: Parser) {
parser.current().children.push({
start,
end: parser.index,
type: 'YieldTag'
type: 'YieldTag',
});
} else if (parser.eat('{')) {
// {{{raw}}} mustache
@ -205,7 +205,7 @@ export default function mustache(parser: Parser) {
start,
end: parser.index,
type: 'RawMustacheTag',
expression
expression,
});
} else {
const expression = readExpression(parser);
@ -217,7 +217,7 @@ export default function mustache(parser: Parser) {
start,
end: parser.index,
type: 'MustacheTag',
expression
expression,
});
}

@ -4,7 +4,7 @@ import readStyle from '../read/style';
import {
readEventHandlerDirective,
readBindingDirective,
readTransitionDirective
readTransitionDirective,
} from '../read/directives';
import { trimStart, trimEnd } from '../../utils/trim';
import { decodeCharacterReferences } from '../utils/html';
@ -17,7 +17,7 @@ const validTagName = /^\!?[a-zA-Z]{1,}:?[a-zA-Z0-9\-]*/;
const SELF = ':Self';
const metaTags = {
':Window': true
':Window': true,
};
const specials = new Map([
@ -25,16 +25,16 @@ const specials = new Map([
'script',
{
read: readScript,
property: 'js'
}
property: 'js',
},
],
[
'style',
{
read: readStyle,
property: 'css'
}
]
property: 'css',
},
],
]);
// based on http://developers.whatwg.org/syntax.html#syntax-tag-omission
@ -48,7 +48,7 @@ const disallowedContents = new Map([
'address article aside blockquote div dl fieldset footer form h1 h2 h3 h4 h5 h6 header hgroup hr main menu nav ol p pre section table ul'.split(
' '
)
)
),
],
['rt', new Set(['rt', 'rp'])],
['rp', new Set(['rt', 'rp'])],
@ -59,7 +59,7 @@ const disallowedContents = new Map([
['tfoot', new Set(['tbody'])],
['tr', new Set(['tr', 'tbody'])],
['td', new Set(['td', 'th', 'tr'])],
['th', new Set(['td', 'th', 'tr'])]
['th', new Set(['td', 'th', 'tr'])],
]);
function stripWhitespace(element) {
@ -92,7 +92,7 @@ export default function tag(parser: Parser) {
start,
end: parser.index,
type: 'Comment',
data
data,
});
return null;
@ -198,7 +198,7 @@ export default function tag(parser: Parser) {
type: 'Element',
name,
attributes,
children: []
children: [],
};
parser.current().children.push(element);
@ -291,7 +291,7 @@ function readAttribute(parser: Parser, uniqueNames) {
start,
end: parser.index,
type: 'Ref',
name: name.slice(4)
name: name.slice(4),
};
}
@ -320,7 +320,7 @@ function readAttribute(parser: Parser, uniqueNames) {
end: parser.index,
type: 'Attribute',
name,
value
value,
};
}
@ -351,9 +351,9 @@ function getShorthandValue(start: number, name: string) {
type: 'Identifier',
start,
end,
name
}
}
name,
},
},
];
}
@ -362,7 +362,7 @@ function readSequence(parser: Parser, done: () => boolean) {
start: parser.index,
end: null,
type: 'Text',
data: ''
data: '',
};
const chunks = [];
@ -397,14 +397,14 @@ function readSequence(parser: Parser, done: () => boolean) {
start: index,
end: parser.index,
type: 'MustacheTag',
expression
expression,
});
currentChunk = {
start: parser.index,
end: null,
type: 'Text',
data: ''
data: '',
};
} else {
currentChunk.data += parser.template[parser.index++];

@ -18,7 +18,7 @@ export default function text(parser: Parser) {
start,
end: parser.index,
type: 'Text',
data: decodeCharacterReferences(data)
data: decodeCharacterReferences(data),
});
return null;

@ -2030,5 +2030,5 @@ export default {
sc: 8827,
wp: 8472,
wr: 8768,
xi: 958
xi: 958,
};

@ -32,7 +32,7 @@ const windows1252 = [
339,
157,
382,
376
376,
];
const entityPattern = new RegExp(
`&(#?(?:x[\\w\\d]+|\\d+|${Object.keys(htmlEntities).join('|')}));?`,

@ -32,7 +32,7 @@ export default function annotateWithScopes(expression: Node) {
if (node._scope) {
scope = scope.parent;
}
}
},
});
return scope;
@ -99,5 +99,5 @@ const extractors = {
AssignmentPattern(names: string[], param: Node) {
extractors[param.left.type](names, param.left);
}
},
};

@ -22,5 +22,5 @@ export default new Set([
'RegExp',
'Set',
'String',
'undefined'
'undefined',
]);

@ -17,7 +17,7 @@ export const validNamespaces = [
svg,
xlink,
xml,
xmlns
xmlns,
];
export default { html, mathml, svg, xlink, xml, xmlns };

@ -2,12 +2,12 @@ import { Node } from '../interfaces';
const keys = {
ObjectExpression: 'properties',
Program: 'body'
Program: 'body',
};
const offsets = {
ObjectExpression: [1, -1],
Program: [0, 0]
Program: [0, 0],
};
export function removeNode(code, parent: Node, node: Node) {

@ -46,7 +46,7 @@ const reservedNames = new Set([
'void',
'while',
'with',
'yield'
'yield',
]);
// prevent e.g. `{{#each states as state}}` breaking

@ -11,7 +11,7 @@ const validBindings = [
'outerWidth',
'outerHeight',
'scrollX',
'scrollY'
'scrollY',
];
export default function validateWindow(validator: Validator, node: Node) {

@ -64,7 +64,7 @@ export class Validator {
loc: { line: line + 1, column },
pos,
filename: this.filename,
toString: () => `${message} (${line + 1}:${column})\n${frame}`
toString: () => `${message} (${line + 1}:${column})\n${frame}`,
});
}
}
@ -87,14 +87,14 @@ export default function validate(
onwarn({
message,
filename,
toString: () => message
toString: () => message,
});
}
const validator = new Validator(parsed, source, {
onwarn,
name,
filename
filename,
});
if (parsed.js) {

@ -5,7 +5,7 @@ import { Node } from '../../../interfaces';
const isFunctionExpression = new Set([
'FunctionExpression',
'ArrowFunctionExpression'
'ArrowFunctionExpression',
]);
export default function computed(validator: Validator, prop: Node) {

@ -57,7 +57,7 @@ export default function helpers(validator: Validator, prop: Node) {
if (/^Function/.test(node.type)) {
lexicalDepth -= 1;
}
}
},
});
if (prop.value.params.length === 0 && !usesArguments) {

@ -23,5 +23,5 @@ export default {
components,
events,
namespace,
transitions
transitions,
};

@ -26,7 +26,7 @@ export default function usesThisOrArguments(node: Node) {
) {
result = true;
}
}
},
});
return result;

@ -179,7 +179,7 @@ export default function FuzzySet(
matchScore = matches[matchIndex];
results.push([
matchScore / (vectorNormal * items[matchIndex][0]),
items[matchIndex][1]
items[matchIndex][1],
]);
}
function sortDescending(a, b) {
@ -200,7 +200,7 @@ export default function FuzzySet(
for (let i = 0; i < endIndex; ++i) {
newResults.push([
_distance(results[i][1], normalizedValue),
results[i][1]
results[i][1],
]);
}
results = newResults;

Loading…
Cancel
Save