Implement auto-fixing for quote-props rule
See original GitHub issueI tried, and it works fine in my project. If you think it is OK, I will complete it and pull request.
Edit:
I hope that quote-props rule could be fixable. For example:
/*eslint quote-props: [2, "always"]*/
var object = {
foo: "bar",
baz: 42,
"qux-lorem": true
};
Then, I run eslint --fix path/to/file.js
. The source code will be:
/*eslint quote-props: [2, "always"]*/
var object = {
"foo": "bar",
"baz": 42,
"qux-lorem": true
};
But quote-props is not fixable now. I tried to modify eslint, and the modified version works fine in my project. If you think this proposal is OK, I will complete it(support as-needed
consistent
and add unit tests etc…) and pull request.
Issue Analytics
- State:
- Created 8 years ago
- Comments:21 (12 by maintainers)
Top Results From Across the Web
Autofixing quote-props should take into account ...
If I want to add the property c-mgmt , I need to use quotes (otherwise it's not valid JavaScript):. var clusterCache = {...
Read more >Rules - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >"quote-props": "consistent" in .eslintrc in Atom
ESLINT An error occurred while generating your JavaScript config file. How to fix? ... How to disable autofix for specific rules in eslint...
Read more >Eslint-plugin-autofix
Name 🛠 Description
array‑bracket‑spacing 🛠 enforce consistent spacing inside array brackets
array‑element‑newline 🛠 enforce line breaks after each array element
arrow‑body‑style 🛠 require braces around arrow...
Read more >Options
Quote Props · "as-needed" - Only add quotes around object properties where required. · "consistent" - If at least one property in an...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I will create a PR this weekend 😃
@eslint/eslint-team Since now we do multiple runs, I think can do this now since we can start putting
"
andquotes
auto-fix will correct it on the next run. thoughts?