groupme-js / node-groupme

The only GroupMe API library for NodeJS that isn't a million years old.
https://groupme.js.org
MIT License
27 stars 11 forks source link

[chore: code quality] strict type imports #60

Closed not-so-smart closed 2 years ago

not-so-smart commented 2 years ago

All imports not used as values should be labeled as type-only imports.

Example: https://github.com/not-so-smart/node-groupme/blob/be8988e4264b8a580771d5f37e521fcf29a09563/src/structures/Message.ts#L1 This line should become:

import type { Channel, User } from "..";

so as to distinguish it from "real" imports which are passed through to the compiled JS.

This PR correctly labels all instances of type-only imports as such, and adds the following line to tsconfig.json to enforce this rule:

"importsNotUsedAsValues": "error",