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.

Implement auto-fixing for quote-props rule

See original GitHub issue

I 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:closed
  • Created 8 years ago
  • Comments:21 (12 by maintainers)

github_iconTop GitHub Comments

5reactions
benjycuicommented, Jul 25, 2016

I will create a PR this weekend 😃

4reactions
gyandeepscommented, May 24, 2016

@eslint/eslint-team Since now we do multiple runs, I think can do this now since we can start putting " and quotes auto-fix will correct it on the next run. thoughts?

Read more comments on GitHub >

github_iconTop 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 >

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