@jupl/ts

3.0.0 • Public • Published

TypeScript Configurations

NPM Travis Dependencies Peer Dependencies Dev Dependencies

About

Personal configurations for TypeScript projects. Sets up base path to src/. Includes:

Installation

npm install @jupl/ts
yarn add @jupl/ts

Usage

TypeScript

Add to tsconfig.json:

{
  "extends": "@jupl/ts",
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "~/*": ["src/*"]
    }
  }
}

Prettier

Install dependencies:

  • prettier

Add to .prettierrc.js:

module.exports = require('@jupl/ts/format')

ESLint

Install any of the following dependencies based on your use case:

  • @next/eslint-plugin-next (Next.js)
  • @remix-run/eslint-config (Remix)
  • @typescript-eslint/eslint-plugin
  • @typescript-eslint/parser
  • eslint
  • eslint-config-prettier
  • eslint-import-resolver-node (Yarn PnP)
  • eslint-plugin-functional
  • eslint-plugin-import
  • eslint-plugin-jsdoc
  • eslint-plugin-prettier (and prettier)
  • eslint-plugin-react
  • eslint-plugin-react-hooks
  • eslint-plugin-sonarjs

Add to .eslintrc.js:

module.exports = {
  ...require('@jupl/ts/lint'),
  // Additional options
}

Jest

Install dependencies:

  • babel-plugin-dynamic-import-node
  • babel-jest (Yarn PnP)
  • jest
  • ts-jest

Add to jest.config.js:

const {pathsToModuleNameMapper} = require('ts-jest/utils')
const {compilerOptions} = require('./tsconfig')

module.exports = {
  moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
    prefix: '<rootDir>/',
  }),
  preset: '@jupl/ts',
}

Readme

Keywords

none

Package Sidebar

Install

npm i @jupl/ts

Weekly Downloads

29

Version

3.0.0

License

MIT

Unpacked Size

24.8 kB

Total Files

10

Last publish

Collaborators

  • jupl