Replace ' ' with Return Symbol (⏎······'code',⏎)
See original GitHub issueWhat 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:
- Created 6 years ago
- Comments:8 (4 by maintainers)
I solved by this issue https://github.com/prettier/eslint-plugin-prettier/issues/42
If you don’t want your code to be formatted, you can disable the
prettier/prettier
rule (and also consider removingeslint-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.