@sapphire/ts-config

    3.3.4 • Public • Published

    Sapphire Logo

    @sapphire/ts-config

    TypeScript configuration for all Sapphire Community repositories.

    GitHub codecov npm bundle size npm

    Table of Contents

    Installation

    You can use the following command to install this package, or replace npm install with your package manager of choice.

    npm install --save-dev @sapphire/ts-config

    Usage

    Base Config

    You can use @sapphire/ts-config base tsconfig.json by extending it in yours:

    {
    	"extends": "@sapphire/ts-config"
    }

    This TypeScript config is set up in such a way that it will suite nearly all projects, you may extend this to include your own configuration options as well.

    Following is a copy of this config file for easy viewing:

    {
    	"compileOnSave": true,
    	"compilerOptions": {
    		"allowSyntheticDefaultImports": true,
    		"alwaysStrict": true,
    		"declaration": true,
    		"declarationMap": true,
    		"emitDecoratorMetadata": true,
    		"esModuleInterop": true,
    		"experimentalDecorators": true,
    		"forceConsistentCasingInFileNames": true,
    		"importHelpers": true,
    		"importsNotUsedAsValues": "error",
    		"incremental": true,
    		"lib": ["esnext"],
    		"module": "CommonJS",
    		"moduleResolution": "Node",
    		"newLine": "lf",
    		"noEmitHelpers": true,
    		"noFallthroughCasesInSwitch": true,
    		"noImplicitReturns": true,
    		"noUnusedLocals": true,
    		"noUnusedParameters": true,
    		"preserveConstEnums": true,
    		"pretty": true,
    		"removeComments": false,
    		"resolveJsonModule": true,
    		"sourceMap": true,
    		"strict": true,
    		"target": "ES2019",
    		"useDefineForClassFields": true
    	}
    }

    Config without decorators

    You can use @sapphire/ts-config's without-decorators.json by extending it in yours:

    {
    	"extends": "@sapphire/ts-config/without-decorators"
    }

    This TypeScript extends everything from the base config, but disables decorator support.

    Following is a copy of this config file for easy viewing:

    {
    	"$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/tsconfig.json",
    	"extends": "./tsconfig.json",
    	"compilerOptions": {
    		"emitDecoratorMetadata": false,
    		"experimentalDecorators": false
    	}
    }

    Config with extra strict compiler options

    You can use @sapphire/ts-config's extra-strict.json by extending it in yours:

    {
    	"extends": "@sapphire/ts-config/extra-strict"
    }

    This TypeScript extends everything from the base config, while enabling some extra strict options.

    Following is a copy of this config file for easy viewing:

    {
    	"$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/tsconfig.json",
    	"extends": "./tsconfig.json",
    	"compilerOptions": {
    		"allowUnreachableCode": false,
    		"allowUnusedLabels": false,
    		"exactOptionalPropertyTypes": false,
    		"noImplicitOverride": true
    	}
    }

    Config with extra strict compiler options and without decorators

    You can use @sapphire/ts-config's extra-strict-without-decorators.json by extending it in yours:

    {
    	"extends": "@sapphire/ts-config/extra-strict-without-decorators"
    }

    This TypeScript is a combination of the Config without decorators and Config with extra strict compiler options config files.

    Following is a copy of this config file for easy viewing:

    {
    	"$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/tsconfig.json",
    	"extends": "./extra-strict.json",
    	"compilerOptions": {
    		"emitDecoratorMetadata": false,
    		"experimentalDecorators": false
    	}
    }

    Buy us some doughnuts

    Sapphire Community is and always will be open source, even if we don't get donations. That being said, we know there are amazing people who may still want to donate just to show their appreciation. Thank you very much in advance!

    We accept donations through Open Collective, Ko-fi, Paypal, Patreon and GitHub Sponsorships. You can use the buttons below to donate through your method of choice.

    Donate With Address
    Open Collective Click Here
    Ko-fi Click Here
    Patreon Click Here
    PayPal Click Here

    Contributors

    Thanks goes to these wonderful people (emoji key):


    Jeroen Claassens

    💻 🚇 📆 📖 ⚠️

    Antonio Román

    💻 📆 👀 ⚠️

    Gryffon Bellish

    💻 👀 ⚠️

    Vlad Frangu

    💻 🐛 👀 📓 ⚠️

    Stitch07

    💻 📆 ⚠️

    depfu[bot]

    🚧

    allcontributors[bot]

    📖

    Tyler J Russell

    📖

    Ivan Lieder

    💻 🐛

    Hezekiah Hendry

    💻

    Vetlix

    💻

    Ethan Mitchell

    📖

    Elliot

    💻

    Jurien Hamaker

    💻

    Charalampos Fanoulis

    📖

    dependabot[bot]

    🚧

    Kaname

    💻

    nandhagk

    🐛

    megatank58

    💻

    UndiedGamer

    💻

    Lioness100

    📖 💻

    David

    💻

    renovate[bot]

    🚧

    WhiteSource Renovate

    🚧

    FC

    💻

    Jérémy de Saint Denis

    💻

    MrCube

    💻

    bitomic

    💻

    c43721

    💻

    This project follows the all-contributors specification. Contributions of any kind welcome!

    Install

    npm i @sapphire/ts-config

    DownloadsWeekly Downloads

    2,791

    Version

    3.3.4

    License

    MIT

    Unpacked Size

    21.4 kB

    Total Files

    7

    Last publish

    Collaborators

    • favna
    • kyranet
    • vladfrangu