Skip to content

Commit

Permalink
SvelthreeInteraction fix ESLint no-empty (#166)
Browse files Browse the repository at this point in the history
quick'n'dirty (for now) see #167
  • Loading branch information
Vatroslav Vrbanic committed Sep 12, 2022
1 parent 43576b0 commit ff8de66
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/components/AmbientLight.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ AmbientLight cannot be used to cast shadows as it doesn't have a direction. Posi
/** Executed when / if an instance was provided **on initializiation** -> only once if at all! */
function on_instance_provided(): void {
if (light.type === "AmbientLight") {
//nothing
} else {
throw new Error(
`SVELTHREE > ${c_name} provided 'light' instance has wrong type '${light.type}', should be '${c_name}'!`
Expand Down
1 change: 1 addition & 0 deletions src/lib/components/DirectionalLight.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ svelthree uses svelte-accmod, where accessors are always `true`, regardless of `
/** Executed when / if an instance was provided **on initializiation** -> only once if at all! */
function on_instance_provided(): void {
if (light.type === "DirectionalLight") {
//nothing
} else {
throw new Error(
`SVELTHREE > ${c_name} provided 'light' instance has wrong type '${light.type}', should be '${c_name}'!`
Expand Down
1 change: 1 addition & 0 deletions src/lib/components/Group.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ svelthree uses svelte-accmod, where accessors are always `true`, regardless of `
/** Executed when / if an instance was provided **on initializiation** -> only once if at all! */
function on_instance_provided(): void {
if (group.type === "Group") {
//nothing
} else {
throw new Error(
`SVELTHREE > ${c_name} provided 'group' instance has wrong type '${group.type}', should be '${c_name}'!`
Expand Down
1 change: 1 addition & 0 deletions src/lib/components/HemisphereLight.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ svelthree uses svelte-accmod, where accessors are always `true`, regardless of `
/** Executed when / if an instance was provided **on initializiation** -> only once if at all! */
function on_instance_provided(): void {
if (light.type === "HemisphereLight") {
//nothing
} else {
throw new Error(
`SVELTHREE > ${c_name} provided 'light' instance has wrong type '${light.type}', should be '${c_name}'!`
Expand Down
1 change: 1 addition & 0 deletions src/lib/components/Object3D.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ svelthree uses svelte-accmod, where accessors are always `true`, regardless of `
/** Executed when / if an instance was provided **on initializiation** -> only once if at all! */
function on_instance_provided(): void {
if (object3d.type === "Object3D") {
//nothing
} else {
throw new Error(
`SVELTHREE > ${c_name} provided 'object3d' instance has wrong type '${object3d.type}', should be '${c_name}'!`
Expand Down
1 change: 1 addition & 0 deletions src/lib/components/PointLight.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ svelthree uses svelte-accmod, where accessors are always `true`, regardless of `
/** Executed when / if an instance was provided **on initializiation** -> only once if at all! */
function on_instance_provided(): void {
if (light.type === "PointLight") {
//nothing
} else {
throw new Error(
`SVELTHREE > ${c_name} provided 'light' instance has wrong type '${light.type}', should be '${c_name}'!`
Expand Down
1 change: 1 addition & 0 deletions src/lib/components/Points.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ svelthree uses svelte-accmod, where accessors are always `true`, regardless of `
/** Executed when / if an instance was provided **on initializiation** -> only once if at all! */
function on_instance_provided(): void {
if (points.type === "Points") {
//nothing
} else {
throw new Error(
`SVELTHREE > ${c_name} provided 'points' instance has wrong type '${points.type}', should be '${c_name}'!`
Expand Down
1 change: 1 addition & 0 deletions src/lib/components/RectAreaLight.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ svelthree uses svelte-accmod, where accessors are always `true`, regardless of `
/** Executed when / if an instance was provided **on initializiation** -> only once if at all! */
function on_instance_provided(): void {
if (light.type === "RectAreaLight") {
//nothing
} else {
throw new Error(
`SVELTHREE > ${c_name} provided 'light' instance has wrong type '${light.type}', should be '${c_name}'!`
Expand Down
1 change: 1 addition & 0 deletions src/lib/components/Scene.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ svelthree uses svelte-accmod, where accessors are always `true`, regardless of `
/** Executed when / if an instance was provided **on initializiation** -> only once if at all! */
function on_instance_provided(): void {
if (scene.type === "Scene") {
//nothing
} else {
throw new Error(
`SVELTHREE > ${c_name} provided 'scene' instance has wrong type '${scene.type}', should be '${c_name}'!`
Expand Down
1 change: 1 addition & 0 deletions src/lib/components/SpotLight.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ svelthree uses svelte-accmod, where accessors are always `true`, regardless of `
/** Executed when / if an instance was provided **on initializiation** -> only once if at all! */
function on_instance_provided(): void {
if (light.type === "SpotLight") {
//nothing
} else {
throw new Error(
`SVELTHREE > ${c_name} provided 'light' instance has wrong type '${light.type}', should be '${c_name}'!`
Expand Down

0 comments on commit ff8de66

Please sign in to comment.