eslint-plugin-prettier: error Delete `·` prettier/prettier in a fresh Nuxt.js app with Prettier and Eslint

Fresh Nuxt.js applicatioin with Eslint and Prettier.

What version of eslint are you using? "^5.15.1" What version of prettier are you using? "^1.16.4" What version of eslint-plugin-prettier are you using? "^3.0.1" Please paste any applicable config files that you’re using (e.g. .prettierrc or .eslintrc files) .prettierrc

{
  "semi": false,
  "singleQuote": true
}

.eslinterc

module.exports = {
  root: true,
  env: {
    browser: true,
    node: true
  },
  parserOptions: {
    parser: 'babel-eslint'
  },
  extends: [
    'prettier',
    'prettier/vue',
    'plugin:prettier/recommended',
    '@nuxtjs',
    'plugin:nuxt/recommended'
  ],
  plugins: [
    'prettier'
  ],
  // add your custom rules here
  rules: {
  }
}

What source code are you linting? plugins/axios.js (https://axios.nuxtjs.org/extend)

export default function ({ $axios, redirect }) {
  $axios.onRequest(config => {})
}

What did you expect to happen? No error What actually happened? image

package.json

{
  "name": "create-ensemble",
  "version": "1.0.0",
  "description": "App for creative people",
  "author": "Jędrek Domański",
  "private": true,
  "scripts": {
    "lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
    "precommit": "npm run lint",
    "test": "jest",
    "dev": "nuxt",
    "build": "nuxt build",
    "start": "nuxt start",
    "generate": "nuxt generate"
  },
  "dependencies": {
    "bootstrap-vue": "^2.0.0-rc.11",
    "bootstrap": "^4.1.3",
    "@nuxtjs/axios": "^5.3.6",
    "@nuxtjs/pwa": "^2.6.0",
    "nuxt": "^2.0.0"
  },
  "devDependencies": {
    "@nuxtjs/eslint-config": "^0.0.1",
    "@nuxtjs/eslint-module": "^0.0.1",
    "babel-eslint": "^10.0.1",
    "eslint": "^5.15.1",
    "eslint-config-standard": ">=12.0.0",
    "eslint-plugin-import": ">=2.16.0",
    "eslint-plugin-jest": ">=22.3.0",
    "eslint-plugin-node": ">=8.0.1",
    "eslint-plugin-nuxt": ">=0.4.2",
    "eslint-plugin-promise": ">=4.0.1",
    "eslint-plugin-standard": ">=4.0.0",
    "eslint-plugin-vue": "^5.2.2",
    "eslint-config-prettier": "^4.1.0",
    "eslint-plugin-prettier": "^3.0.1",
    "prettier": "^1.16.4",
    "@vue/test-utils": "^1.0.0-beta.27",
    "babel-core": "7.0.0-bridge.0",
    "babel-jest": "^24.1.0",
    "jest": "^24.1.0",
    "vue-jest": "^3.0.3",
    "nodemon": "^1.18.9"
  }
}

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 6
  • Comments: 19 (2 by maintainers)

Most upvoted comments

This is not recommended, but as a last resort

If you want to disable these annoying warnings/errors from prettier like delete '.' and so on, you can create .eslintignore file in the root of your project and set folders to ignore:

/components/**
/pages/**
/layouts/**

You may want to add more folders and you’re free to do it. This works for me, thanks.


I found that the CRLF/LF types do not work correctly on Windows OS, but there are no such problems on Mac/Linux. Try also going through all the files that give you errors and formatting the contents using Prettier.

No help for this problem, very angry on this issue. Did not give a good solution

That all seems to be good.

Prettier wants there to be no space between function keywords and brackets for anonymous functions

The file that was generated doesn’t adhere to prettier’s styling. If you think it should then you should fix the issue in wherever generates that file.

adding "semi": false to .prettierrc fixes.

This helped me npm run lint – --fix ( I hope it can work for yarn as well )

For me it was indentation problem. You can run npx eslint folder/file.js --fix.

No help for this problem.

I’m unsure how I can help? This is a project that allows you to use prettier’s formatting opinions. The file provided does not follow prettier’s formatting and the “error” is telling you that you should edit your code to follow prettier’s formatting.

If you don’t like that then either stop using prettier, or open an issue in prettier to change the behaviour

Could at least link to the relevant issue: https://github.com/prettier/prettier/issues/3845