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>
This commit is contained in:
parent
32622a01de
commit
8e0c192973
@ -52,9 +52,10 @@ This check is for internal development and validation only. APC must never appea
|
||||
## ESLint
|
||||
|
||||
- Continuation lines inside `args: [` must be aligned to **23 spaces**
|
||||
- All module-level functions require JSDoc (`jsdoc/require-jsdoc`)
|
||||
- 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.
|
||||
- No unused imports
|
||||
- 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)
|
||||
- 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`.
|
||||
|
||||
## Payment Operation Maintenance
|
||||
|
||||
|
||||
@ -113,7 +113,10 @@ function parseTlvSequence(bytes, start, end, depth) {
|
||||
let offset = start;
|
||||
while (offset < end) {
|
||||
// Skip 0x00 padding bytes (common in EMV records)
|
||||
if (bytes[offset] === 0x00) { offset++; continue; }
|
||||
if (bytes[offset] === 0x00) {
|
||||
offset++;
|
||||
continue;
|
||||
}
|
||||
|
||||
const tlv = readTlv(bytes, offset);
|
||||
offset = tlv.nextOffset;
|
||||
|
||||
@ -15,6 +15,7 @@ import {
|
||||
*/
|
||||
class BuildEMVARPCData extends Operation {
|
||||
|
||||
/** @inheritdoc */
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
@ -90,9 +91,9 @@ class BuildEMVARPCData extends Operation {
|
||||
run(input, args) {
|
||||
const [method, arqc, arc, csu, pad, fmt] = args;
|
||||
|
||||
const { fields, hex } = method === METHOD2
|
||||
? buildMethod2(arqc, csu, pad)
|
||||
: buildMethod1(arqc, arc);
|
||||
const { fields, hex } = method === METHOD2 ?
|
||||
buildMethod2(arqc, csu, pad) :
|
||||
buildMethod1(arqc, arc);
|
||||
|
||||
if (fmt === "JSON") return formatJson(fields, method);
|
||||
if (fmt === "Annotated") return formatAnnotated(fields, method);
|
||||
|
||||
@ -11,6 +11,7 @@ import { buildCdol1, formatHex, formatJson, formatAnnotatedTlv } from "../lib/Em
|
||||
*/
|
||||
class BuildEMVARQCData extends Operation {
|
||||
|
||||
/** @inheritdoc */
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
||||
@ -15,6 +15,7 @@ import {
|
||||
*/
|
||||
class ParseEMVARPCData extends Operation {
|
||||
|
||||
/** @inheritdoc */
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
||||
@ -11,6 +11,7 @@ import { parseCdol1, formatJson, formatAnnotatedTlv } from "../lib/EmvCdol.mjs";
|
||||
*/
|
||||
class ParseEMVARQCData extends Operation {
|
||||
|
||||
/** @inheritdoc */
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
||||
@ -11,6 +11,7 @@ import { parseEmvTlv, EMV_TAG_DICTIONARY } from "../lib/EmvTlv.mjs";
|
||||
*/
|
||||
class ParseEMVTLV extends Operation {
|
||||
|
||||
/** @inheritdoc */
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user