Move Stylesheet arguments into an object

pull/4377/head
Christian Kaisermann 7 years ago
parent 2f55fc4fe7
commit a038f72fb3

@ -136,12 +136,10 @@ export default class Component {
this.stylesheet = new Stylesheet({
source,
ast,
options: {
filename: compile_options.filename,
component_name: name,
dev: compile_options.dev,
scope_class_getter: compile_options.scopeClass
}
});
this.stylesheet.validate(this);

@ -296,21 +296,17 @@ export default class Stylesheet {
constructor({
source,
ast,
options: {
component_name,
filename,
dev,
scope_class_getter = getDefaultScopeClass,
},
}: {
source: string;
ast: Ast;
options: {
filename: string | undefined;
component_name: string | undefined;
dev: boolean;
scope_class_getter: CssScopeClassGetter;
};
}) {
this.source = source;
this.ast = ast;

@ -105,7 +105,7 @@ export interface Warning {
export type ModuleFormat = 'esm' | 'cjs';
export type CssScopeClassGetter = (args: {
name: string | undefined;
name: string;
filename: string | undefined;
hash: string;
}) => string;

Loading…
Cancel
Save