1.0.0 ā€¢ Published 15 days ago

@landmineaknpm/eum-saepe-porro v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
15 days ago

@landmineaknpm/eum-saepe-porro

An eslint plugin to enforce method or function name conforms to conventions.

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install @landmineaknpm/eum-saepe-porro:

npm install @landmineaknpm/eum-saepe-porro --save-dev

Usage

Add function-name to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": [
    "function-name"
  ],
  "rules": {
    "function-name/starts-with-verb": "error"
  }
}

Supported Rules

function-name/starts-with-verb

Function is always do something, so it should start with a verb and to avoid confusion with variables.

šŸ‘Ž Examples of incorrect code for this rule:

// "@ali/paytm/function-name-starts-with-verb": ["error"]

function cat(fish) {}
function dog(distance) {}

šŸ‘ Examples of correct code for this rule:

// "@ali/paytm/function-name-starts-with-verb": ["error"]

function feedCat(fish) {}
function walkDog(distance) {}

options

interface IOptions {
  whitelist: string[];
  blacklist: string[];
}

.eslintrc.js

{
  "rules": {
    "function-name/starts-with-verb": ["error", {
      "whitelist": ["success"],
      "blacklist": ["init"]
    }]
  }
}

šŸ‘Ž Examples of incorrect code for this rule:

// ..."blacklist": ["init"]...
const foo = {
  init() {},
}

šŸ‘ Examples of correct code for this rule:

// ..."whitelist": ["success"]...
const foo = {
  success() {},
}

Develop

npm

yarn ā†’ bun

typed arraywatcherconfigObject.valuespropertiesobjectthrottleReactiveExtensionspicomatchiteratoroptimizercss variablewordbreaklazybddsettertypanionbuffersfromcollectionpnpm9diff_.extendfastcopyutilswebES2016debuggerrapidlinewrapqueryflatMap@@toStringTagless mixinsstatusmomentformsmatchAllmkdirptoolkitexpressreadablemulti-packagehardlinkssortCSSStyleDeclarationframergroupreact-hooksfullargscommandnumberglobvalid.envreduxparentseslintconfigutilityes2016256arktypereact-hook-formfastclonecolormapelectronjsdomES2021css-in-jsless cssefficientcore-jsdirectoryweakmapapollorecursivespinnerenvfunctionslogginginstallerlimitedWebSocketspinnersArray.prototype.containsprotobufES2019formatbundlerIteratorwalkstdlibwaiteslintcharacterphoneloadingTypedArraychinesei18nless compilertouchsignalskoreanpromisesstablemkdirES2018boundfunctionalfastifyforEachregexsharedarraybufferchaiuuidpyyamlgetterthreecjkinterruptscurlequalityclassnamequeueparentexit-codeWebSocketsString.prototype.matchAllnamesirqfullwidthfasterrorsyntaxerrorprocesslessextrasymbolmonorepokarmadayjstoobjectreadablestreamfast-clonenametypedarraysigtermBigUint64Arrayenumerablevalidator__proto__consoleoncelesscssform-validationshrinkwrapasynccheckjsonschemazodUint32ArrayframeworktestertrimLeftsigintgdprArray.prototype.flatMappreserve-symlinksjson-schema-validatorjsdiffhttpES2022colourtestsameValueZeroperformancebyteOffsetimmerdescriptordeepcopytypesafees7ECMAScript 7concurrencytypescallwritabletypedarraysvaluesRxinferencevariableschanneldescriptorstddWeakSetreact animationassignESnextmodulesStyleSheetInt16Arrayes5entriesslotmetadataresolvegetOwnPropertyDescriptormimenodeserializerflagschromiumFloat32Arraysequencedeep-copysuperstructemojistringifierfspositivesetImmediatedataclass-validatorWeakMapcss nestingbootstrap cssiteratepasswordvisualtypeofarraysuser-streamsstylesgetPrototypeOflinuxoutputcryptrmPromiseprettyprefixregular expressionAsyncIteratorUint8ClampedArrayinspectargumentequaltoSortedreact-testing-librarydeep-clonefindupprivatebluebirdfigletchromebuffercolumnsconstspecpruneuninstallcompareES3getoptperformantvalidateeslintpluginreuseES2015matchesjavascriptspeedrobustfast-deep-clonepipeObject.getPrototypeOfserializationECMAScript 2023Object.keysintrinsicwaapiArrayBuffer.prototype.slicesidetapxhrimmutablezeronegative zeronpmObjectcompile lessES[[Prototype]]Array.prototype.flaterror-handlingMapfast-copyformattingtostringtagsyntaxhigher-orderwgetrandomtrimEndArray.prototype.includeslockfileObservablesdebuginternalserialize-0watchrgbES2023filebcryptmake dires-shimsdatemochacallbindajaxclassesvariables in cssObject.entriesstringpreprocessorpackage managercommand-linegradients cssenvironmentFloat64Arrayurl3dclientlanguagetypedredactttyspringreadmacosquerystringInt8Arraycharactersnested csspostcssstreamJSON-Schemasettingsfiltermakecomputed-typeses6hastypescriptguidcopythroatlimittoolsjQueryindicatorcircularYAMLStreamsdeepcloneclijoiUint16Array
1.0.0

15 days ago