Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: prefer single quotes if possible, raising warning #475

Merged
merged 1 commit into from
Mar 31, 2020
Merged

Conversation

bcoe
Copy link
Contributor

@bcoe bcoe commented Mar 31, 2020

Warn if single quotes are not used in a situation in which this is possible. see: https://eslint.org/docs/rules/quotes

This rule lets us catch the behavior discussed here, in which a template string is used with no replacements.

I've opted for a warning rather than an error, as in testing it seemed like this rule could be a bit disruptive for folks who write strings like this:

"hello 'world'"

as it requires the replacement:

'hello "world"'

fixes: googleapis/google-cloud-node#2915

@codecov-io
Copy link

Codecov Report

Merging #475 into master will not change coverage by %.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #475   +/-   ##
=======================================
  Coverage   96.33%   96.33%           
=======================================
  Files           6        6           
  Lines        1118     1118           
  Branches      153      153           
=======================================
  Hits         1077     1077           
  Misses         41       41           
Impacted Files Coverage Δ
src/clean.ts 100.00% <100.00%> (ø)
src/init.ts 88.07% <100.00%> (ø)
test/test-init.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f9b20a6...3f7db35. Read the comment docs.

@bcoe bcoe merged commit 39a2705 into master Mar 31, 2020
@bcoe bcoe deleted the quotes branch March 31, 2020 02:40
@release-please release-please bot mentioned this pull request Mar 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update eslint rules to prefer single quotes
5 participants