nearley icon indicating copy to clipboard operation
nearley copied to clipboard

Strict Typescript Options cause error output

Open jtenner opened this issue 4 years ago • 2 comments

src/parser/grammar.ts(38,68): error TS6133: 'd' is declared but its value is never read.
src/parser/grammar.ts(41,70): error TS6133: 'd' is declared but its value is never read.

The workaround of course is to change my typescript config to:

{
  "noUnusedParameters": false
}

The offending rules are:

{
  ParserRules: [
    // ...
    {"name": "_", "symbols": ["_$ebnf$1"], "postprocess": function(d) {return null;}},
    // ... and
    {"name": "__$ebnf$1", "symbols": ["__$ebnf$1", "wschar"], "postprocess": (d) => d[0].concat([d[1]])},
   // ...
  ]
}

It would be nice to be able to avoid this problem though. Thoughts?

jtenner avatar Feb 21 '20 16:02 jtenner

I can share my grammar and builtin usage if you want.

jtenner avatar Feb 21 '20 16:02 jtenner

Ah. It looks like it's in the whitespace builtin!

jtenner avatar Feb 21 '20 18:02 jtenner