Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@greenwood/plugin-typescript
Advanced tools
A Greenwood plugin for writing TypeScript. For more information and complete docs on Greenwood, please visit our website.
This package assumes you already have
@greenwood/cli
installed.
You can use your favorite JavaScript package manager to install this package.
# npm
$ npm i -D @greenwood/plugin-typescript
# yarn
$ yarn add @greenwood/plugin-typescript --dev
# pnpm
$ pnpm add -D @greenwood/plugin-typescript
Add this plugin to your greenwood.config.js:
import { greenwoodPluginTypeScript } from '@greenwood/plugin-typescript';
export default {
// ...
plugins: [
greenwoodPluginTypeScript()
]
};
Now, you can write some TypeScript!
import { html, css, LitElement, customElement, property } from 'lit-element';
@customElement('app-greeting')
export class GreetingComponent extends LitElement {
static styles = css`p { color: blue }`;
@property()
name = 'Somebody';
render() {
return html`<p>Hello, ${this.name}!</p>`;
}
}
And use it in your project like you would use a .js file!
<script type="module" src="/components/greeting.ts"></script>
This plugin provides the following default compilerOptions
.
{
"compilerOptions": {
"target": "es2020",
"module": "es2020",
"moduleResolution": "node",
"sourceMap": true
}
}
If you would like to extend / override these options:
compilerOptions
{
"compilerOptions": {
"experimentalDecorators": true
}
}
greenwoodPluginTypeScript
to your greenwood.config.js, enable the extendConfig
option
import { greenwoodPluginTypeScript } from '@greenwood/plugin-typescript';
export default {
// ...
plugins: [
greenwoodPluginTypeScript({
extendConfig: true
})
]
};
This will then process your JavaScript with TypeScript with the additional configuration settings you provide. This also allows you to configure the rest of your tsconfig.json to support your project specific IDE and local development environment settings.
By default, this plugin extends TypeScript support for processing SSR pages and API routes. For this feature, you will need to enable custom imports.
If you would like to disable this feature completely, set the servePage
option to false
:
import { greenwoodPluginTypeScript } from '@greenwood/plugin-typescript';
export default {
// ...
plugins: [
greenwoodPluginTypeScript({
servePage: false
})
]
};
FAQs
A Greenwood plugin for writing TypeScript.
The npm package @greenwood/plugin-typescript receives a total of 52 weekly downloads. As such, @greenwood/plugin-typescript popularity was classified as not popular.
We found that @greenwood/plugin-typescript demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.