3.7.117 • Published 10 months ago

@diotoborg/assumenda-praesentium v3.7.117

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@diotoborg/assumenda-praesentium

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 @diotoborg/assumenda-praesentium:

npm install -D @diotoborg/assumenda-praesentium

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

fpfastfastclonebabelesregexvarenvironmentbyteOffsetqueueMicrotaskttygesturesbundlingjseslintconfiglocationstylejoiissuperstructHyBiJSONreact animationbyteLengthreal-timelintoptionerrorconsolemomenteventDispatcherpicomatchfile systemarraycssremovecallasyncsharedstringifieracornmobileES3estreeyupcheckfindLastconcatMapreacttypesInt32ArrayansivalidrestinidrequireviewfunctionssharedarraybufferUint16ArrayshellapphasOwnsinatramatchtypeRFC-6455namesvestprogressequalitycloudtrailstylinges2018ArrayBuffer#slicefilteruuidrandomie0postcsscommand-linejsonschemasuperagentbddes2017qscurlgetterESnextObject.fromEntriescoerciblebusyextraObservablePushhigher-ordersetImmediatepipeoptimistformatRegExp.prototype.flagsentriesECMAScript 2021poseindicatorcurriedfixed-widthdirectorycallbindcodeseveryES8class-validatorsource mapquerypostcss-plugin.gitignorelettoolkitspringpopmotionbrowserlistcontainsform-validationdescription@@toStringTagECMAScript 7valuesInt16Arrayfindupaccessorignoreawsdebuggertypeofreact-testing-librarynpmignoreprotoES2017nodetypeerrorpropertiesWeakSetURLSearchParamsregular-expressioncommanderassertionfromemrrecursiveajvimmutablehttpsrestfulasteriskstypescriptgroupes7dropfast-copyeast-asian-widthgetPrototypeOfhtmlWebSockets__proto__xhrglobalsrfc4122UnderscoretrimLeftpackageFunction.prototype.namearraysenumerablebindpackage managerlistenersajaxES6colourvariablesmonoreponopeanimationjshintjson-schemamkdirlookroutingfunctionalArray.prototype.flattensesprototypecommandhardlinkscharactershashistanbuljavascriptproxyastobjprotobufString.prototype.trimsnsvisualtypedarrayinstrumentationcolorsavaconfigurableUint8ArraylocalloadbalancingECMAScript 2018storagegatewaypureECMAScript 6WebSocketmakeescapeclonegraphql
3.7.116

10 months ago

3.7.117

10 months ago

3.7.114

10 months ago

3.7.115

10 months ago

3.7.113

10 months ago

3.7.112

10 months ago

3.7.111

10 months ago

3.7.110

10 months ago

3.7.109

10 months ago

3.7.108

10 months ago

3.7.107

10 months ago

3.7.106

10 months ago

3.7.105

10 months ago

3.7.104

10 months ago

3.7.103

10 months ago

3.7.102

10 months ago

3.7.101

10 months ago

3.7.100

11 months ago

3.7.99

11 months ago

3.7.98

11 months ago

3.7.97

11 months ago

3.7.96

11 months ago

3.7.95

11 months ago

3.7.94

11 months ago

3.7.93

11 months ago

3.7.92

11 months ago

3.7.91

11 months ago

3.7.90

11 months ago

3.6.90

11 months ago

3.6.89

11 months ago

3.6.88

11 months ago

3.6.87

11 months ago

3.6.86

11 months ago

3.6.85

11 months ago

3.6.84

11 months ago

3.6.83

11 months ago

3.6.82

11 months ago

3.6.81

11 months ago

3.6.80

11 months ago

3.6.79

11 months ago

3.6.78

11 months ago

3.6.77

11 months ago

3.6.76

11 months ago

3.6.75

11 months ago

3.6.74

11 months ago

3.6.73

11 months ago

3.6.72

11 months ago

3.6.71

12 months ago

2.6.71

12 months ago

2.6.70

12 months ago

2.6.69

12 months ago

2.6.68

12 months ago

2.6.67

12 months ago

2.6.66

12 months ago

2.6.65

12 months ago

2.5.65

12 months ago

2.5.64

12 months ago

2.5.63

12 months ago

2.5.62

12 months ago

2.5.61

12 months ago

2.5.60

12 months ago

2.5.59

12 months ago

2.5.58

12 months ago

2.5.57

12 months ago

2.5.56

12 months ago

2.5.55

12 months ago

2.5.54

12 months ago

2.5.53

1 year ago

2.5.52

1 year ago

2.5.51

1 year ago

2.5.50

1 year ago

2.5.49

1 year ago

2.4.49

1 year ago

2.4.48

1 year ago

2.4.47

1 year ago

2.4.46

1 year ago

2.4.45

1 year ago

1.4.45

1 year ago

1.4.44

1 year ago

1.4.43

1 year ago

1.4.42

1 year ago

1.3.42

1 year ago

1.3.41

1 year ago

1.3.40

1 year ago

1.3.39

1 year ago

1.3.38

1 year ago

1.3.37

1 year ago

1.3.36

1 year ago

1.3.35

1 year ago

1.3.34

1 year ago

1.3.33

1 year ago

1.3.32

1 year ago

1.3.31

1 year ago

1.3.30

1 year ago

1.3.29

1 year ago

1.3.28

1 year ago

1.3.27

1 year ago

1.3.26

1 year ago

1.2.26

1 year ago

1.2.25

1 year ago

1.2.24

1 year ago

1.1.24

1 year ago

1.1.23

1 year ago

1.1.22

1 year ago

1.1.21

1 year ago

1.1.20

1 year ago

1.1.19

1 year ago

1.1.18

1 year ago

1.1.17

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago