Giter Club home page Giter Club logo

eslinter-prettier-config's Introduction

eslinter-prettier-config

Manual de instrucciones para inicializar un proyecto con las bondades que ofrecen ambos paquetes a la hora de mantener un codigo limpio

1-

yarn add eslint -D

2-

npx eslint --init

3- How would you like to use ESLINT? To check syntax, find problems and enforce code style

4- What type of modules does your project use? JavaScript modules

5- Which framework does your project use? React

6- Does your project use TypeScript? No

7- Where does your code run? Browser & Node (press < space > to select)

8- How would you like to define a style for yout project? Guide > Standard

9- What format do you want yout config file to be in? JavaScript

10-

yarn add eslint-plugin-react eslint-config-standard  eslint-plugin-import eslint-plugin-node eslint-plugin-promise -D

11- Crear un script en el package.json "lint": "eslint . --fix"

12-

yarn add eslint-config-prettier -D

13- Agregar prettier al array de extends en el archivo .eslintrc.js

14- Instalar Prettier

yarn add prettier -D

15- Crear un archivo llamado .prettierrc.js e introducirle el siguiente codigo:

module.exports = {
    trailingComma: "es5",
    tabWidth: 4,
    semi: false,
    singleQuote: true,
};

16- Correr el script npx prettier . --check 17- Añadir el archivo .prettierignore para ignorar las carpetas necesarias 18- Correr el script npx prettier . --write 19- Para una mejor experiencia a la hora de integrar estas correcciones de codigo, es necesario instalar las extensiones Prettier y ESLint y configurar el VS Code para que el formateo automatico lo haga con estas extensiones. Para ello debemos agregar/modificar en el settings.json de VS Code lo siguiente:

{
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "[javascript]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    }
}

Para mas informacion visitar:

  • Prettier
  • ESLint

eslinter-prettier-config's People

Contributors

mativiscusso avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.