@tloncorp/eslint-config

0.0.6 • Public • Published

Tlon ESLint + Prettier Configuration

Abstract

These are our shared settings for ESLint and Prettier. This ESLint configuration lints and formats our code so it follows our shared style guide. It uses ESLint to lint and fix Typescript and Javascript, and Prettier to format our code nicely.

Installation

Install the package with:

npm install @tloncorp/eslint-config --save-dev

@tloncorp/eslint-config requires you to take care of it's peerDependencies. Install the correct version of each peerDependencies package, which are listed with the following command:

npx install-peerdeps --dev @tloncorp/eslint-config

ESLint Configuration

Now add @tloncorp/eslint-config to your .eslintrc.js:

// .eslintrc.js
module.exports = {
    extends: '@tloncorp/eslint-config',

    // for typescript codebases, you'll also need to add the followings:
    overrides: [
        {
            files: ['**/*.ts', '**/*.tsx'],
            parserOptions: {
                project: './tsconfig.json', // edit this path to point to your tsconfig.json
            },
        },
    ],
}

Prettier Configuration

This is how you can use or extend the @tloncorp/eslint-config Prettier config in your app:

// .prettierrc.js
module.exports = require('@tloncorp/eslint-config/.prettierrc.js')

// or to override specific options
module.exports = {
    ...require('@tloncorp/eslint-config/.prettierrc.js'),
    semi: true,
}

Publishing

This package gets published to NPM: @tloncorp/eslint-config. You will need to be a member of @tloncorp on npm in order to publish changes. From here you can publish your changes with:

  1. Update the version number in package.json, and merge your changes into master
  2. From master, run npm publish

Readme

Keywords

none

Package Sidebar

Install

npm i @tloncorp/eslint-config

Weekly Downloads

4

Version

0.0.6

License

MIT

Unpacked Size

6.39 kB

Total Files

4

Last publish

Collaborators

  • lukestiles
  • patrick_tlon
  • tomholford
  • rilfun-lidlen
  • nocsyx-lassul