We're having trouble integrating prettier with eslint. We used eslint-plugin-prettier
together with eslint-configure-prettier
. Here's the content of the package.json
that we use
{
...
"scripts": {
...,
"lint": "./node_modules/.bin/eslint .",
...
},
"dependencies": {
...
},
"devDependencies": {
...,
"eslint": "^3.17.1",
"eslint-config-airbnb": "^14.1.0",
"eslint-config-loopback": "^4.0.0",
"eslint-config-prettier": "^2.0.0",
"eslint-import-resolver-babel-module": "^3.0.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-prettier": "^2.0.1",
...,
"prettier": "^1.3.1",
"prettier-eslint": "^6.2.0",
"prettier-eslint-cli": "^3.4.3",
...
},
"repository": {
"type": "",
"url": ""
},
...
}
{
"parser": "babel-eslint",
"extends": [
"airbnb/base",
"prettier"
],
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "module"
},
"env": {
"es6": true,
"node": true
},
"rules": {
"prettier/prettier": "error",
"arrow-parens": [
"error",
"always"
],
"arrow-body-style": [
2,
"as-needed"
],
"comma-dangle": [
2,
"always-multiline"
],
"import/imports-first": 0,
"import/newline-after-import": 0,
"import/no-dynamic-require": 0,
"import/no-extraneous-dependencies": 0,
"import/no-named-as-default": 0,
"import/prefer-default-export": 0,
"indent": [
2,
2,
{
"SwitchCase": 1
}
],
"linebreak-style": [
2,
"unix"
],
"new-cap": [
2,
{
"properties": false
}
],
"no-unused-vars": [
2,
{
"vars": "all",
"args": "after-used"
}
],
"no-use-before-define": [
2
],
"no-trailing-spaces": [
2
],
"quotes": [
2,
"single"
],
"semi": [
2,
"always"
],
"wrap-iife": [
2,
"outside"
],
"strict": [
2,
"global"
],
"brace-style": 2,
"block-spacing": [
2,
"always"
],
"keyword-spacing": [2, {"before": true, "after": true, "overrides": {}}],
"space-before-blocks": 2,
"space-before-function-paren": [2, {"anonymous": "always", "named": "never"}],
"comma-spacing": [2, {"before": false, "after": true}],
"comma-style": [2, "last"],
"no-lonely-if": 2,
"array-bracket-spacing": [2, "never"],
"no-spaced-func": [2],
"space-in-parens": [2, "never"],
"space-infix-ops": 2
},
"settings": {
"import/resolver": {
"babel-module": {}
}
},
"globals": {
"after": true,
"afterEach": true,
"before": true,
"beforeEach": true,
"describe": true,
"it": true
}
}