0.0.43 • Published 7 months ago

@gbrachetta/tslint-config v0.0.43

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

@gbrachetta/tslint-config

npm

TSLint configuration for a React-based Project (Next.js, Gatsby, etc). Easy to install and configure, it follows the best code standards from airbnb and uses prettier configuration on code format. Integrated with my prettier configuration.

Purpose

This configuration uses airbnb and Prettier configuration plus some extra rules that I find useful for React applications.

For more information, check ESLint, TSLint and Prettier documentations as well the airbnb and prettier.

This package integrates the Prettier rules with ESLint using my configuration, adapted to a typescript project. You can check it at @gbrachetta/prettier-config

How to install

You need ESLint and Prettier installed as development dependencies on your project. You can install them by using npm or yarn.

npm install --save-dev eslint prettier
# or
yarn add eslint prettier -D

Install all peer dependencies of my configuration, these can be listed with the command:

npm info "@gbrachetta/tslint-config@latest" peerDependencies

Install dependencies by:

npx install-peerdeps --dev @gbrachetta/tslint-config

How to use

To configure ESLint and Prettier you can add to your package.json

"eslintConfig": {
  "extends": "@gbrachetta/tslint-config"
},
"prettier": "@gbrachetta/prettier-config"

If you need to override or extend the settings, you can create a .eslintrc.json and .prettierrc.json files and add extends: "@gbrachetta/tslint-config" and "@gbrachetta/prettier-config" respectivally. As an example:

// .eslintrc.json
{
  "extends": "@gbrachetta/tslint-config"
}
// you can edit this configuration as usual, check ESLint docs
// .prettierrc.json
{
  "@gbrachetta/prettier-config"
}

To use ESLint and Prettier from the terminal, add these scripts to your package.json file

{
  "lint": "eslint ./ --ignore-path .gitignore",
  "lint:fix": "npm run lint -- --fix",
  "format": "prettier --write \"{,!(node_modules)/**/}*.js\""
}

Contributing

How to contribute to this open source library

License

Copyright © 2022 Guillermo Brachetta. This library is licensed under the MIT license.

0.0.40

7 months ago

0.0.41

7 months ago

0.0.42

7 months ago

0.0.20

7 months ago

0.0.43

7 months ago

0.0.21

7 months ago

0.0.22

7 months ago

0.0.23

7 months ago

0.0.24

7 months ago

0.0.25

7 months ago

0.0.37

7 months ago

0.0.15

7 months ago

0.0.38

7 months ago

0.0.16

7 months ago

0.0.39

7 months ago

0.0.17

7 months ago

0.0.18

7 months ago

0.0.19

7 months ago

0.0.30

7 months ago

0.0.31

7 months ago

0.0.32

7 months ago

0.0.10

7 months ago

0.0.34

7 months ago

0.0.12

7 months ago

0.0.35

7 months ago

0.0.13

7 months ago

0.0.36

7 months ago

0.0.14

7 months ago

0.0.26

7 months ago

0.0.9

7 months ago

0.0.27

7 months ago

0.0.8

7 months ago

0.0.28

7 months ago

0.0.29

7 months ago

0.0.5

7 months ago

0.0.7

7 months ago

0.0.6

7 months ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago