question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Replace ' ' with Return Symbol (⏎······'code',⏎)

See original GitHub issue

What version of eslint are you using? 4.10

What version of prettier are you using? 1.8.2

What version of eslint-plugin-prettier are you using? 2.3.1

Please paste any applicable config files that you’re using (e.g. .prettierrc or .eslintrc files)

{
  "extends": ["airbnb", "prettier"],
  "plugins": ["prettier"],
  "parserOptions": {
    "ecmaVersion": 2016,
    "sourceType": "module",
    "ecmaFeatures": {
      "jsx": true
    }
  },
  "env": {
    "es6": true,
    "browser": true,
    "node": true
  },
  "globals": {
    "_": true
  },
  "rules": {
    "no-console": 0,
    "prefer-template": 0,
    "no-underscore-dangle": 0,
    "jsx-a11y/anchor-is-valid": [
      "error",
      {
        "components": ["Link"],
        "specialLink": ["to", "hrefLeft", "hrefRight"],
        "aspects": ["noHref", "invalidHref", "preferButton"]
      }
    ],
    "prettier/prettier": ["error", { "singleQuote": true }]
  }
}

What source code are you linting? self.sup.addEventListener('change-background', self.changeBackground);

What did you expect to happen? Did not expect an error because my sublime Jsprettier extension does not make any changes to the written code. I tried the code on prettier.io website and that too didn’t change the formatting.

What actually happened? Error :
Replace 'change-background',·self.changeBackground with ⏎······'change-background',⏎······self.changeBackground⏎····

On running eslint --fix it fixes the code to

self.el.sceneEl.addEventListener(
  'change-background',
  self.changeBackground
);

But on formatting the file in sublime by saving, it does not format in the above shown manner, which results in the error.

I want to remove this error and use the original style of code I have written, but not finding a rule to disable this.

Thanks

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

42reactions
Ale-cccommented, Aug 6, 2019

I solved by this issue https://github.com/prettier/eslint-plugin-prettier/issues/42

41reactions
not-an-aardvarkcommented, Oct 16, 2018

If you don’t want your code to be formatted, you can disable the prettier/prettier rule (and also consider removing eslint-plugin-prettier, since that rule is the entire functionality of this project).

If you just want to disable warnings in an editor while still having the rule enabled on the command line, you can look into your editor settings – I think some editor plugins support ignoring warnings from certain rules.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prettier ask me to replace ⏎↹↹ with · - Stack Overflow
I cloned a github repo and literally just tried to change like one line but I got hit by this prettier error which...
Read more >
MS-Word adding & removing carriage returns (line breaks)
The problem is that you cannot specify this carriage return symbol on a replace command. It's not necessary to use a Macro for...
Read more >
How to replace Prettier by ESLint rules ? | by Florian Briand
In this article, I'll list and explain how to quickly replace ... So, when Prettier rewrite the code to ensure the 80 characters...
Read more >
Find and replace text using regular expressions - JetBrains
Search and replace with regular expressions ... Click Replace or press ⏎ to replace the current occurrence, Replace All to replace all ...
Read more >
How whitespace is handled by HTML, CSS, and in the DOM
These characters allow you to format your code in a way that will make it easily readable ... all tabs with ⇥, and...
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