Shipping .ts files in the published package causes errors
pegiadise opened this issue · 0 comments
pegiadise commented
Unfortunately, shipping .ts
files in your npm package causes errors that cannot be bypassed in vue-tsc
and is generally not recommended. Is there a reason to ship .ts
files on top of the js distributables and not prebuilt js with declaration files?
Example errors in snippet below:
../../node_modules/vue-waypoint/src/components/Waypoint/component.ts:63:58 - error TS2345: Argument of type '{ readonly attributes: { [x: number]: { readonly localName: string; readonly name: string; readonly namespaceURI: string | null; readonly ownerDocument: { readonly URL: string; alinkColor: string; readonly all: { [x: number]: ...; readonly length: number; item: (nameOrIndex?: string | undefined) => Element | ... 1 m...' is not assignable to parameter of type 'Element'.
Types of property 'attributes' are incompatible.
Type '{ [x: number]: { readonly localName: string; readonly name: string; readonly namespaceURI: string | null; readonly ownerDocument: { readonly URL: string; alinkColor: string; readonly all: { [x: number]: { readonly attributes: ...; ... 165 more ...; readonly assignedSlot: { ...; } | null; }; readonly length: number; ...' is not assignable to type 'NamedNodeMap'.
'number' index signatures are incompatible.
Type '{ readonly localName: string; readonly name: string; readonly namespaceURI: string | null; readonly ownerDocument: { readonly URL: string; alinkColor: string; readonly all: { [x: number]: { readonly attributes: { [x: number]: ...; ... 8 more ...; [Symbol.iterator]: () => IterableIterator<...>; }; ... 165 more ...; r...' is not assignable to type 'Attr'.
The types of 'ownerDocument.anchors' are incompatible between these types.
Type '{ [x: number]: { charset: string; coords: string; download: string; hreflang: string; name: string; ping: string; referrerPolicy: string; rel: string; readonly relList: { [x: number]: string; readonly length: number; ... 13 more ...; [Symbol.iterator]: () => IterableIterator<...>; }; ... 308 more ...; username: stri...' is not assignable to type 'HTMLCollectionOf<HTMLAnchorElement>'.
'number' index signatures are incompatible.
Type '{ charset: string; coords: string; download: string; hreflang: string; name: string; ping: string; referrerPolicy: string; rel: string; readonly relList: { [x: number]: string; readonly length: number; value: string; ... 12 more ...; [Symbol.iterator]: () => IterableIterator<...>; }; ... 308 more ...; username: stri...' is not assignable to type 'HTMLAnchorElement'.
Types of property 'shadowRoot' are incompatible.
Type '{ readonly delegatesFocus: boolean; readonly host: { readonly attributes: { [x: number]: { readonly localName: string; readonly name: string; readonly namespaceURI: string | null; readonly ownerDocument: { readonly URL: string; ... 256 more ...; evaluate: (expression: string, contextNode: Node, resolver?: XPathNSRes...' is not assignable to type 'ShadowRoot | null'.
Type '{ readonly delegatesFocus: boolean; readonly host: { readonly attributes: { [x: number]: { readonly localName: string; readonly name: string; readonly namespaceURI: string | null; readonly ownerDocument: { readonly URL: string; ... 256 more ...; evaluate: (expression: string, contextNode: Node, resolver?: XPathNSRes...' is not assignable to type 'ShadowRoot'.
Types of property 'childNodes' are incompatible.
Type '{ [x: number]: { after: (...nodes: (string | Node)[]) => void; before: (...nodes: (string | Node)[]) => void; remove: () => void; replaceWith: (...nodes: (string | Node)[]) => void; readonly baseURI: string; ... 48 more ...; removeEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, opt...' is not assignable to type 'NodeListOf<ChildNode>'.
'number' index signatures are incompatible.
Type '{ after: (...nodes: (string | Node)[]) => void; before: (...nodes: (string | Node)[]) => void; remove: () => void; replaceWith: (...nodes: (string | Node)[]) => void; readonly baseURI: string; ... 48 more ...; removeEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean ...' is not assignable to type 'ChildNode'.
Types of property 'parentElement' are incompatible.
Type '{ accessKey: string; readonly accessKeyLabel: string; autocapitalize: string; dir: string; draggable: boolean; hidden: boolean; inert: boolean; innerText: string; lang: string; readonly offsetHeight: number; ... 281 more ...; focus: (options?: FocusOptions | undefined) => void; } | null' is not assignable to type 'HTMLElement | null'.
Type '{ accessKey: string; readonly accessKeyLabel: string; autocapitalize: string; dir: string; draggable: boolean; hidden: boolean; inert: boolean; innerText: string; lang: string; readonly offsetHeight: number; ... 281 more ...; focus: (options?: FocusOptions | undefined) => void; }' is not assignable to type 'HTMLElement'.
Types of property 'assignedSlot' are incompatible.
Type '{ name: string; assign: (...nodes: (Element | Text)[]) => void; assignedElements: (options?: AssignedNodesOptions | undefined) => Element[]; ... 292 more ...; focus: (options?: FocusOptions | undefined) => void; } | null' is not assignable to type 'HTMLSlotElement | null'.
Type '{ name: string; assign: (...nodes: (Element | Text)[]) => void; assignedElements: (options?: AssignedNodesOptions | undefined) => Element[]; ... 292 more ...; focus: (options?: FocusOptions | undefined) => void; }' is not assignable to type 'HTMLSlotElement'.
The types of 'style.parentRule' are incompatible between these types.
Type '{ cssText: string; readonly parentRule: ... | null; readonly parentStyleSheet: { readonly cssRules: { [x: number]: ...; readonly length: number; item: (index: number) => CSSRule | null; [Symbol.iterator]: () => IterableIterator<...>; }; ... 14 more ...; readonly type: string; } | null; ... 10 more ...; readonly SUPP...' is not assignable to type 'CSSRule | null'.
Type '{ cssText: string; readonly parentRule: ... | null; readonly parentStyleSheet: { readonly cssRules: { [x: number]: ...; readonly length: number; item: (index: number) => CSSRule | null; [Symbol.iterator]: () => IterableIterator<...>; }; ... 14 more ...; readonly type: string; } | null; ... 10 more ...; readonly SUPP...' is not assignable to type 'CSSRule'.
Types of property 'parentStyleSheet' are incompatible.
Type '{ readonly cssRules: { [x: number]: { cssText: string; readonly parentRule: ... | null; readonly parentStyleSheet: ... | null; readonly type: number; readonly STYLE_RULE: 1; readonly CHARSET_RULE: 2; ... 7 more ...; readonly SUPPORTS_RULE: 12; }; readonly length: number; item: (index: number) => CSSRule | null; [Sym...' is not assignable to type 'CSSStyleSheet | null'.
Type '{ readonly cssRules: { [x: number]: { cssText: string; readonly parentRule: ... | null; readonly parentStyleSheet: ... | null; readonly type: number; readonly STYLE_RULE: 1; readonly CHARSET_RULE: 2; ... 7 more ...; readonly SUPPORTS_RULE: 12; }; readonly length: number; item: (index: number) => CSSRule | null; [Sym...' is not assignable to type 'CSSStyleSheet'.
Types of property 'ownerNode' are incompatible.
Type '{ readonly attributes: { [x: number]: { readonly localName: string; readonly name: string; readonly namespaceURI: string | null; readonly ownerDocument: { readonly URL: string; alinkColor: string; readonly all: { [x: number]: ...; readonly length: number; item: (nameOrIndex?: string | undefined) => Element | ... 1 m...' is not assignable to type 'Element | ProcessingInstruction | null'.
Type '{ readonly attributes: { [x: number]: { readonly localName: string; readonly name: string; readonly namespaceURI: string | null; readonly ownerDocument: { readonly URL: string; alinkColor: string; readonly all: { [x: number]: ...; readonly length: number; item: (nameOrIndex?: string | undefined) => Element | ... 1 m...' is not assignable to type 'Element | ProcessingInstruction | null'.
63 if (activable.value) return observer.value.observe(element.value);
~~~~~~~~~~~~~~
../../node_modules/vue-waypoint/src/components/Waypoint/component.ts:64:44 - error TS2345: Argument of type '{ readonly attributes: { [x: number]: { readonly localName: string; readonly name: string; readonly namespaceURI: string | null; readonly ownerDocument: { readonly URL: string; alinkColor: string; readonly all: { [x: number]: ...; readonly length: number; item: (nameOrIndex?: string | undefined) => Element | ... 1 m...' is not assignable to parameter of type 'Element'.
64 else return observer.value.unobserve(element.value);
~~~~~~~~~~~~~~
Found 2 errors in the same file, starting at: ../../node_modules/vue-waypoint/src/components/Waypoint/component.ts:63