UNPKG

@alza54/eslint-config-typescript

Version:

Strict shareable config for ESLint and TypeScript that I use for my projects

77 lines (57 loc) 2.07 kB
# @alza54/eslint-config-typescript [![shellcode.team](https://img.shields.io/badge/style-shellcode.team-red.svg?label=&logo=buffer&logoColor=fff)](http://shellcode.team) [![Build Status](https://travis-ci.com/alza54/shellcode-styleguide.svg?branch=master)](https://travis-ci.com/alza54/shellcode-styleguide) [![shellcode-styleguide](https://img.shields.io/badge/style-shellcode-000000.svg)](https://github.com/alza54/shellcode-styleguide) Shareable configuration for [`eslint`](https://github.com/eslint/eslint). The main idea of this configuration is to: 1. Be opinionated 2. Be strict about syntax and secure by default 3. Enforce best-practices 4. Be nice for developer and pleasant to work with. The goal of this project is to be nicer version of [`wemake-frontend-styleguide`](https://github.com/wemake-services/wemake-frontend-styleguide). Warning: this configuration has a very personal character. ## Installation ```bash npm install --save-dev @alza54/eslint-config-typescript ``` or yarn ```bash yarn add -D @alza54/eslint-config-typescript ``` Then, modify your `eslint` configuration: ```json { "extends": [ "@alza54/typescript/base" ] } ``` **It's highly advised to use the recommended (more opinionated) config, which relies on Typescript's AST:** ```json { "extends": [ "@alza54/typescript/recommended" ] } ``` **Or option configuration "strict", which is even more strict, but requires your code to compile:** ```json { "extends": [ "@alza54/typescript/strict" ] } ``` **You can also extend config for [`eslint-plugin-import`](https://github.com/benmosher/eslint-plugin-import), but usage of this plugin is not [recommended by typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/blob/f335c504bcf75623d2d671e2e784b047e5e186b9/docs/getting-started/linting/FAQ.md#eslint-plugin-import).** ```json { "extends": [ "@alza54/typescript/import", "@alza54/typescript/recommended" ] } ``` Done! Later you can modify your configuration to include any extra rules you need. ## License MIT.