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.

quote-props Rule highlights false positives

See original GitHub issue

Tell us about your environment

  • ESLint Version: v4.19.1
  • Node Version: v8.11.1
  • npm Version: 6.1.0

What parser (default, Babel-ESLint, etc.) are you using? Babel-ESLint

Please show your full configuration:

Configuration
{
  "parser": "babel-eslint",
  "extends": "airbnb",
  "plugins": [
    "ava",
    "no-inferred-method-name",
    "no-only-tests",
    "xss"
  ],
  "env": {
    "es6": true,
    "browser": true,
    "mocha": true
  },
  "globals": {
    "sinon": false,
    "mocha": true,
    "expect": true
  },
  # Custom Disabled Rules
  rules: {
    camelcase: 0,
    max-len: 0,
    no-param-reassign: 0,
    no-unused-vars: ["error", { "varsIgnorePattern": "^_", "argsIgnorePattern": "^_", "caughtErrors": "none" }],
    no-plusplus: 0, # Meaningless as other rules prevent the errors that could happen.
    # no-restricted-syntax: 0,
    no-alert: 0,
    no-console: 0,
    "react/react-in-jsx-scope": 0,
    "react/prop-types": 0,
    "react/no-unknown-property": 0,
    "jsx-a11y/anchor-is-valid": 0,
    "object-curly-newline": 0,
    "react/jsx-one-expression-per-line": 0,
    "operator-linebreak": 0
  }
}

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

// Works everywhere
const a = {
  '\u309b': { image: '' }, // eslint-disable-line quote-props
  '\u309c': { image: '' }, // eslint-disable-line quote-props
};

// Works in Chrome, Firefox, errors on Safari when fixed with ESLint.
const b = {
  ゛: { image: '' },
  ゜: { image: '' },
};
Ran from Atom Linter Plugin

What did you expect to happen? To report items that can exist without quotes and fix them.

What actually happened? Please include the actual, raw output from ESLint. The removed quotes throw an error in Safari. I believe it is related to the configuration as the demo does not do this, but the available options can cause this to fail:

"quote-props": ['error', 'as-needed', { keywords: false, unnecessary: true, numbers: false }],

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
platinumazurecommented, Jun 28, 2018

@ljharb It seems like maybe we could consider an enhancement here (i.e., a new option for whether or not to force quoting on Other_ID_Start, similar to what we have for numbers). I’m disinclined to think this is a bug, based on @not-an-aardvark’s reasoning.

Would you mind opening a new issue to request an enhancement? Thanks!

0reactions
ljharbcommented, Dec 11, 2018

This is still a bug, and it’d be great to reopen it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

eslint - UNPKG
2535, * f9b70b3 Docs: Enable example highlighting in rules examples (ref #6444) ... 3389, * 689cb7d Fix: `quote-props` false positive on certain keys...
Read more >
Options - Prettier
In code styleguides, maximum line length rules are often set to 100 or 120. ... If this option is set to preserve ,...
Read more >
ESLint v2.5.0 released - 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 >
demo-outil-edition - node_modules - eslint - CHANGELOG.md
39dfe08 Update: false positives in function-call-argument-newline (fixes ... fc78e78 Chore: Enable quote-props rule in eslint-config-eslint ...
Read more >
Code Issues - Embold Help Center
We have discovered some checks and rules for C#. Following section briefs, about the ... If that is the case, the reported instance...
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