Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-config-globeletjs

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-globeletjs

A basic ESLint configuration for GlobeletJS modules

  • 0.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-25%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-config-globeletjs

A basic ESLint configuration for GlobeletJS modules

tests

Installation

To use this configuration in your module, run:

npm install --save-dev eslint eslint-config-globeletjs

Then add the following in an .eslintrc.json in the project's root directory:

{
  "extends": "globeletjs"
}

Finally, add a linting script to your package.json file:

"scripts": {
  "lint": "eslint src examples/*/*.js",
  "pretest": "npm run lint"
}

Usage

To see which of your code is inconsistent with the GlobeletJS coding style, you can run

npm run lint

If you are brave, you can automatically fix errors in a given file as follows:

npx eslint --fix file.js

Why double quotes?

Many popular standards, including the AirBnB, Google, and Standard style guides, require single quotes for strings.

GlobeletJS uses double quotes, except where single quotes can help avoid the need to escape a double quote within the string. There are 2 main reasons for this:

  1. Many strings in the GlobeletJS codebase appear in JSON-like object syntax. For example, tile-stencil's defaults.js, and the index.js of this module, eslint-config-globeletjs. JSON uses double quotes.
  2. Another common use of strings is for error messages. These should look like the program is talking to the user. And double quotes for speech are, overall, what most people expect.

One reason given for single quotes is that it allows HTML strings to be written without escapes. (The values of HTML attributes are typically enclosed in double quotes.) We don't accept this argument, for two reasons:

  • In GlobeletJS code, we like to write HTML as HTML, and use JavaScript for Javascript. If there are long strings of HTML in our JavaScript, perhaps we should be re-considering the overall design of the module
  • Our rule does allow single quotes, if there are double quotes within the string that would otherwise need to be escaped

Keywords

FAQs

Package last updated on 07 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc