Skip to content

Commit

Permalink
fix: 📌 Remove unused code in Minimum Example sample code (#221)
Browse files Browse the repository at this point in the history
* fix: 📌 Removed unused variable `parent` in sample code in Minimum Example

There is an unused variable `parent` in the sample code `packages/compiler-core/parse.ts` in the Minimum Example,
The following type check error occurs, so I removed it from the sample code and the documentation.

``sh
... /... /packages/compiler-core/parse.ts:201:9 - error TS6133: 'parent' is declared but its value is never read.

201 const parent = last(ancestors)
            ~~~~~~
```

* fix: 📌 Removed unused `Data` in sample code in Minimum Example

There is an unused `Data` in the sample code `packages/runtime-core/componentOptions.ts` in the Minimum Example,
The following type check error occurs, so I removed it from the sample code.

```sh
../../packages/runtime-core/componentOptions.ts:1:1 - error TS6133: 'Data' is declared but its value is never read.

1 import { Data } from './component'
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
  • Loading branch information
madogiwa0124 authored Jan 5, 2024
1 parent 95b568a commit 9df461d
Show file tree
Hide file tree
Showing 13 changed files with 0 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ function parseElement(
ancestors: ElementNode[],
): ElementNode | undefined {
// Start tag.
const parent = last(ancestors)
const element = parseTag(context, TagType.Start) // TODO:

if (element.isSelfClosing) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ function parseElement(
ancestors: ElementNode[],
): ElementNode | undefined {
// Start tag.
const parent = last(ancestors)
const element = parseTag(context, TagType.Start) // TODO:

if (element.isSelfClosing) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Data } from './component'

export type ComponentOptions = {
props?: Record<string, any>
setup?: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ function parseElement(
ancestors: ElementNode[],
): ElementNode | undefined {
// Start tag.
const parent = last(ancestors)
const element = parseTag(context, TagType.Start) // TODO:

if (element.isSelfClosing) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Data } from './component'

export type ComponentOptions = {
props?: Record<string, any>
setup?: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ function parseElement(
ancestors: ElementNode[],
): ElementNode | undefined {
// Start tag.
const parent = last(ancestors)
const element = parseTag(context, TagType.Start) // TODO:

if (element.isSelfClosing) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Data } from './component'

export type ComponentOptions = {
props?: Record<string, any>
setup?: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ function parseElement(
ancestors: ElementNode[],
): ElementNode | undefined {
// Start tag.
const parent = last(ancestors)
const element = parseTag(context, TagType.Start) // TODO:

if (element.isSelfClosing) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Data } from './component'

export type ComponentOptions = {
props?: Record<string, any>
setup?: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ function parseElement(
ancestors: ElementNode[],
): ElementNode | undefined {
// Start tag.
const parent = last(ancestors)
const element = parseTag(context, TagType.Start) // TODO:

if (element.isSelfClosing) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Data } from './component'

export type ComponentOptions = {
props?: Record<string, any>
setup?: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ function parseElement(
ancestors: ElementNode[]
): ElementNode | undefined {
// Start tag.
const parent = last(ancestors);
const element = parseTag(context, TagType.Start); // TODO:

// <img /> のような self closing の要素の場合にはここで終了です。( children も end タグもないので)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ function parseElement(
ancestors: ElementNode[]
): ElementNode | undefined {
// Start tag.
const parent = last(ancestors);
const element = parseTag(context, TagType.Start); // TODO:

// If it is a self-closing element like <img />, we end here (since there are no children or end tag).
Expand Down

0 comments on commit 9df461d

Please sign in to comment.