1.0.0-rc4 • Published 6 years ago

eslint-config-typescript-airbnb v1.0.0-rc4

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

eslint-config-typescript-airbnb

This package provides Airbnb's JS .eslintrc as an extensible shared config.

Usage

  1. Install correct version of each package, which are listed by the command:
npm info "eslint-config-typescript-airbnb@latest" peerDependencies

if you using npm 5+, use this shortcut

npx install-peerdeps --dev eslint-config-typescript-airbnb

This will work with yarn, npx will detect that you are using yarn and install dependencies via yarn.

  1. Add "extends": "typescript-airbnb" to your .eslintrc.

  2. For non React applications use "extends": "typescript-airbnb/base"

Linting your project

Edit package.json file and following scripts

yarn

  "lint": "eslint --ext .ts,.tsx 'src/**/*.ts?'"
  "lint:fix": "yarn lint --fix",

npm

  "lint": "eslint --ext .ts,.tsx 'src/**/*.ts?'"
  "lint:fix": "npm run lint -- --fix",

Editor setup

Webstorm

  • Disable tslint
  • Enable eslint
  • Under help > find actions
  • Add ts,tsx to eslint.additional.file.extensions

Eslint for typescript[BUG]

Webstorm cannot have eslint fix on save

VS Code

You should uninstall tslint and Prettier from extensions.

  • Install eslint extension
  • Under File > Preferences > Settings
  • Open Edit in settings.json
  • Add following lines
"eslint.validate": [
  "javascript",
  "javascriptreact",
  {
    "language": "typescript",
    "autoFix": true
  },
  {
    "language": "typescriptreact",
    "autoFix": true
  }
]
  • Optionally you can enable/disable Eslint: Auto Fix On Save
    • This will enable more code style functionality than basic prettier

Credits

This config was inspired by eslint-config-react-app and eslint-config-airbnb.

1.0.0-rc4

6 years ago

1.0.0-rc3

6 years ago

1.0.0-rc2

6 years ago

1.0.0-rc1

6 years ago

1.0.0-rc0

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.1-canary.9

6 years ago

0.0.1-canary.8

6 years ago

0.0.1-canary.7

6 years ago

0.0.1-canary.6

6 years ago

0.0.1-canary.5

6 years ago

0.0.1-canary.4

6 years ago

0.0.1-canary.3

6 years ago

0.0.1-canary.2

6 years ago