L
L
Lynatik0012020-06-29 02:35:04
JavaScript
Lynatik001, 2020-06-29 02:35:04

Eslint and prettier and their conflicts?

conflicts begin, these plugins, when I turn on both

when I include "prettier" in the eslintrc file, formatting indents and so on stops working when saving

{
  "extends": ["airbnb/base", "prettier"],
  "plugins": ["prettier"],
  "rules": {}
}


those. - with an example of how the norms work below

"extends": ["airbnb/base"],
  "plugins": ["prettier"],
  "rules": {}
}


we use prettier for formatting and so on when writing in other languages.
By the way, I installed prettier as a plugin and through npm --dev

So I came to another question. Is there anything extra here? well, by the fact that I installed it 2 times and etc. or that

settings.json is a file with vscode settings

{
  "window.zoomLevel": 0,
  "editor.formatOnSave": true,
  "[javascript]": {
    "editor.formatOnSave": false
  },
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true,
    "source.fixAll": true
  },
  "files.autoSave": "afterDelay",
  "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe",
  "prettier.singleQuote": true,
  "files.associations": {},
  "prettier.disableLanguages": ["js"],
  "files.eol": "\n"
}


package.json

{
  "name": "",
  "version": "1.0.0",
  "description": "This README would normally document whatever steps are necessary to get your application up and running.",
  "main": "index.js",
  "dependencies": {
    "mongodb": "^3.5.8",
    "mongoose": "^5.9.17",
    "telegraf": "^3.38.0",
    "telegraf-keyboard": "^1.1.2"
  },
  "devDependencies": {
    "eslint-config-airbnb": "^18.1.0",
    "eslint-config-prettier": "^6.11.0",
    "eslint-plugin-import": "^2.21.2",
    "eslint-plugin-prettier": "^3.1.4",
    "prettier": "^2.0.5"
  },
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node index.js"
  },
  "repository": {
    "type": "git",
    "url": ""
  },
  "author": "im",
  "license": "ISC",
  "homepage": ""
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question