0.0.6 • Published 4 years ago

@lanp/eslint-config v0.0.6

Weekly downloads
6
License
ISC
Repository
github
Last release
4 years ago

What is it?

This config was created to make code be more standartized and elenant in our team's products. We follow best AirBnb practices, while extending them with some more rules.

Installing and VSCode setup

You need to follow this steps to make this config work in your project and be synced with VSCode editor and Prettier:

  1. Add Eslint config: yarn add @lanp/eslint-config --dev

  2. yarn add babel-eslint eslint eslint-config-airbnb eslint-config-prettier eslint-plugin-flowtype eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks prettier --dev

  3. Add .prettierrc.js file:

module.exports = {
  trailingComma: "es5",
  tabWidth: 2,
  semi: false,
  singleQuote: true,
};
  1. Install following extensions to your VSCode editor: ESLint, Flow Language Support, Prettier - Code formatter.

  2. Create .vscode/settings.json file and add the following content there:

{
  // Makes ESlint extension format code on save
  "editor.formatOnSave": true,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },

  // Disable VSCode built-in validation
  "javascript.validate.enable": false,
  "typescript.validate.enable": false,

  // Disabling Prettier formatting with VSCode extension because it'll be handled by ESlint and it's built-in Prettier plugin
  "prettier.disableLanguages": ["javascript", "javascriptreact"],

  // Eslint-related rules
  "eslint.enable": true,
  "eslint.alwaysShowStatus": true,
  "eslint.options": {
    "configFile": ".eslintrc"
  }
}
  1. Add .eslintrc with following that extends our config to the root folder:
{
  "extends": "@lanp/eslint-config",
}
  1. Congrats, let the magic happen!
0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago