Open sindresorhus opened 3 years ago
If you want more libs, then you have
React.js / react.js / reactjs => React
Vuejs / Vue / vue => Vue.js
eslint / ESlint / esLint / EsLint / eslint.js => ESLint
Social Media:
FaceBook / facebook (and even fb?) => Facebook
discord => Discord
twitch / twitchtv => Twitch
other:
http(s) => HTTP(S)
and maybe plenty of other things I did not think about
FaceBook / facebook (and even fb?) => Facebook
For example, in this case, we would just disallow any other casing, so the regex would just need to match facebook
case-insensitively and the rule would compare the matched string against the expected string case-sensitively.
This rule can be called autocorrect
and probably should use a third-party module/list, or else you might get a bunch of PRs on this repo just to extend the list.
@fregante The idea is to mainly target common name typos and stuff a dictionary would not catch. I don't really want a normal dictionary as it would be too annoying with too many false-positives.
Yeah I’m not talking about a full dictionary either: It’s exactly whatever you’re suggesting, except it’s in a separate module. That’s all.
@fregante I considered making it a separate package upfront, but I want to make it easy to iterate on the rule format and additions first. I think it's easier to extract it into a separate package later on.
@fisker Could I get your vote on this?
I'm not a native speaker, not care that much 😄
I guess we can have it.
This is now accepted.
People often write
node.js
,NodeJS
, etc, instead ofNode.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:
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.