pull/3945/head
Rich Harris 6 years ago
parent 32421f6601
commit d475162f05

@ -35,12 +35,7 @@ module.exports = {
argsIgnorePattern: '^_'
}
],
'@typescript-eslint/no-object-literal-type-assertion': [
'error',
{
allowAsParameter: true
}
],
'@typescript-eslint/no-object-literal-type-assertion': 'off',
'@typescript-eslint/no-unused-vars': 'off'
},
globals: {

@ -30,7 +30,7 @@
"coverage": "c8 report --reporter=text-lcov > coverage.lcov && c8 report --reporter=html",
"codecov": "codecov",
"precodecov": "npm run coverage",
"build": "rollup -c",
"build": "rollup -c && npm run tsd",
"prepare": "npm run build",
"dev": "rollup -cw",
"pretest": "npm run build",

@ -9,7 +9,7 @@ import TemplateScope from './TemplateScope';
import get_object from '../../utils/get_object';
import Block from '../../render_dom/Block';
import is_dynamic from '../../render_dom/wrappers/shared/is_dynamic';
import { x, b } from 'code-red';
import { b } from 'code-red';
import { invalidate } from '../../render_dom/invalidate';
import { Node, FunctionExpression, Identifier } from 'estree';
import { TemplateNode } from '../../../interfaces';

@ -6,14 +6,14 @@ import { x } from 'code-red';
import { Node, Identifier, MemberExpression, Literal } from 'estree';
import flatten_reference from '../utils/flatten_reference';
type ContextMember = {
interface ContextMember {
name: string;
index: Literal;
is_contextual: boolean;
is_non_contextual: boolean;
variable: Var;
priority: number;
};
}
export default class Renderer {
component: Component; // TODO Maybe Renderer shouldn't know about Component?

@ -205,7 +205,7 @@ export default class EachBlockWrapper extends Wrapper {
block.chunks.init.push(b`let ${this.vars.each_block_value} = ${snippet};`);
// TODO which is better — Object.create(array) or array.slice()?
// TODO which is better — Object.create(array) or array.slice()?
renderer.blocks.push(b`
function ${this.vars.get_each_context}(#ctx, list, i) {
const child_ctx = #ctx.slice();

@ -20,7 +20,7 @@ import { extract_names } from 'periscopic';
export default class InlineComponentWrapper extends Wrapper {
var: Identifier;
slots: Map<string, { block: Block; scope: TemplateScope; get_context?: Node, get_changes?: Node }> = new Map();
slots: Map<string, { block: Block; scope: TemplateScope; get_context?: Node; get_changes?: Node }> = new Map();
node: InlineComponent;
fragment: FragmentWrapper;

@ -35,7 +35,7 @@ export function get_slot_definition(block: Block, scope: TemplateScope, lets: Le
const literal = {
type: 'Literal',
get value() {
const i = context_lookup.get(name).index.value;
const i = context_lookup.get(name).index.value as number;
return 1 << i;
}
};

@ -1,6 +1,6 @@
import { add_render_callback, flush, schedule_update, dirty_components } from './scheduler';
import { current_component, set_current_component } from './lifecycle';
import { blank_object, is_function, run, run_all, noop, has_prop } from './utils';
import { blank_object, is_function, run, run_all, noop } from './utils';
import { children } from './dom';
import { transition_in } from './transitions';

Loading…
Cancel
Save