1.2.0 • Published 2 years ago

eslint-config-ryanair v1.2.0

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

Ryanair linter rules

Common eslint rules used in Ryanair's projects.

How to use it

  npx install-peerdeps --dev eslint-config-ryanair

Then in your .eslintrc

{
  "extends": "eslint-config-ryanair"
}

Format on save

There is an eslint rule to enforce the usage of prettier with some specific configuration. If you run prettier through your text editor it won't find the configuration and it will format differently than eslint auto fix option.

In order to fix this, disable format on save for typescript and html files and leave only eslint auto fix for those types of files.

In VSCode the config looks like this:

{
  "editor.formatOnSave": true,
  "[typescript]": {
    "editor.formatOnSave": false
  },
  "[html]": {
    "editor.formatOnSave": false
  },

  "eslint.options": {
    "extensions": [".ts", ".html"]
  },
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact",
    "html"
  ],

  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  }
}