Skip to content

models: 3 legacy model files disagree with .editorconfig + codebase "use strict" convention #183

@CryptoJones

Description

@CryptoJones

Problem

app/models/apikey.model.js, apimaster.model.js, and
customer.model.js were the first three model files in the
codebase and pre-date the current style conventions. They differ
from the other 15 models in two cosmetic ways:

  1. 'use strict'; (single-quoted) vs the rest of the
    codebase's "use strict"; (double-quoted).
  2. Trailing whitespace on every field declaration. Disagrees
    with .editorconfig's trim_trailing_whitespace = true for
    *.js — the first contributor with an EditorConfig-aware
    editor opening one of these files for an unrelated change
    would see noisy whitespace diffs they didn't intend.

ESLint has no no-trailing-spaces rule configured (style debates
are kept out of CI), so the inconsistency doesn't trip lint — it
just lurks until a contributor's editor "fixes" it as a side
effect of something else.

Fix

Mechanically strip the trailing whitespace and switch the three
files to "use strict";. No behavior change. The Sequelize field
declarations stay verbatim (no allowNull / defaultValue
overrides added — those would be real behavior changes, and the
DDL in setup/TimeTracker.sql is authoritative for what the DB
physically enforces).

Acceptance

  • No trailing whitespace in any of the 3 files
  • All 3 use "use strict"; (double-quoted)
  • No allowNull / defaultValue additions
  • All 632 tests still pass

Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions