sindresorhus/eslint-plugin-unicorn

Rule proposal: `prefer-https`

クローズ

#971 opened on 2020/12/30

 (9 件のコメント) (6 件のリアクション) (1 人の担当者)JavaScript (468 件のフォーク)user submission
help wantednew rule

Repository metrics

Stars
 (5,022 個のスター)
PR merge metrics
 (平均マージ 4h 30m) (30d で 26 merged PRs)

説明

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.

コントリビューターガイド