ax-vasquez / mcnuggies-blog

NextJS site & Sanity Studio code for mcnuggies.dev
http://www.mcnuggies.dev
1 stars 1 forks source link

[DEVOP] Setup linting rules #18

Open ax-vasquez opened 3 years ago

ax-vasquez commented 3 years ago

Description

Right now, the linting solution is pretty much just drag-and-dropped from older project setups that I've used, but never really fully configured. Such is the curse of being ADHD and randomly hopping from project to project.

With that said, this one seems like one I want to stick with; after dusting it off, it worked exactly as the docs said it should. This is not a matter of me "patting myself on the back", but simply noting that I clearly gave enough of a shit to make sure the docs were good :+1: :heart:

This task should track a solid starting point for the linting rules. We should do things like:

  1. Add EOF to files that don't already have them
  2. Decide upon, and set a formatting standard (so no one has to worry about matching conventions - let husky do it on commit)
  3. Much more (add to the list as you recall things)

To do

  1. [x] Add EOF lines to files that don't have them
  2. [x] Format files
  3. [x] Setup/refine husky
  4. [x] Prevent unused...
    1. [x] Imports
    2. [x] Classes
    3. [x] Fields
    4. [ ] Allow exception for variables/classes/fields prefixed with _
  5. [x] Explicit type declarations (e.g., only allow any type when explicitly-stated - in all other cases, an undeclared type should lead to a linting error)
ax-vasquez commented 3 years ago

Most, if not all, of this was handled in #21