DEV Community

Cover image for Delving into open source territory with Google: PR #3
Soham Thaker
Soham Thaker

Posted on • Updated on

Delving into open source territory with Google: PR #3

Project repo:

blockly-samples by Google Open Source.

Project description:

Blockly by Google Open Source is a JavaScript library for building visual programming editor, which looks something like this,

blockly sample

The project I worked on is called blockly-samples which is a supplementary project to the Blockly project. This project holds code for 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 which are self-contained sample projects demonstrating techniques on how to use Blockly's features and extend the Blockly library and Codelabs which are interactive tutorials demonstrating how to use and customize Blockly.

Issue

1979

PR

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.

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:

/**
  * Parses XML based on the 'inputs' attribute (non-standard).
  * @param xmlElement XML storage element.
  */

After:

/**
  * 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 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 within the section called "Measuring progress from 0.2 release".

Top comments (0)