Skip to content

Introduce linting to the project #303

@jkantr

Description

@jkantr

@bitinn, @TimothyGu

Mostly in an effort to stop myself from committing things missing semi's (I work on a lot of no semi projects, heh) I think it might be advantageous to set up linting.

There are already a bunch of different styles being used throughout the code but this is mostly auto-fixable using modern tooling. My suggestion:

  • add eslint dev dep
  • add eslint-config-airbnb-base preset dev dep
  • add .eslintrc for custom rule negotiation
  • add npm script to run linting

This would configure linting to the Airbnb style guide, which is very common (especially among front end packages), and can be read here: https://github.com/airbnb/javascript

Advantages:

  • Airbnb style rules have very specific reasonings to back them that are based around clarity and bug avoidance
  • Most of the style guidelines already fit well into the current project
  • We can easily turn off the rules that we don't need and can re-implement them one at a time til compliance.
  • Easier for new contributors to adopt a common style (with even simple things like tabs vs spaces, etc)
  • Increases general perceived code quality with more consistency

After we have all rules implemented/agreed on over some time, we could then also:

  • have the linting npm script autofix
  • implement a git hook or CI step and reject on unlintable styles.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions