@preply/lint-configs

2.1.0 • Public • Published

Installation

  • yarn add -D @preply/lint-configs tslint@5 eslint@5 — explanation
  • Create an .eslintrc.js:
module.exports = {
  extends: require.resolve('@preply/lint-configs/eslint.main.js'),
};
  • Create a .prettierrc.js:
module.exports = {
  ...require('@preply/lint-configs/prettier'),
};

  • Create a .tslint.json:
{
  "extends": [
    "@preply/lint-configs/tslint.json"
  ]
}
  • Put these guys into "scripts" in your package.json:
"lint:es": "eslint src --ext .js,.jsx",
"lint:ts": "tslint  'src/**/*.ts{,x}' --config ./tslint.json --project ./tsconfig.json",
"prettify": "prettier --write \"./src/**/*.{ts,tsx,js}\"",

Tip: pass --fix into both in development:

yarn lint:es --fix
yarn lint:ts --fix
  • Call it on CI (make sure there's no --fix, we want it to block non-compliant code)!

Readme

Keywords

none

Package Sidebar

Install

npm i @preply/lint-configs

Weekly Downloads

597

Version

2.1.0

License

ISC

Unpacked Size

4.58 kB

Total Files

6

Last publish

Collaborators

  • alex.semeniuk
  • preply-admin
  • eugenegodun
  • heiets-preply
  • erebus1
  • liss-mouse
  • grebenyuksv