Skip to content

ESlint Typescript MailOnline config, migrated from tslint-config-mailonline due to tslint deprecation

License

Notifications You must be signed in to change notification settings

MailOnline/eslint-config-ts-mailonline

Repository files navigation

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.

About

ESlint Typescript MailOnline config, migrated from tslint-config-mailonline due to tslint deprecation

Resources

License

Stars

Watchers

Forks

Packages

No packages published