This repository hosts several sharable configs that can be consumed and customized by Snowcoders packages.
We're open to hosting more, as long as they are a part of the Snowcoders ecosystem.
Other things that are useful from this repository
- .gitignore - We wil notify about updates via our changelog
- .npmignore - We wil notify about updates via our changelog
A great example of how to use these configs is this repository itself! Though for you instead of referencing the dist
folder directly you would reference @snowcoders/renovate-config
-
Install dependencies
npm i --save-dev --exact eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-config-prettier eslint-plugin-prettier
-
Create file
.eslintrc.js
. -
Add the following contents
/* eslint-disable */ const configs = require("@snowcoders/renovate-config"); module.exports = configs.eslint;
-
Install dependencies
npm i --save-dev --exact husky lint-staged
-
Create file
.huskyrc.js
. -
Add the following contents
/* eslint-disable */ const configs = require("@snowcoders/renovate-config"); module.exports = configs.husky;
-
Install dependencies
npm i --save-dev --exact jest ts-jest
-
Create file
jest.config.js
. -
Add the following contents
/* eslint-disable */ const configs = require("@snowcoders/renovate-config"); module.exports = configs.jest;
-
Install dependencies
npm i --save-dev --exact husky lint-staged
-
Create file
.lintstagedrc.js
. -
Add the following contents
/* eslint-disable */ const configs = require("@snowcoders/renovate-config"); module.exports = configs.lintStaged;
-
Install dependencies
npm i --save-dev --exact prettier
-
Create file
.prettierrc.js
. -
Add the following contents
/* eslint-disable */ const configs = require("@snowcoders/renovate-config"); module.exports = configs.prettier;
-
Install dependencies
npm i --save-dev --exact sortier
-
Create file
.sortierrc.js
. -
Add the following contents
/* eslint-disable */ const configs = require("@snowcoders/renovate-config"); module.exports = configs.sortier;
-
Install dependencies
npm i -D -E typescript
For all configs, you'll need to specify:
- compilerOptions.rootdir
- compilerOptions.outdir
- include
- exclude
Our project has three tsconfigs for libraries
- tsconfig.library.cjs.json - config to be used for cjs projects
- tsconfig.library.esm.json - config to be used for esm projects
For libraries which support both ESM and CJS, the current recommendation is to have your tsconfig.json
extend tsconfig.library.esm.json
and then have a separate tsconfig.cjs.json for the CJS build. This will mean that VSCode will load intellisense for ESM but overall it shouldn't impact your development day to day.
Our project has three tsconfigs for libraries
- tsconfig.website.json - config that tsconfig.json extends for vscode intellisense
- tsconfig.website.browser.dev.json - config for webpack to use for development browser asset builds
- tsconfig.website.browser.prod.json - config for webpack to use for production browser asset builds
- tsconfig.website.server.json - config to build the node server assets
For libraries which support both ESM and CJS, the current recommendation is to have your tsconfig.json
extend tsconfig.library.esm.json
and then have a separate tsconfig.cjs.json for the CJS build. This will mean that VSCode will load intellisense for ESM but overall it shouldn't impact your development day to day.