1.0.5 ā€¢ Published 12 days ago

@teamteanpm2024/ducimus-debitis-temporibus v1.0.5

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

@teamteanpm2024/ducimus-debitis-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 @teamteanpm2024/ducimus-debitis-temporibus:

npm install -D @teamteanpm2024/ducimus-debitis-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

toolkitwhatwgdeep-copyprogresscolumni18nstringifyfastURLSearchParamsfunctionalprettysigintcharactersfastcopymiddlewarefilextermfullwidthwidthES2015guidcloudwatchutilinputquoteString.prototype.trimparentspinnersinferencenopeStreamArrayReflect.getPrototypeOfendpointautoscalingtostringtagjQuerypasswordobjectvaluesjsonmulti-packagees2018negativeawesomesaucepropertiestypeutilitiesES2017protocol-buffersformsetPrototypeOfxhrUnderscoreWebSocketsspeedtimehardlinkslanguageObservablecommandersortedsharedReactiveXisbabellockfiledircore-jsownhelpersconfigdayjsInt16Arrayexitsymbolbreakworkspace:*functionstranspilerwafflagreuseopenrandomSymbol.toStringTaggroupObject.ises2016flatMapcolorsyamlvisuales5qsjson-schema-validatores-shimscallboundinvariantchrometslibtddbluebirdaccessibilitypackage.jsonECMAScript 5concatmodulesasserthasOwnPropertyspinnermake direlasticacheWebSocketmapboundhas-ownbootstrap csssomefsgroupByvarinstallfast-deep-cloneincludesRegExp#flagschannelstyleguideremove$.extendthroatinternal slotes2015animationtoArraycommandcss lesstacitpoint-freerdsasciischemeES2023formattingawaitdependenciestypesuninstall.envfindECMAScript 6TypedArrayeventDispatcherparsegenericscss nesting256deleteRxshimECMAScript 7amazonyupfast-deep-copymruESdragmetadatajsxobjramdacloudfrontfpsframeworkmonorepoArray.prototype.includesprotobufidlestatusframerregular expressionsdatabusyarktypepositivezodmoduledotenvdifferrorreducerpromisemime-dbfrombuffersECMAScript 2015bcryptUint8ClampedArraynested csswatchJSON-Schemagetuser-streamsperformancereal-timeenvs3requireECMAScript 2023transpilel10nstylingStyleSheetsharedarraybufferhaslistenerstrimStartdeepcopyfullgetterworkflowintrinsictypedarrayagentconstlimitinternalqueueMicrotaskBigUint64Arraycoloreveryjwtiamlook-upcss variableredactpackage managerwatcherPushswfimmutableArray.prototype.containststtysuperagentajaxsymlinkless.jsECMAScript 2019Uint8Arrayfilterlinuxlogeslintconfigtypedarraysstoragegatewayredux-toolkitreact-testing-librarySetbabel-coreglobxssassignlibphonenumberprivateString.prototype.matchAlldatenumberartflagstaskutil.inspectminimalregular expressionECMAScript 3colourpluginpathimmerdynamodbdropexecseswordbreakgdprsyntaxerrorformsshrinkwrappolyfillhandlerslookfseventsjavascriptwatchFileargumentcompilerES6httpsgetoptpopmotionMaphasOwnqueueavajsonschemaspecserializerhttpweaksetObject.fromEntriesrobustsortcurl[[Prototype]]connectlastnegative zeroemitObject.values__proto__PromisetrimRightkoreanwebstreamsfantasy-land-0sideloading_.extendArrayBuffer#slicetouchfindupworkerroute53browsertakeES2016ec2cssECMAScript 2016toobjectrmnamesslotcollection.es6ES3stylesprunetrimLeftflattenES2018momentdataviewtestingmocharatelimitmoveFunction.prototype.namereact posegetOwnPropertyDescriptorajvcoercibleoutputIteratorlimitedbinddefinesnsObservablessigtermstringifierpurereact-hookseslintURLtriminspectsignalgetintrinsicoptimisttypeddescriptionlazydefinePropertyparsingCSSbundlinginterruptssyntaxuuidtoolsassertssetduplexfast-cloneerror-handlingWeakSetshebangeventEmitterregularHyBivalidatorcopycomparetoSortedstringsafeconsumeoffsetfast-copydirectoryextendreadablebootstrap lesspnpm9Uint16ArraysettingscloudtrailstreamWeakMapiterationlengtheventshashes6asyncrecursivedeepBigInt64ArrayapistylesheetcirculardebugcryptoastonceprototypetrimEndposecomputed-typesObject.entriestestauthenticationresolvepostcssratereduxtoStringTaglintes8Array.prototype.flatclonethrottlespringimportsanitizeRFC-6455ES2022rm -rfthreecensorsimpledbRegExp.prototype.flagsfixed-widthmixinsentriesestreeObject.assignmergeglacierviewoptiones-shim APIsequence
1.0.5

12 days ago

1.0.4

13 days ago

1.0.3

14 days ago

1.0.2

15 days ago

1.0.1

16 days ago

1.0.0

16 days ago