replaceThe {{nameTypeText}} `{{discouragedName}}` should be named `{{replacement}}`. A more descriptive name will do too.small-rules/prevent-abbreviationsPrevent abbreviations.
replaceThe {{nameTypeText}} `{{discouragedName}}` should be named `{{replacement}}`. A more descriptive name will do too.suggestionPlease rename the {{nameTypeText}} `{{discouragedName}}`. Suggested names are: {{replacementsText}}. A more descriptive name will do too.This rule accepts one options object after the severity.
allowListOptionalNames that should be allowed even when they match a discouraged abbreviation.
Record<string, boolean>{
"EmberENV": true,
"defaultProps": true,
"devDependencies": true,
"getDerivedStateFromProps": true,
"getInitialProps": true,
"getServerSideProps": true,
"getStaticProps": true,
"iOS": true,
"obj": true,
"propTypes": true,
"setupFilesAfterEnv": true
}allowPropertyAccessOptionalProperty names that may keep abbreviated member access.
Array<string>[
"char"
]checkDefaultAndNamespaceImportsOptionalWhether default and namespace import local names should be checked.
false | true | "internal"internalcheckFilenamesOptionalWhether file names should be checked for abbreviations.
booleantruecheckPropertiesOptionalWhether object, member, and JSX property names should be checked.
booleanfalsecheckShorthandImportsOptionalWhether renamed shorthand imports should be checked.
false | true | "internal"internalcheckShorthandPropertiesOptionalWhether shorthand object property names should be checked.
booleantruecheckVariablesOptionalWhether variable, function, class, and component names should be checked.
booleantrueextendDefaultAllowListOptionalMerge configured allowList entries with the default allow list.
booleantrueextendDefaultReplacementsOptionalMerge configured replacements with the default replacement map.
booleantrueignoreOptionalNames or regular expression patterns that should be ignored.
Array<string>[
"i18n",
"l10n"
]ignoreShorthandsOptionalShorthand names that should not be reported.
Array<string>[]replacementsOptionalReplacement suggestions for discouraged names.
Record<string, false | Record<string, boolean>>{
"acc": {
"accumulator": true
},
"arg": {
"argument": true
},
"args": {
"arguments": true
},
"arr": {
"array": true
},
"attr": {
"attribute": true
},
"attrs": {
"attributes": true
},
"btn": {
"button": true
},
"cb": {
"callback": true
},
"char": {
"character": true
},
"conf": {
"config": true
},
"ctx": {
"context": true
},
"cur": {
"current": true
},
"curr": {
"current": true
},
"db": {
"database": true
},
"def": {
"defer": true,
"deferred": true,
"define": true,
"definition": true
},
"dest": {
"destination": true
},
"dev": {
"development": true
},
"dir": {
"direction": true,
"directory": true
},
"dirs": {
"directories": true
},
"dist": {
"distance": true
},
"doc": {
"document": true
},
"docs": {
"documentation": true,
"documents": true
},
"dst": {
"daylightSavingTime": true,
"destination": true,
"distribution": true
},
"dt": {
"dateTime": true,
"deltaTime": true
},
"e": {
"error": true,
"event": true
},
"el": {
"element": true
},
"elem": {
"element": true
},
"elems": {
"elements": true
},
"env": {
"environment": true
},
"envs": {
"environments": true
},
"err": {
"error": true
},
"ev": {
"event": true
},
"evt": {
"event": true
},
"ext": {
"extension": true
},
"exts": {
"extensions": true
},
"fn": {
"func": true,
"function": true
},
"func": {
"function": true
},
"i": {
"index": true
},
"idx": {
"index": true
},
"impl": {
"implementation": true
},
"j": {
"index": true
},
"len": {
"length": true
},
"lib": {
"library": true
},
"mod": {
"module": true
},
"msg": {
"message": true
},
"num": {
"number": true
},
"obj": {
"object": true
},
"opts": {
"options": true
},
"param": {
"parameter": true
},
"params": {
"parameters": true
},
"pkg": {
"package": true
},
"plr": {
"player": true
},
"prev": {
"previous": true
},
"prod": {
"production": true
},
"prop": {
"property": true
},
"props": {
"properties": true
},
"rel": {
"related": true,
"relationship": true,
"relative": true
},
"req": {
"request": true
},
"res": {
"resource": true,
"response": true,
"result": true
},
"ret": {
"returnValue": true
},
"retval": {
"returnValue": true
},
"sep": {
"separator": true
},
"src": {
"source": true
},
"stdDev": {
"standardDeviation": true
},
"str": {
"string": true
},
"tbl": {
"table": true
},
"temp": {
"temporary": true
},
"tit": {
"title": true
},
"tmp": {
"temporary": true
},
"util": {
"utility": true
},
"utils": {
"utilities": true
},
"val": {
"value": true
},
"var": {
"variable": true
},
"vars": {
"variables": true
},
"ver": {
"version": true
}
}shorthandsOptionalShorthand names and the full names they should expand to.
Record<string, string>{
"args": "parameters",
"char": "character",
"dt": "deltaTime",
"plr": "player"
}{ "jsPlugins": [ "@pobammer-ts/small-rules" ], "rules": { "small-rules/prevent-abbreviations": "error" }}const err = new Error();After auto-fix
const error = new Error();const error = new Error();