Delving into open source territory with Google: PR #3
Tags: webdev, javascript, programming, opensource
Published: 2023-11-10 19:49:49

## Project repo:
[blockly-samples](https://github.com/google/blockly-samples) by _Google Open Source_. 

## Project description:
[Blockly](https://developers.google.com/blockly) by _Google Open Source_ is a JavaScript library for building visual programming editor, which looks something like this,
>![blockly sample](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/prrqvx0ssmvxdyhvan7b.png)

The project I worked on is called [blockly-samples](https://github.com/google/blockly-samples) which is a supplementary project to the Blockly project. This project holds code for [Plugins](https://github.com/google/blockly-samples/tree/master/plugins) which are _self-contained pieces of code that add functionality to Blockly. Plugins can add fields, define themes, create renderers, and much more_, [Examples](https://github.com/google/blockly-samples/tree/master/examples) which are _self-contained sample projects demonstrating techniques on how to use Blockly's features and extend the Blockly library_ and [Codelabs](https://github.com/google/blockly-samples/tree/master/codelabs) which are _interactive tutorials demonstrating how to use and customize Blockly._

## Issue
[1979](https://github.com/google/blockly-samples/issues/1979)

## PR
[2060](https://github.com/google/blockly-samples/pull/2060)

## Code Fixes
This issue was about re-enabling an ESLint - JSDoc rule named `jsdoc/tag-lines` which deals with enforcing a recommended blank line rule preceding only the first tag (e.g., `@param`) in a JSDoc comment. I reenabled the rule `'jsdoc/tag-lines': ['error', 'any', {'startLines': 1}],` part of `eslint.config.js` file of the project. You can find more about this rule [here](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/tag-lines.md#readme).

### Breakdown of the rule:

* `'jsdoc/tag-lines'`: This is the name of the rule. The jsdoc/tag-lines rule enforces consistent newlines before and after jsdoc tags.

* `['error', 'any', {'startLines': 1}]`: This is the configuration for the rule.

   * `'error'`: This sets the level of the rule. When ESLint encounters a violation of this rule, it will produce an error message. Other possible values are 'warn' (produces a warning message) and 'off' (turns off the rule).

   * `'any'`: This is the first option for the rule. It means that the rule applies to any jsdoc tag.

   * `{'startLines': 1}`: This is the second option for the rule. It means that there should be 1 newline before the start of the jsdoc tag lines.

### An Example

Example of what the code changes look like after running the lint script,

#### Before:
>```javascript
>/**
>   * Parses XML based on the 'inputs' attribute (non-standard).
>   * @param xmlElement XML storage element.
>   */
>```

#### After: 
>```javascript
>/**
>   * Parses XML based on the 'inputs' attribute (non-standard).
>   *
>   * @param xmlElement XML storage element.
>   */
>```

And just like that, this PR was also handed in. Even though it was a small PR, I had to go through the [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc/tree/main?tab=readme-ov-file#eslint-plugin-jsdoc) documentation to understand the purpose of this dependency, aligning with my goals on measuring my progress from 0.2 to 0.3 release. Besides, other things I focused on in this release are covered in [first blog of this series](https://dev.to/sdthaker/delving-into-open-source-territory-with-google-pr-1-3gkk) within the section called _"Measuring progress from 0.2 release_".