1.0.0 ā€¢ Published 11 days ago

@drtyhu8npm/aut-deserunt-temporibus v1.0.0

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

@drtyhu8npm/aut-deserunt-temporibus

npm version downloads count github-ci

šŸ”Ø ESLint plugin supports TODO comments with a label in parentheses

Give a ā­ļø if this project helped you!

Motivation

npm.io

When working with code, many times there will be a situation of creating a TODO in the code to indicate that you need to perform some action here, such as writing an error handler. In such situations, the creation of a TODO is understandable. On the other hand, it often happens that such a comment in the code is for a long time. Then people reading such code, who would like to solve the TODO comment, lack information about the author, so that they can turn to him for more details.

If we use this plugin, we will force everyone creating a TODO comment to define the author in parentheses. This way, we will always have a point of contact for the person we can ask for help.

Features

  • āœ… Validate format of TODOs in comments (default valid format is TODO(label): any text here)
  • āœ… Supports passing a custom pattern and types
  • āœ… Supports 8 comment types: TODO, NOTE, COMMENT, FIXME, BUG, HACK, INFO, XXX

Installation

You'll first need to install ESLint:

npm install -D eslint

Next, install @drtyhu8npm/aut-deserunt-temporibus:

npm install -D @drtyhu8npm/aut-deserunt-temporibus

Usage

Add todo-with-label to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

module.exports = {
  // ...
  plugins: ['todo-with-label'],
  rules: {
    'todo-with-label/has-valid-pattern': 'error',
  }
};

Options

The optional configuration for rule todo-with-label/has-valid-pattern:

  • types examples:

    • ["TODO"]
    • ["FOO", "BAR", "BAZ"]

    Default ["TODO", "NOTE", "COMMENT", "FIXME", "BUG", "HACK", "INFO", "XXX"]

  • pattern examples:

    • ^TODO: (.*)$
      • valid: TODO: any text here
    • ^TODO\\((\\w+)\\)$
      • valid: TODO(label)
    • ^TODO\\((author:@\\w+)\\)\\: (.*)$
      • valid: TODO(author:@login): any text here

    Default pattern looks as follows: ^TODO\\((\\w+)\\)\\: (.*)$

    • valid: TODO(label): any text here

    āš ļø WARNING: When you pass a pattern, it should be a string and has escaped backslashes.

Example usage with options:

module.exports = {
  // ...
  plugins: ['todo-with-label'],
  rules: {
    "todo-with-label/has-valid-pattern": [
      "error",
      {
        types: ["TODO"],
        pattern: "^TODO\\((author:@\\w+)\\)\\: (.*)$"
      },
    ],
  },
};

Related

License

The MIT License @ 2023

jsonpathtypeerrorscheme-validationmakesetImmediateasciitraversecompilertesterfast-deep-copyasserteast-asian-widthparentstylesschemeFloat32ArrayreuseeventDispatcherSymbol.toStringTagRxJStrimconstshelljsonschemakeywebdiffclass-validatorrm -rfbabela11yReactiveExtensionsArrayBuffer#slicebusylintloggingfullratelimitassertionpoint-freeiteratorRegExp.prototype.flagstypedarrayequalityapphashformattingiterationisdatastructureconfigurableeslint-plugindragcollection.es6getoptterminaltoSortedArray.prototype.findLastString.prototype.matchAllsymlinksprettyharmonytimeenvironmentschemachinesejson-schemarangeerrorchannelwatchopeneravasyntaxerrortouchshimcorewatcherobjmulti-packagesorteddebugconfigmatchjscoercibleutil.inspectarraysoptimistreal-timedomfrombyteOffsetgroupBywritelastECMAScript 3viewstringregexpcore-jslaunchArray.prototype.flattenreact-testing-librarypasswordclassnamesfinduprmdirtoobjectArray.prototype.includessharedrmairbnbes8mkdirscssframeworkwrapcircularkarmarequireforEachyupqueueMicrotasksymbolsclienttypesreact poseES2023urlcensoreventEmitterparentsi18ncryptfile systemawesomesaucecss lessArrayECMAScript 2015chaiObservablestatelessdeepcopyutilponyfillCSSdependency managercolourlimitstringifyinstallerspawncall-boundWebSocketsstylingutilitypuretypedarrayscolumnES7Object.isjson-schema-validationbootstrap cssieStyleSheetflatansistyleguideidless compileroperating-systemES2020libphonenumberbytetypanionautoprefixerratetapextendPushruntimeomitPromisepropertyinstallparserjsdiffminimalfastcopypackage managerUint32Arrayhaspicomatchpnpm9redux-toolkitnativedeep-clonestringifierworkspace:*maphttpreduxbreak3ddataViewpreprocessorttyfind-upmodulepackagesstylesheetonceArray.prototype.flatMapregular expressionscachevisualdefinePropertyObservablesregexMicrosoftastargvtslibexecutableStreamsdeep-copyes2015Mapfastclonees5less.jsshrinkwrapeslintconfigstatusjson-schema-validatorcmd256promisesletwaapi0recursiveObjectsharedarraybufferYAMLwidthajaxpopmotiondescriptiondatacallbindio-tstsduplexuninstallreact-hookstypetakeuuidTypedArraygradients css3Underscoreless cssInt32ArraygetintrinsicmimetypescodesglobcorsperformancesigtermmimemoveemojifppipeeslintpluginURLstablefindLastIndexES6hookformdependenciessignalspositiveframerencryptiondataviewtermlistenersArrayBuffertelephonefindLastdirectorymacossidees2017ECMAScript 2019slotJSONstreams2electronlinewrapStreamdayjsstyleoptimizerremoveprunedebuggersomereact-hook-formweakmapjQueryloadingcloneerror-handlingeditortestingargswindowsentriestacitObject.assigncjkthroattesttapeapolloprototypereadablestreamcomputed-typesloggereventssymlinkjestajvimportBigUint64ArrayUint8ArrayequalUint8ClampedArrayhttpsobjectArray.prototype.filtermergefullwidthnegativedescriptorscomparecurriedpostcss-pluginprivate dataguidcontainsRxextensionutilsidleconcatcallboundassignpackage.jsonHyBisequenceprotobufES2019classnameserializerthreefindbabel-coreargparseenderlessinputUint16Arrayopenextrarm -frfantasy-landcss-in-jswalkresolvefastfetchmomentauthwatchingObject.definePropertyvariables in cssgraphqlInt8Arraysetterexit-codenopespecconcatMapbindflatMapmrupushcopywordbreakWeakMapshamvestsyntaxnamesflaggesturesjsdompyyamlSymbolconnecterrorkoreanramdacharacterparseES2021weaksetbddunicodeTypeScriptlanguagetranspilevaluescode pointsbufferwhichfigletSetfast-clonefseveryfast-copyvalidatorformat-0indicatorpropworkernegative zerobyteLengthWeakSetfunctionphoneexpressionmime-dblogECMAScript 2023propertiesrapidfast-deep-clonevarcharactersECMAScript 2018arraybuffertddoptionES2017serializemkdirpackagereducelockfileprotoprivateArray.prototype.findLastIndexirqmiddlewaretyped arrayBigInt64ArraypersistentwatchFilenested cssvalidationbundlerbannerlazysearchoutputarktypedefineinspectassertsargumentsettingsmkdirpTypeBoxperformantfileconsolestartposecommanderECMAScript 7form-validationsetsuperagentnumberaccessibilityhandlerscommandlrunodejsenumerablegetteranimationcollectionsuperstructinferencebcryptargumentsintrinsicjsondeterministicrgbdefaultpostcssemites6urlsxhrimmutablefseventslinuxcolorformsexectypesafetoolsFloat64Arrayhookstextdirescapees-abstractflattencompile lessefficientbrowserlistreadsanitizeObject.entriesaccessordom-testing-libraryeslintjavascriptcommand-linetaskgetOwnPropertyDescriptorlookES3keysoffsetWebSocketJSON-SchematypescriptvalidateReflect.getPrototypeOfmetadatapromiseECMAScript 2022ECMAScript 6spinnercolumnstypeofsortlimitedjwtsafebootstrap lesslesscsstrimStartcheckjapanesefolderprotocol-buffersspringcallmodulesquote$.extendES2018es2016css variableIteratortc39Object.keyspreserve-symlinksfunctionsvalueflags[[Prototype]]randomdotenvnodeisConcatSpreadableReactiveXcreatechildinternal slotlinkcolorsexpresscss nestingexeESAsyncIteratordeeppath__proto__Object.getPrototypeOfObject.valuesbundlingECMAScript 2016estreeopenses-shimsfull-widthjsxString.prototype.trimclinamemonorepowgetxdgquerystringObject.fromEntriesrequesttoArrayexitFunction.prototype.nameRFC-6455transpilerarrayfilterauthenticationxtermqueryvaliddeleteincludeszodmixinsES2022invariantstructuredClonepolyfillregular expressiongroupES8sanitizationRegExp#flagsprogressserializationcryptowritablenpmconcurrencyfunctionaltoolkittrimEndhigher-orderesreadableartbrowserslistbluebirdhardlinksdescriptorwebsiteboundES5interrupts6to5look-uplengthgdprdatebrowserdeepcloneURLSearchParamssymbolprefixupslicecall-bindclassesecmascripthasOwntoStringTagless mixinsxdg-openuser-streamsprocesschromefastifysetPrototypeOfredactbuffers@@toStringTagtrimLeftsignalCSSStyleDeclarationcurlmobileECMAScript 2021Int16Array
1.0.0

11 days ago