How to disable error Insert `⏎` prettier/prettier?

See original GitHub issue

JSX File:

import React from "react";
import TemplateWrapper from "../layouts/index";

const IndexPage = () => (
  <TemplateWrapper>
    <h1>Hi people</h1>
    <p>Welcome to your Blog.</p>
    <p>Now go build something great.</p>
  </TemplateWrapper>
);

export default IndexPage;  // error  Insert `⏎`  prettier/prettier

ESLint config:

{
  "root": true,
  "env": {
    "browser": true,
    "es6": true,
    "node": true,
    "jest": true
  },
  "parser": "babel-eslint",
  "parserOptions": {
    "ecmaVersion": 2018,
    "sourceType": "module",
    "ecmaFeatures": {
      "jsx": true,
      "modules": true
    }
  },
  "plugins": ["react", "react-hooks", "jsx-a11y", "import"],
  "extends": [
    "airbnb",
    "eslint:recommended",
    "plugin:prettier/recommended",
    "prettier/react",
    "prettier/standard",
    "plugin:react/recommended",
    "plugin:import/errors",
    "plugin:import/warnings",
    "plugin:jsx-a11y/recommended"
  ],
  "settings": {
    "react": {
      "version": "detect"
    }
  },
  "rules": {
    "no-unused-vars": ["warn"],
    "prettier/prettier": ["error", {"singleQuote": false}],
//    "prettier/prettier": ["error", {"singleQuote": false}],
    "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
    "react/jsx-uses-react": 1,
    "react/jsx-uses-vars": 1,
    "react/react-in-jsx-scope": 1,
    "react-hooks/rules-of-hooks": "error",
    "react-hooks/exhaustive-deps": "warn",
    "react/display-name": 0,
    "react/prop-types": [0, { "ignore": ["children"] }],
    "jsx-a11y/anchor-is-valid": 0
  }
}

Prettier config:

{
  "trailingComma": "none",
  "semi": true,
  "tabWidth": 2,
  "singleQuote": false,
  "bracketSpacing": true,
  "jsxBracketSameLine": true
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:18 (2 by maintainers)

github_iconTop GitHub Comments

117reactions
Snaptagscommented, Jan 17, 2020

I just had the same problem with the difference being that linting worked locally (using Windows) but failed on the Linux CI machine. Solved it by adding

"prettier/prettier": ["error", {
    "endOfLine":"auto"
  }],

to the rules section in .eslintrc

10reactions
BPScottcommented, Jul 3, 2019

One of prettier’s standard formattings is that files must end with a newline character as per the POSIX Standard. There is no option for change that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Insert `··` prettier/prettier - visual studio code - Stack Overflow
Important: Based on the answer here: Uninstall prettier-eslint extension. Share.
Read more >
eslint-plugin-prettier - npm
This plugin works best if you disable all other ESLint rules relating to code formatting, and only enable rules that detect potential bugs....
Read more >
ignore prettier errors | The AI Search Engine You Control
Insert Pragma. First available in v1.8.0. Prettier can insert a special @format marker at the top of files specifying that the file has...
Read more >
eslint-plugin-prettier | Yarn - Package Manager
You can use eslint-config-prettier to disable all formatting-related ESLint rules. This plugin ships with a plugin:prettier/recommended config that sets up both ...
Read more >
Integrating with Linters - Prettier
Linters usually contain not only code quality rules, but also stylistic rules. Most stylistic rules are unnecessary when using Prettier, but worse –...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found