npm.io
0.1.0 • Published 7 years ago

@lightspeed/web-configs

Licence
MIT
Version
0.1.0
Deps
5
Size
7 kB
Vulns
0
Weekly
0

Web Commons

Bridge commonalities between apps in the
Lightspeed ecosystem.

Introduction

A central repository of base tooling configurations, used to establish best practises around these tools at Lightspeed. These configurations can be extended as required on a per-project basis.

Getting started

  1. Install the dependency in your webapp.
yarn add @lightspeed/web-config

Consuming and extending configuration

Babel
// babel.config.js
module.exports = {
  presets: ['@lightspeed/web-config/babel'],
};
Next.js
// next.config.js
module.exports = require('@lightspeed/web-config/next');
Prettier
// prettier.config.js
module.exports = require('@lightspeed/web-configs/prettier');
TypeScript

TypeScript does not support tsconfig.js files, so you'll need to use the extends field in the tsconfig.json file to point to a relative reference of this package's base tsconfig.json.

{
  "extends": "./node_modules/@lightspeed/lightspeed-scripts/tsconfig"
}

Note: In an app within a monorepo, you'll need to either reference the top-level node_modules directory, or add @lightspeed/web-config to your nohoist configuration.