Skip to content

Commit 8e0c192

Browse files
J8k3claude
andcommitted
Fix lint: brace-style, comma-spacing, key-spacing, JSDoc, operator-linebreak
11 ESLint errors across 6 files introduced in the ARQC/ARPC/TLV/Script ops. Also document the constructor-JSDoc and operator-linebreak rules in AGENTS.md to prevent recurrence. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 32622a0 commit 8e0c192

8 files changed

Lines changed: 17 additions & 8 deletions

File tree

AGENTS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ This check is for internal development and validation only. APC must never appea
5252
## ESLint
5353

5454
- Continuation lines inside `args: [` must be aligned to **23 spaces**
55-
- All module-level functions require JSDoc (`jsdoc/require-jsdoc`)
55+
- All module-level functions require JSDoc (`jsdoc/require-jsdoc`). Constructors must have their own JSDoc — either `/** @inheritdoc */` or a named comment block. The class-level JSDoc does not satisfy this.
5656
- No unused imports
5757
- No inline single-line blocks: `try { x; } catch` or `if (x) { y; }` — statement and closing brace must each be on their own line (`brace-style` rule)
58+
- Ternary `?` and `:` must be at the **end** of the line, not the start (`operator-linebreak` rule). Write `condition ?\n a :\n b` not `condition\n ? a\n : b`.
5859

5960
## Payment Operation Maintenance
6061

src/core/lib/EmvTlv.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ function parseTlvSequence(bytes, start, end, depth) {
113113
let offset = start;
114114
while (offset < end) {
115115
// Skip 0x00 padding bytes (common in EMV records)
116-
if (bytes[offset] === 0x00) { offset++; continue; }
116+
if (bytes[offset] === 0x00) {
117+
offset++;
118+
continue;
119+
}
117120

118121
const tlv = readTlv(bytes, offset);
119122
offset = tlv.nextOffset;

src/core/lib/EmvTlvDictionary.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const EMV_TAG_DICTIONARY = {
3232
// ── File Control Information ───────────────────────────────────────────────
3333
"6F": { name: "File Control Information (FCI) Template", constructed: true, source: "ICC", format: "b", class: "Application" },
3434
"A5": { name: "FCI Proprietary Template", constructed: true, source: "ICC", format: "b", class: "Context-Specific" },
35-
"BF0C":{ name: "FCI Issuer Discretionary Data", constructed: true, source: "ICC", format: "b", class: "Private" },
35+
"BF0C": { name: "FCI Issuer Discretionary Data", constructed: true, source: "ICC", format: "b", class: "Private" },
3636

3737
// ── Record / Response Templates ────────────────────────────────────────────
3838
"70": { name: "Record Template", constructed: true, source: "ICC", format: "b", class: "Application" },
@@ -51,7 +51,7 @@ const EMV_TAG_DICTIONARY = {
5151
"9F06": { name: "Application Identifier (AID) — Terminal", constructed: false, source: "T", format: "b", class: "Application" },
5252
"9F11": { name: "Issuer Code Table Index", constructed: false, source: "ICC", format: "n", class: "Application" },
5353
"9F12": { name: "Application Preferred Name", constructed: false, source: "ICC", format: "ans", class: "Application" },
54-
"9F38": { name: "Processing Options Data Object List (PDOL)",constructed: false, source: "ICC", format: "b", class: "Application" },
54+
"9F38": { name: "Processing Options Data Object List (PDOL)", constructed: false, source: "ICC", format: "b", class: "Application" },
5555
"9F4D": { name: "Log Entry", constructed: false, source: "ICC", format: "b", class: "Application" },
5656

5757
// ── Card / Cardholder Data ─────────────────────────────────────────────────
@@ -144,7 +144,7 @@ const EMV_TAG_DICTIONARY = {
144144
"90": { name: "Issuer Public Key Certificate", constructed: false, source: "ICC", format: "b", class: "Context-Specific" },
145145
"92": { name: "Issuer Public Key Remainder", constructed: false, source: "ICC", format: "b", class: "Context-Specific" },
146146
"93": { name: "Signed Static Application Data", constructed: false, source: "ICC", format: "b", class: "Context-Specific" },
147-
"9F2D": { name: "ICC PIN Encipherment Public Key Certificate",constructed: false, source: "ICC", format: "b", class: "Application" },
147+
"9F2D": { name: "ICC PIN Encipherment Public Key Certificate", constructed: false, source: "ICC", format: "b", class: "Application" },
148148
"9F2E": { name: "ICC PIN Encipherment Public Key Exponent", constructed: false, source: "ICC", format: "b", class: "Application" },
149149
"9F2F": { name: "ICC PIN Encipherment Public Key Remainder", constructed: false, source: "ICC", format: "b", class: "Application" },
150150
"9F32": { name: "Issuer Public Key Exponent", constructed: false, source: "ICC", format: "b", class: "Application" },

src/core/operations/BuildEMVARPCData.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
*/
1616
class BuildEMVARPCData extends Operation {
1717

18+
/** @inheritdoc */
1819
constructor() {
1920
super();
2021

@@ -90,9 +91,9 @@ class BuildEMVARPCData extends Operation {
9091
run(input, args) {
9192
const [method, arqc, arc, csu, pad, fmt] = args;
9293

93-
const { fields, hex } = method === METHOD2
94-
? buildMethod2(arqc, csu, pad)
95-
: buildMethod1(arqc, arc);
94+
const { fields, hex } = method === METHOD2 ?
95+
buildMethod2(arqc, csu, pad) :
96+
buildMethod1(arqc, arc);
9697

9798
if (fmt === "JSON") return formatJson(fields, method);
9899
if (fmt === "Annotated") return formatAnnotated(fields, method);

src/core/operations/BuildEMVARQCData.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { buildCdol1, formatHex, formatJson, formatAnnotatedTlv } from "../lib/Em
1111
*/
1212
class BuildEMVARQCData extends Operation {
1313

14+
/** @inheritdoc */
1415
constructor() {
1516
super();
1617

src/core/operations/ParseEMVARPCData.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
*/
1616
class ParseEMVARPCData extends Operation {
1717

18+
/** @inheritdoc */
1819
constructor() {
1920
super();
2021

src/core/operations/ParseEMVARQCData.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { parseCdol1, formatJson, formatAnnotatedTlv } from "../lib/EmvCdol.mjs";
1111
*/
1212
class ParseEMVARQCData extends Operation {
1313

14+
/** @inheritdoc */
1415
constructor() {
1516
super();
1617

src/core/operations/ParseEMVTLV.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { parseEmvTlv, EMV_TAG_DICTIONARY } from "../lib/EmvTlv.mjs";
1111
*/
1212
class ParseEMVTLV extends Operation {
1313

14+
/** @inheritdoc */
1415
constructor() {
1516
super();
1617

0 commit comments

Comments
 (0)