coffeelint-prefer-double-quotes
A custom coffeelint rule to prefer double quotes
Last updated 5 years ago by thoughtless .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install coffeelint-prefer-double-quotes 
SYNC missed versions from official npm registry.

coffeelint-prefer-double-quotes

==================================

Influenced by https://github.com/parakeety/coffeelint-prefer-english-operator. and https://github.com/clutchski/coffeelint/blob/5d818a5a4b4310cc147614e54d972b23f47cad88/src/rules/no_unnecessary_double_quotes.coffee

coffeelint-prefer-double-quotes is a plugin of coffeelint. It insists that all strings use double quotes unless they:

  • are multi-line strings; or
  • include the " or # character in the string.
"hello" # yes
'hello" # no

"hello #{myVar}" # yes
'hello #{myVar}' # yes, but note that it prints out something different than the above line.

'He said, "Hello" to me' # yes
"He said, 'Hello' to me" # yes

How to Install

  1. add "coffeelint-prefer-double-quotes": "0.1.0" as devDependencies in package.json
  2. npm install

How to Use

In your coffeelint.json, add

{
  // other lint rules
  {
    "prefer_double_quotes": {
      "module": "coffeelint-prefer-double-quotes",
      "level": "error"
    }
  }
}

and run coffeelint.

Current Tags

  • 0.1.0                                ...           latest (5 years ago)

1 Versions

  • 0.1.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 2
Last Month 2
Dependencies (0)
None
Dev Dependencies (10)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |