diff --git a/.eslintrc.js b/.eslintrc.js
index a093de610b..217b7f968d 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -10,5 +10,9 @@ module.exports = {
'estree'
],
'svelte3/compiler': require('./compiler')
+ },
+ // workaround for https://github.com/typescript-eslint/typescript-eslint/issues/1824 and rely solely on 'indent' rule
+ rules: {
+ "@typescript-eslint/indent": "off"
}
};
diff --git a/src/compiler/compile/Component.ts b/src/compiler/compile/Component.ts
index a5a31c8070..fee0f3045a 100644
--- a/src/compiler/compile/Component.ts
+++ b/src/compiler/compile/Component.ts
@@ -8,7 +8,7 @@ import {
create_scopes,
extract_names,
Scope,
- extract_identifiers,
+ extract_identifiers
} from './utils/scope';
import Stylesheet from './css/Stylesheet';
import { test } from '../config';
@@ -155,7 +155,7 @@ export default class Component {
) || { start: 0, end: 0 };
this.warn(svelteOptions, {
code: 'custom-element-no-tag',
- message: `No custom element 'tag' option was specified. To automatically register a custom element, specify a name with a hyphen in it, e.g. . To hide this warning, use `,
+ message: `No custom element 'tag' option was specified. To automatically register a custom element, specify a name with a hyphen in it, e.g. . To hide this warning, use `
});
}
this.tag = this.component_options.tag || compile_options.tag;
@@ -190,7 +190,7 @@ export default class Component {
this.add_var({
name,
injected: true,
- referenced: true,
+ referenced: true
});
} else if (name[0] === '$') {
this.add_var({
@@ -198,7 +198,7 @@ export default class Component {
injected: true,
referenced: true,
mutated: true,
- writable: true,
+ writable: true
});
const subscribable_name = name.slice(1);
@@ -289,7 +289,7 @@ export default class Component {
}
const imported_helpers = Array.from(this.helpers, ([name, alias]) => ({
name,
- alias,
+ alias
}));
create_module(
@@ -305,7 +305,7 @@ export default class Component {
.filter(variable => variable.module && variable.export_name)
.map(variable => ({
name: variable.name,
- as: variable.export_name,
+ as: variable.export_name
}))
);
@@ -342,9 +342,9 @@ export default class Component {
reassigned: v.reassigned || false,
referenced: v.referenced || false,
writable: v.writable || false,
- referenced_from_script: v.referenced_from_script || false,
+ referenced_from_script: v.referenced_from_script || false
})),
- stats: this.stats.render(),
+ stats: this.stats.render()
};
}
@@ -409,7 +409,7 @@ export default class Component {
source: this.source,
start: pos.start,
end: pos.end,
- filename: this.compile_options.filename,
+ filename: this.compile_options.filename
});
}
@@ -441,7 +441,7 @@ export default class Component {
pos: pos.start,
filename: this.compile_options.filename,
toString: () =>
- `${warning.message} (${start.line}:${start.column})\n${frame}`,
+ `${warning.message} (${start.line}:${start.column})\n${frame}`
});
}
@@ -453,7 +453,7 @@ export default class Component {
if (node.type === 'ExportDefaultDeclaration') {
this.error(node, {
code: `default-export`,
- message: `A component cannot have a default export`,
+ message: `A component cannot have a default export`
});
}
@@ -461,7 +461,7 @@ export default class Component {
if (node.source) {
this.error(node, {
code: `not-implemented`,
- message: `A component currently cannot have an export ... from`,
+ message: `A component currently cannot have an export ... from`
});
}
if (node.declaration) {
@@ -531,10 +531,10 @@ export default class Component {
if (node.type === 'LabeledStatement' && node.label.name === '$') {
component.warn(node as any, {
code: 'module-script-reactive-declaration',
- message: '$: has no effect in a module script',
+ message: '$: has no effect in a module script'
});
}
- },
+ }
});
const { scope, globals } = create_scopes(script.content);
@@ -544,7 +544,7 @@ export default class Component {
if (name[0] === '$') {
this.error(node as any, {
code: 'illegal-declaration',
- message: `The $ prefix is reserved, and cannot be used for variable and import names`,
+ message: `The $ prefix is reserved, and cannot be used for variable and import names`
});
}
@@ -562,7 +562,7 @@ export default class Component {
if (name[0] === '$') {
this.error(node as any, {
code: 'illegal-subscription',
- message: `Cannot reference store value inside