zotero / eslint-config-zotero

ESLint shareable config for Zotero projects
3 stars 6 forks source link

camelcase also covers object properties #2

Closed retorquere closed 5 years ago

retorquere commented 5 years ago

the camelcase rule by default also covers object properties, so things like

var FORMAT_GUIDS = {
  rdf_zotero: "5e3ad958-ac79-463d-812b-a86a9235c28f",
  rdf_bibliontology: "14763d25-8ba0-45df-8f52-b8d1108e7ac9",
  mods: "0e2235e7-babf-413c-9acf-f27cce5f059c",
  marc: "a6ee60df-1ddc-4aae-bb25-45e0537be973",
  unimarc: "a6ee60df-1ddc-4aae-bb25-45e0537be973",
  marcxml: "edd87d07-9194-42f8-b2ad-997c4c7deefd",
  ris: "32d59d2d-b65a-4da4-b0a3-bdd3cfb979e7",
  refer: "881f60f2-0802-411a-9228-ce5f47b64c7d",
  bibtex: "9cb70025-a888-4a29-a210-93ec52da40d4",
  rdf_dc: "5e3ad958-ac79-463d-812b-a86a9235c28f"
};

gets complaints about rdf_zotero. I'd propose changing the rule from

"camelcase": "error",

to

"camelcase": ["error", {properties: "never"}]
dstillman commented 5 years ago

properties includes things like Zotero.Foo.barFoo = function …, which we want enforced. The rule should just be disabled for the above lines, as it is in translation-server (though in the translator they could be line comments).