sindresorhus/eslint-plugin-unicorn

Rule proposal: `prefer-https`

Chiusa

#971 aperta il 30 dic 2020

 (9 commenti) (6 reazioni) (1 assegnatario)JavaScript (468 fork)user submission
help wantednew rule

Metriche repository

Star
 (5022 stelle)
Metriche merge PR
 (Merge medio 1g 16h) (399 PR mergiate in 30 g)

Descrizione

Enforce using HTTPS URLs over HTTP.

Fail

const foo = 'http://sindresorhus.com';

// Hello: http://sindresorhus.com

Pass

const foo = 'https://sindresorhus.com';

// Hello: https://sindresorhus.com

Alternative name: prefer-https. Which one do people prefer?

I'm aware this could be partly solved with the string-content rule, but I don't think most people would think of this and it also wouldn't work in comments.

Guida contributor