Skip to content

Commit d797398

Browse files
Copilotrubensworks
andauthored
fix: resolve all ESLint linting errors
- lib/ParseError.ts: Add public constructor modifier, fix type assertion syntax - lib/RdfXmlParser.ts: - Fix NCNAME_MATCHER regex (misleading char class, long line) using RegExp constructor - Add public/return type annotations throughout (constructor, _transform, validateNcname, attachSaxListeners, onTag, onTagResource, onTagProperty, emitTriple, claimNodeId, onText, onCloseTag, onDoctype, setDirection, setVersion) - Fix unsafe type assertions using angle-bracket syntax - Fix SaxesParser field type to SaxesParser<{ xmlns: true }> for type safety - Fix no-fallthrough in switch statement with 'Falls through' comment - Fix capitalized-comments violations - Refactor createLiteral to avoid indentation/ternary issues - Format all emitTriple/push calls with consistent multi-line argument style - Fix onDoctype regex: add u flag, use replaceAll, type callback params - Fix validateUri defaulting to true when not specified - Add es2021.string to tsconfig lib arrays for replaceAll support - test/RdfXmlParser-test.ts: - Replace all return expect(...) with await expect(...) - Make non-async callbacks async - Fix duplicate test title - Fix toThrow() missing message - Add eslint-disable-next-line for unavoidably long test title Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
1 parent e15ee30 commit d797398

File tree

5 files changed

+384
-222
lines changed

5 files changed

+384
-222
lines changed

lib/ParseError.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import type { RdfXmlParser } from './RdfXmlParser';
55
* An error that includes line and column in the error message.
66
*/
77
export class ParseError extends Error {
8-
constructor(parser: RdfXmlParser, message: string) {
9-
const saxParser: SaxesParser = (<any>parser).saxParser;
8+
public constructor(parser: RdfXmlParser, message: string) {
9+
const saxParser: SaxesParser = (<{ saxParser: SaxesParser }><unknown>parser).saxParser;
1010
super(parser.trackPosition ? `Line ${saxParser.line} column ${saxParser.column + 1}: ${message}` : message);
1111
}
1212
}

0 commit comments

Comments
 (0)