eslint-config-ts-mailonline

3.1.1 • Public • Published

eslint-config-ts-mailonline

NPM version Build status

MailOnline ESlint Typescript configuration.

Usage

  1. Add eslint-config-ts-mailonline, eslint, typescript, prettier, husky, and pretty-quick as development dependencies:
yarn add --dev eslint-config-ts-mailonline eslint typescript prettier husky pretty-quick
  1. Create a tsconfig.eslint.json file (this is a technicality due to the way the eslint typescript parser works):
{
  "compilerOptions": {"strict": true},
  "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"],
  "exclude": ["node_modules", "dist", "coverage"]
}
  1. Create ESLint configuration file (.eslintrc.json) that extends ts-mailonline:
{
  "extends": ["ts-mailonline", "ts-mailonline/react"],
  "parserOptions": {
    "project": "./tsconfig.eslint.json"
  }
}
  1. Create prettier.config.js on the root of your project with these contents:
module.exports = require('eslint-config-ts-mailonline/prettier');
  1. Create an .eslintignore file:
bin/
dist/
coverage/
dev/
node_modules/
*.css.d.ts
  1. Add the following script command to your package.json:
{
  "lint": "tsc --noEmit && eslint './**/*.{js,jsx,ts,tsx}'"
}
  1. Add the following pre-commit hook to your husky pre-commit script:
pretty-quick --staged && yarn run lint

Breaking changes

Any changes to this package that might cause code using it to not validate anymore, will be a semver-major change.

Package Sidebar

Install

npm i eslint-config-ts-mailonline

Weekly Downloads

284

Version

3.1.1

License

MIT

Unpacked Size

12.3 kB

Total Files

14

Last publish

Collaborators

  • mailonline
  • carpasse
  • claudiorodriguez