From 089149564799fd4f22799128315bc91208dda84f Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Sun, 26 May 2019 14:04:29 +0200 Subject: [PATCH] code style --- src/compile/render-dom/index.ts | 12 ++++++------ test/js/samples/bind-open/expected.js | 2 +- test/js/samples/debug-empty/expected.js | 6 +++--- test/js/samples/debug-foo-bar-baz-things/expected.js | 6 +++--- test/js/samples/debug-foo/expected.js | 6 +++--- .../dev-warning-missing-data-computed/expected.js | 6 +++--- .../samples/dev-warning-unknown-props/_config.js | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/compile/render-dom/index.ts b/src/compile/render-dom/index.ts index e7f063d08698..1432813e9d9d 100644 --- a/src/compile/render-dom/index.ts +++ b/src/compile/render-dom/index.ts @@ -394,12 +394,12 @@ export default function dom( return $name; }); - let unknownPropsCheck; + let unknown_props_check; if (component.compile_options.dev && writable_props.length) { - unknownPropsCheck = deindent` - const writableProps = [${writable_props.map(prop => `'${prop.export_name}'`).join(', ')}]; + unknown_props_check = deindent` + const writable_props = [${writable_props.map(prop => `'${prop.export_name}'`).join(', ')}]; Object.keys($$props).forEach(key => { - if (!writableProps.includes(key)) console.warn(\`<${component.tag}> was created with unknown attribute '\${key}'\`); + if (!writable_props.includes(key)) console.warn(\`<${component.tag}> was created with unknown prop '\${key}'\`); }); `; } @@ -413,8 +413,8 @@ export default function dom( ${resubscribable_reactive_store_unsubscribers} ${component.javascript} - - ${unknownPropsCheck} + + ${unknown_props_check} ${component.slots.size && `let { $$slots = {}, $$scope } = $$props;`} diff --git a/test/js/samples/bind-open/expected.js b/test/js/samples/bind-open/expected.js index 7c73c8ddac3c..7f739aec8b72 100644 --- a/test/js/samples/bind-open/expected.js +++ b/test/js/samples/bind-open/expected.js @@ -66,4 +66,4 @@ class Component extends SvelteComponent { } } -export default Component; +export default Component; \ No newline at end of file diff --git a/test/js/samples/debug-empty/expected.js b/test/js/samples/debug-empty/expected.js index 9b6ef447b499..c82cbeddd3d0 100644 --- a/test/js/samples/debug-empty/expected.js +++ b/test/js/samples/debug-empty/expected.js @@ -65,9 +65,9 @@ function create_fragment(ctx) { function instance($$self, $$props, $$invalidate) { let { name } = $$props; - const writableProps = ['name']; + const writable_props = ['name']; Object.keys($$props).forEach(key => { - if (!writableProps.includes(key)) console.warn(` was created with unknown attribute '${key}'`); + if (!writable_props.includes(key)) console.warn(` was created with unknown prop '${key}'`); }); $$self.$set = $$props => { @@ -98,4 +98,4 @@ class Component extends SvelteComponentDev { } } -export default Component; +export default Component; \ No newline at end of file diff --git a/test/js/samples/debug-foo-bar-baz-things/expected.js b/test/js/samples/debug-foo-bar-baz-things/expected.js index 006b25aba538..3e1571b8905e 100644 --- a/test/js/samples/debug-foo-bar-baz-things/expected.js +++ b/test/js/samples/debug-foo-bar-baz-things/expected.js @@ -151,9 +151,9 @@ function create_fragment(ctx) { function instance($$self, $$props, $$invalidate) { let { things, foo, bar, baz } = $$props; - const writableProps = ['things', 'foo', 'bar', 'baz']; + const writable_props = ['things', 'foo', 'bar', 'baz']; Object.keys($$props).forEach(key => { - if (!writableProps.includes(key)) console.warn(` was created with unknown attribute '${key}'`); + if (!writable_props.includes(key)) console.warn(` was created with unknown prop '${key}'`); }); $$self.$set = $$props => { @@ -220,4 +220,4 @@ class Component extends SvelteComponentDev { } } -export default Component; +export default Component; \ No newline at end of file diff --git a/test/js/samples/debug-foo/expected.js b/test/js/samples/debug-foo/expected.js index 7bc58434a8fb..1af0fcaebee8 100644 --- a/test/js/samples/debug-foo/expected.js +++ b/test/js/samples/debug-foo/expected.js @@ -151,9 +151,9 @@ function create_fragment(ctx) { function instance($$self, $$props, $$invalidate) { let { things, foo } = $$props; - const writableProps = ['things', 'foo']; + const writable_props = ['things', 'foo']; Object.keys($$props).forEach(key => { - if (!writableProps.includes(key)) console.warn(` was created with unknown attribute '${key}'`); + if (!writable_props.includes(key)) console.warn(` was created with unknown prop '${key}'`); }); $$self.$set = $$props => { @@ -196,4 +196,4 @@ class Component extends SvelteComponentDev { } } -export default Component; +export default Component; \ No newline at end of file diff --git a/test/js/samples/dev-warning-missing-data-computed/expected.js b/test/js/samples/dev-warning-missing-data-computed/expected.js index e181486512e1..0c193934c059 100644 --- a/test/js/samples/dev-warning-missing-data-computed/expected.js +++ b/test/js/samples/dev-warning-missing-data-computed/expected.js @@ -65,9 +65,9 @@ function instance($$self, $$props, $$invalidate) { let bar; - const writableProps = ['foo']; + const writable_props = ['foo']; Object.keys($$props).forEach(key => { - if (!writableProps.includes(key)) console.warn(` was created with unknown attribute '${key}'`); + if (!writable_props.includes(key)) console.warn(` was created with unknown prop '${key}'`); }); $$self.$set = $$props => { @@ -102,4 +102,4 @@ class Component extends SvelteComponentDev { } } -export default Component; +export default Component; \ No newline at end of file diff --git a/test/runtime/samples/dev-warning-unknown-props/_config.js b/test/runtime/samples/dev-warning-unknown-props/_config.js index 31b605e214c0..9bff4a2a741b 100644 --- a/test/runtime/samples/dev-warning-unknown-props/_config.js +++ b/test/runtime/samples/dev-warning-unknown-props/_config.js @@ -4,6 +4,6 @@ export default { }, warnings: [ - ` was created with unknown attribute 'fo'` + ` was created with unknown prop 'fo'` ] };