Fixed indentation with spaces and removed unused variables

pull/5479/head
Andreas Ehrencrona 5 years ago
parent 229a16d6e7
commit 80997f4f19

@ -12,8 +12,8 @@ export function compare_node(a: Node | void, b: Node | void) {
compare_node(a.object, (b as MemberExpression).object) &&
compare_node(a.property, (b as MemberExpression).property) &&
a.computed === (b as MemberExpression).computed
);
case 'Literal':
return a.value === (b as Literal).value;
);
case 'Literal':
return a.value === (b as Literal).value;
}
}

@ -12,8 +12,8 @@ export function escape(data: string, { only_escape_at_symbol = false } = {}) {
}
const escaped = {
'"': '"',
"'": ''',
'"': '"',
"'": ''',
'&': '&',
'<': '&lt;',
'>': '&gt;'

@ -6,13 +6,13 @@ export default {
3: margin-left: 4px;
4: }
5: .not-match > * ~ * {
^
^
6: margin-left: 4px;
7: }`,
message: 'Unused CSS selector ".not-match > * ~ *"',
pos: 50,
start: { character: 50, column: 1, line: 5 },
end: { character: 68, column: 19, line: 5 }
end: { character: 68, column: 19, line: 5 }
}
]
};

@ -6,13 +6,13 @@ export default {
3: margin-left: 4px;
4: }
5: .not-match > * + * {
^
^
6: margin-left: 4px;
7: }`,
message: 'Unused CSS selector ".not-match > * + *"',
pos: 50,
start: { character: 50, column: 1, line: 5 },
end: { character: 68, column: 19, line: 5 }
end: { character: 68, column: 19, line: 5 }
}
]
};

@ -1,6 +1,6 @@
import * as assert from 'assert';
import * as fs from 'fs';
import { svelte, tryToLoadJson, shouldUpdateExpected } from '../helpers';
import { svelte, tryToLoadJson } from '../helpers';
describe('parse', () => {
fs.readdirSync(`${__dirname}/samples`).forEach(dir => {

@ -11,9 +11,8 @@ export default {
</div>
`,
test({ assert, component, target, window, raf }) {
test({ component, target }) {
const div = target.querySelector('div');
const { appendChild, insertBefore } = div;
div.appendChild = div.insertBefore = () => {
throw new Error('DOM was mutated');

@ -4,7 +4,6 @@ export default {
test({ assert, component, target }) {
container.div = null;
const top = component.top;
const div = target.querySelector('div');
component.visible = false;

@ -1,11 +1,11 @@
let subscribeCalled = false;
let unsubscribeCalled = false;
const fakeStore = val => ({
subscribe: cb => {
cb(val);
return {
unsubscribe: () => {
subscribeCalled = true;
unsubscribeCalled = true;
}
};
}
@ -22,6 +22,8 @@ export default {
async test({ assert, component, target }) {
component.foo = fakeStore(5);
return assert.htmlEqual(target.innerHTML, '<h1>5</h1>');
assert.htmlEqual(target.innerHTML, '<h1>5</h1>');
assert.ok(unsubscribeCalled);
}
};

@ -1,5 +1,6 @@
export default {
async test({ assert, component, target, window, raf }) {
async test({ assert, target, window }) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [_, btn] = target.querySelectorAll('button');
const clickEvent = new window.MouseEvent('click');

@ -1,9 +1,7 @@
let fulfil;
let reject;
const promise = new Promise((f, r) => {
const promise = new Promise((f) => {
fulfil = f;
reject = r;
});
export default {

Loading…
Cancel
Save