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.

[Change request]Recognition JSON codes which is embedded in JavaScript code.

See original GitHub issue
  • ESLint Version:3.17.1
  • Node Version:7.7.1
  • npm Version:4.1.2

default and airbnb-base

My full configuration:

{
  "env": {
    "node": true,
    "es6": true
  },
  "extends": [
    "airbnb-base"
  ],
  "globals": {
    "STATICCONFIG": true
  },
  "rules": {
    "no-console": "off",
    "no-param-reassign": [
      "error",
      {
        "props": false
      }
    ],
    "func-names": [
      "warn",
      "never"
    ],
    "quote-props": [
      "error",
      "always"
    ]
  }
}

For quotes, I prefer this style:

const v1 = 'Use single quotes as default in JavaScript codes.';
const v2 = {
  "Use double quotes as default in JSON code" : "even though they are embedded in JavaScript codes."
};

I apologize; if there is already a way to make this; or I made mistakes in my description.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ilyavolodincommented, Mar 8, 2017

@libook I’m not sure if it’s weird, I don’t think it’s unreasonable, but I also think that this is an edge-case style that is not a “must have” for core rule. I think this is perfectly reasonable rule to create a plugin for, though. The bar for adding things into the core is pretty high, as we already have a very large number of rules and options, and I don’t think this style meets that high bar. But let’s see what others think.

0reactions
libookcommented, Mar 8, 2017

Thank you all. By the way; please tell me, if there is already plugins can do this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Work with JSON in JavaScript - DigitalOcean
This tutorial provides an introduction to working with JSON in JavaScript. Some general use cases of JSON include: storing data, ...
Read more >
Working with JSON - Learn web development | MDN
In this article, we've given you a simple guide to using JSON in your programs, including how to create and parse JSON, and...
Read more >
JSON editing in Visual Studio Code
Editing JSON with Visual Studio Code. JSON is a data format that is common in configuration files like package.json or project.json .
Read more >
Load local JSON file into variable - Stack Overflow
edit To avoid caching, here's the helper function from this blogpost ... example.json { "name": "testing" } // ES6/ES2015 // app.js import *...
Read more >
Using embedded JSON style declarations | Maps JavaScript API
You can apply customized styling through an embedded JSON style declarations to the following: Default map. Map types that a user can switch...
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