Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
@cprussin/tsconfig
Advanced tools
@cprussin/tsconfig v3.0.1 • Docs
This package contains a set of strict shared typescript configs.
Use the package manager of your choice to install:
npm install --save-dev @cprussin/tsconfig
pnpm add -D @cprussin/tsconfig
yarn add -D @cprussin/tsconfig
Add the config you want to extend to your tsconfig.json
, for example:
{
"extends": "@cprussin/tsconfig/base.json"
}
Note that "noEmit": true
is set by configs here. The intention is that most
of the case, you're type checking with typescript and distributed
untranspiled files, or that if you're transpiling then the transpilation
tools you're using will override that setting in their own configs as
needed. For instance, if you're using webpack
, you could configure
ts-loader
like this:
{
loader: "ts-loader",
options: {
compilerOptions: {
sourceMap: process.env.NODE_ENV === "development",
noEmit: false,
},
},
}
Or you could have a build
script in your package.json
that runs tsc
directly:
{
"name": "foo",
"scripts": {
"build": "tsc --noEmit false --outDir ./dist"
}
}
base.json
// tsconfig.json
{
"extends": "@cprussin/tsconfig/base.json"
}
The base configuration that everything else extends from. Sets a bunch of
strict options such as "strict": true
, "allowJs": false
,
"noFallthroughCasesInSwitch": true
, "noImplicitReturns": true
, etc. If
you want to be as strict as I do and you aren't incrementally adding
typescript to a legacy project, you probably don't want to override most of
these options, but it might make sense to override the target
or lib
options.
Note that no options are set for JSX or for DOM libraries. If you need any of
that, you'll want to use one of the configs that extends base.json
instead
of using base.json
directly.
dom.json
// tsconfig.json
{
"extends": "@cprussin/tsconfig/dom.json"
}
Very simply extends the base.json
config by adding the
dom
and dom.iterable
libs.
react.json
// tsconfig.json
{
"extends": "@cprussin/tsconfig/react.json"
}
Adds the "jsx": "preserve"
option to the dom.json
config.
nextjs.json
// tsconfig.json
{
"extends": "@cprussin/tsconfig/nextjs.json"
}
Adds the nextjs typescript
plugin
to the react.json
config.
webworker.json
// tsconfig.json
{
"extends": "@cprussin/tsconfig/webworker.json"
}
Extends the base.json
config by adding the webworker
lib.
FAQs
A set of strict shared typescript configs
We found that @cprussin/tsconfig demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
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.