diff --git a/doc/reference/tags.md b/doc/reference/tags.md index f0be5bae..be6f689c 100644 --- a/doc/reference/tags.md +++ b/doc/reference/tags.md @@ -176,9 +176,9 @@ const uuid = generateUUID(); class MyComponent extends Component { static template = xml`
...
`; static style = css` - [data-o-${uuid}] { - color: red; - } - `; + [data-o-${uuid}] { + color: red; + } + `; } ``` diff --git a/src/component/component.ts b/src/component/component.ts index 01ce6511..1eec362e 100644 --- a/src/component/component.ts +++ b/src/component/component.ts @@ -767,7 +767,7 @@ export async function mount>( const { env, props, target } = params; let origEnv = C.hasOwnProperty("env") ? (C as any).env : null; if (env) { - ((C as any) as typeof Component).env = env; + (C as any as typeof Component).env = env; } const component: Component = new C(null, props); if (origEnv) { diff --git a/src/qweb/expression_parser.ts b/src/qweb/expression_parser.ts index 34f056da..039110ed 100644 --- a/src/qweb/expression_parser.ts +++ b/src/qweb/expression_parser.ts @@ -25,9 +25,10 @@ // Misc types, constants and helpers //------------------------------------------------------------------------------ -const RESERVED_WORDS = "true,false,NaN,null,undefined,debugger,console,window,in,instanceof,new,function,return,this,eval,void,Math,RegExp,Array,Object,Date".split( - "," -); +const RESERVED_WORDS = + "true,false,NaN,null,undefined,debugger,console,window,in,instanceof,new,function,return,this,eval,void,Math,RegExp,Array,Object,Date".split( + "," + ); const WORD_REPLACEMENT = Object.assign(Object.create(null), { and: "&&", diff --git a/tests/component/class_style.test.ts b/tests/component/class_style.test.ts index 4cee0814..92b1e9b4 100644 --- a/tests/component/class_style.test.ts +++ b/tests/component/class_style.test.ts @@ -265,7 +265,8 @@ describe("class and style attributes with t-component", () => { error = e; } expect(error).toBeDefined(); - const regexp = /Cannot read properties of undefined \(reading 'crash'\)|Cannot read property 'crash' of undefined/g; + const regexp = + /Cannot read properties of undefined \(reading 'crash'\)|Cannot read property 'crash' of undefined/g; expect(error.message).toMatch(regexp); expect(fixture.innerHTML).toBe(""); }); diff --git a/tests/component/error_handling.test.ts b/tests/component/error_handling.test.ts index 378c11fc..dacc5c37 100644 --- a/tests/component/error_handling.test.ts +++ b/tests/component/error_handling.test.ts @@ -361,7 +361,8 @@ describe("component error handling (catchError)", () => { error = e; } expect(error).toBeDefined(); - const regexp = /Cannot read properties of undefined \(reading 'crash'\)|Cannot read property 'crash' of undefined/g; + const regexp = + /Cannot read properties of undefined \(reading 'crash'\)|Cannot read property 'crash' of undefined/g; expect(error.message).toMatch(regexp); expect(console.error).toBeCalledTimes(0); @@ -472,7 +473,8 @@ describe("component error handling (catchError)", () => { error = e; } expect(error).toBeDefined(); - const regexp = /Cannot read properties of undefined \(reading 'crash'\)|Cannot read property 'crash' of undefined/g; + const regexp = + /Cannot read properties of undefined \(reading 'crash'\)|Cannot read property 'crash' of undefined/g; expect(error.message).toMatch(regexp); expect(console.error).toBeCalledTimes(0); @@ -499,7 +501,8 @@ describe("component error handling (catchError)", () => { error = e; } expect(error).toBeDefined(); - const regexp = /Cannot read properties of undefined \(reading 'crash'\)|Cannot read property 'crash' of undefined/g; + const regexp = + /Cannot read properties of undefined \(reading 'crash'\)|Cannot read property 'crash' of undefined/g; expect(error.message).toMatch(regexp); expect(console.error).toBeCalledTimes(0); @@ -523,7 +526,8 @@ describe("component error handling (catchError)", () => { error = e; } expect(error).toBeDefined(); - const regexp = /Cannot read properties of undefined \(reading 'y'\)|Cannot read property 'y' of undefined/g; + const regexp = + /Cannot read properties of undefined \(reading 'y'\)|Cannot read property 'y' of undefined/g; expect(error.message).toMatch(regexp); }); diff --git a/tests/misc/portal.test.ts b/tests/misc/portal.test.ts index 9cef2762..da2a6900 100644 --- a/tests/misc/portal.test.ts +++ b/tests/misc/portal.test.ts @@ -546,7 +546,8 @@ describe("Portal: Basic use and DOM placement", () => { error = e; } expect(error).toBeDefined(); - const regexp = /Cannot read properties of undefined \(reading 'crash'\)|Cannot read property 'crash' of undefined/g; + const regexp = + /Cannot read properties of undefined \(reading 'crash'\)|Cannot read property 'crash' of undefined/g; expect(error.message).toMatch(regexp); });