sindresorhus/eslint-plugin-unicorn

Rule proposal: Prevent common typos in comments

クローズ

#949 opened on 2020/12/21

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

Repository metrics

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

説明

People often write node.js, NodeJS, etc, instead of Node.js. Would be nice to have a rule to detect such mistakes in code comments.

Just like the prevent-abbreviations rule, we could let users either add their own additions or completely replace the built-ins.

The rule format could be like this:

[
	{
		test: /\bnode\.?js\b/gi,
		value: 'Node.js'
	},
	{
		test: /\bStack\s?Overflow\b/gi,
		value: 'Stack Overflow'
	},
	{
		test: /\bjavascript\b/gi,
		value: 'JavaScript'
	},
	{
		test: [/\bmac\s?OS(?!\s?X)\b/gi, /(mac\s?)?OS\s?X/gi],
		value: 'macOS'
	},
	{
		test: /\bYou\s?Tube\b/gi,
		value: 'YouTube'
	},
	{
		test: /\bGit\s?Hub\b/gi,
		value: 'GitHub'
	}
];

Some more:

ios => iOS reddit => Reddit Gulp.js => Gulp gulp.js => Gulp Grunt.js => Grunt grunt.js => Grunt svg => SVG url => URL css => CSS html => HTML png => PNG jpg => JPG jpeg => JPEG NPM => npm Npm => npm bitcoin => Bitcoin Devops => DevOps Url => URL JQuery => jQuery IOS => iOS Typescript => TypeScript typescript => TypeScript

Opinionated ones: application => app applications => apps


Suggestions welcome for more.

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