Skip to content

feat: install and run standardjs#47

Open
ArushKhare wants to merge 1 commit intomainfrom
standardjs
Open

feat: install and run standardjs#47
ArushKhare wants to merge 1 commit intomainfrom
standardjs

Conversation

@ArushKhare
Copy link
Copy Markdown

@ArushKhare ArushKhare commented Mar 13, 2026

To install standardjs

  1. run npm install standard --global
  2. run npm install standard --save-dev

Pros:

  • No need to configure anything, meaning developers can save time when setting it up (they only download it)
  • Automatically fixes and formats code with the command standard --fix, saving time for developers. Developers don't need to fix style issues manually
  • Helps developers catch style-related issues early on, allowing them to fix style issues and save time when sharing code

Cons:

  • Cannot be customized, meaning if a user does not like a certain rule, they must still follow it
  • Removes semicolons, which can cause issues for developers who are used to semicolons
Screenshot 2026-03-12 at 6 44 56 PM Screenshot 2026-03-12 at 8 11 44 PM

@ArushKhare
Copy link
Copy Markdown
Author

What is the name and high-level description of what the tool does? Provide a link to its documentation/source.

The name of the tool is StandardJS (https://standardjs.com/). It is a style linter and formatter. The tool analyzes JavaScript files for style issues and helps developers address them with one command.

Is the tool used for static or dynamic analysis?

This tool is used for static analysis.

What types of problems does this particular tool catch?

StandardJS catches issues related to code syntax, style, and logical issues. The tool tracks unused variables, undeclared variables, unsafe comparison operations, poor indentation, unnecessary semicolons, and more. For example, the tool ensures users use two spaces for tabs and avoid unnecessary semicolons. The tool enforces good code style for easy readability.

What types of customization are possible or necessary?

StandardJS does not allow for customization. This is intentional, so developers do not spend time deciding linter rules. However, the tool can be disabled on certain lines and files, and developers can register global variables to prevent it from flagging them as undeclared.

How can/should this tool be integrated into a development process?

StandardJS should be integrated using NPM. To enable all developers to access the tool, the developer should add the dependency to the package.json file. The tool can be configured and integrated at the local level so it automatically analyzes and formats code as you write it. Additionally, the developer should use npm scripts to call the tool regularly to ensure the code is formatted correctly.

Are there many false positives? False negatives? True positive reports about things you don't care about?

StandardJS causes many true positives that are not relevant to our project. For example, when we ran the tool, it provided hundreds of warnings regarding our use of tabs instead of 2 spaces for indentation. This issue is not important to us, making it quite overwhelming. This issue affects many teams because the lack of customization means the tool can highlight many irrelevant issues. Additionally, the tool is known for false negatives (primarily due to lack of typechecking), which can violate good style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant