Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintcache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"/home/runner/work/rdfxml-streaming-parser.js/rdfxml-streaming-parser.js/index.ts":"1","/home/runner/work/rdfxml-streaming-parser.js/rdfxml-streaming-parser.js/package.json":"2","/home/runner/work/rdfxml-streaming-parser.js/rdfxml-streaming-parser.js/renovate.json":"3","/home/runner/work/rdfxml-streaming-parser.js/rdfxml-streaming-parser.js/tsconfig.eslint.json":"4","/home/runner/work/rdfxml-streaming-parser.js/rdfxml-streaming-parser.js/tsconfig.json":"5","/home/runner/work/rdfxml-streaming-parser.js/rdfxml-streaming-parser.js/lib/ParseError.ts":"6","/home/runner/work/rdfxml-streaming-parser.js/rdfxml-streaming-parser.js/lib/RdfXmlParser.ts":"7","/home/runner/work/rdfxml-streaming-parser.js/rdfxml-streaming-parser.js/perf/RdfXmlParser-perf.ts":"8","/home/runner/work/rdfxml-streaming-parser.js/rdfxml-streaming-parser.js/spec/earl-meta.json":"9","/home/runner/work/rdfxml-streaming-parser.js/rdfxml-streaming-parser.js/test/RdfXmlParser-test.ts":"10","/home/runner/work/rdfxml-streaming-parser.js/rdfxml-streaming-parser.js/test/tsconfig.json":"11"},{"size":36,"mtime":1776069305977,"results":"12","hashOfConfig":"13"},{"size":3529,"mtime":1776069947711,"results":"14","hashOfConfig":"15"},{"size":68,"mtime":1776069305977,"results":"16","hashOfConfig":"17"},{"size":190,"mtime":1776070105260,"results":"18","hashOfConfig":"19"},{"size":582,"mtime":1776071755949,"results":"20","hashOfConfig":"19"},{"size":493,"mtime":1776071616787,"results":"21","hashOfConfig":"13"},{"size":37559,"mtime":1776071766111,"results":"22","hashOfConfig":"13"},{"size":782,"mtime":1776069305977,"results":"23","hashOfConfig":"24"},{"size":753,"mtime":1776069947711,"results":"25","hashOfConfig":"17"},{"size":140142,"mtime":1776071712524,"results":"26","hashOfConfig":"27"},{"size":222,"mtime":1776071830175,"results":"28","hashOfConfig":"19"},{"filePath":"29","messages":"30","suppressedMessages":"31","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"cfd5eh",{"filePath":"32","messages":"33","suppressedMessages":"34","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1wd811y",{"filePath":"35","messages":"36","suppressedMessages":"37","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1gvqy43",{"filePath":"38","messages":"39","suppressedMessages":"40","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1e12k0q",{"filePath":"41","messages":"42","suppressedMessages":"43","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"44","messages":"45","suppressedMessages":"46","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"47","messages":"48","suppressedMessages":"49","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"50","messages":"51","suppressedMessages":"52","errorCount":1,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"14v75ax",{"filePath":"53","messages":"54","suppressedMessages":"55","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"56","messages":"57","suppressedMessages":"58","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1w96qen",{"filePath":"59","messages":"60","suppressedMessages":"61","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/runner/work/rdfxml-streaming-parser.js/rdfxml-streaming-parser.js/index.ts",[],[],"/home/runner/work/rdfxml-streaming-parser.js/rdfxml-streaming-parser.js/package.json",[],[],"/home/runner/work/rdfxml-streaming-parser.js/rdfxml-streaming-parser.js/renovate.json",[],[],"/home/runner/work/rdfxml-streaming-parser.js/rdfxml-streaming-parser.js/tsconfig.eslint.json",[],[],"/home/runner/work/rdfxml-streaming-parser.js/rdfxml-streaming-parser.js/tsconfig.json",[],[],"/home/runner/work/rdfxml-streaming-parser.js/rdfxml-streaming-parser.js/lib/ParseError.ts",[],[],"/home/runner/work/rdfxml-streaming-parser.js/rdfxml-streaming-parser.js/lib/RdfXmlParser.ts",[],[],"/home/runner/work/rdfxml-streaming-parser.js/rdfxml-streaming-parser.js/perf/RdfXmlParser-perf.ts",["62"],[],"/home/runner/work/rdfxml-streaming-parser.js/rdfxml-streaming-parser.js/spec/earl-meta.json",[],[],"/home/runner/work/rdfxml-streaming-parser.js/rdfxml-streaming-parser.js/test/RdfXmlParser-test.ts",[],["63"],"/home/runner/work/rdfxml-streaming-parser.js/rdfxml-streaming-parser.js/test/tsconfig.json",[],[],{"ruleId":null,"fatal":true,"severity":2,"message":"64","nodeType":null},{"ruleId":"65","severity":2,"message":"66","line":1952,"column":1,"nodeType":"67","messageId":"68","endLine":1952,"endColumn":124,"suppressions":"69"},"Parsing error: ESLint was configured to run on `<tsconfigRootDir>/perf/RdfXmlParser-perf.ts` using `parserOptions.project`: <tsconfigRootDir>/tsconfig.eslint.json\nHowever, that TSConfig does not include this file. Either:\n- Change ESLint's list of included files to not include this file\n- Change that TSConfig to include this file\n- Create a new TSConfig that includes this file and include it in your parserOptions.project\nSee the typescript-eslint docs for more info: https://typescript-eslint.io/linting/troubleshooting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file","max-len","This line has a length of 123. Maximum allowed is 120.","Program","max",["70"],{"kind":"71","justification":"72"},"directive",""]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this file from the PR, and add it to .gitignore.

90 changes: 90 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
const config = require('@rubensworks/eslint-config');

module.exports = config([
{
ignores: [
'node_modules',
'coverage',
'**/*.js',
'**/*.d.ts',
'**/*.js.map',
'**/*.yml',
'**/*.yaml',
'**/*.md',
'perf/**',
],
},
{
files: [ '**/*.ts' ],
languageOptions: {
parserOptions: {
tsconfigRootDir: __dirname,
project: [ './tsconfig.eslint.json' ],
},
},
},
{
// Project-specific overrides for TypeScript files
files: [ '**/*.ts' ],
rules: {
// Project uses strictNullChecks: false, so this rule cannot be applied
'ts/prefer-nullish-coalescing': 'off',
// This is a Node.js library that legitimately imports Node.js built-in modules
'import/no-nodejs-modules': 'off',
// Allow UPPER_CASE for class properties (public API constants) and enum members
'ts/naming-convention': [
'error',
{
selector: 'default',
format: [ 'camelCase' ],
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
},
{
selector: 'import',
format: null,
},
{
selector: 'variable',
format: [ 'camelCase', 'UPPER_CASE' ],
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
},
{
selector: 'classProperty',
format: [ 'camelCase', 'UPPER_CASE' ],
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
},
{
selector: 'enumMember',
format: [ 'camelCase', 'UPPER_CASE' ],
},
{
selector: 'typeLike',
format: [ 'PascalCase' ],
},
{
selector: [ 'typeParameter' ],
format: [ 'PascalCase' ],
prefix: [ 'T' ],
},
{
selector: 'interface',
format: [ 'PascalCase' ],
custom: {
regex: '^I[A-Z]',
match: true,
},
},
{
// Allow leading underscore for Node.js Transform stream override methods
selector: 'method',
format: [ 'camelCase' ],
leadingUnderscore: 'allow',
trailingUnderscore: 'forbid',
},
],
},
},
]);
10 changes: 4 additions & 6 deletions lib/ParseError.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import {SaxesParser} from "@rubensworks/saxes";
import {RdfXmlParser} from "./RdfXmlParser";
import type { SaxesParser } from '@rubensworks/saxes';
import type { RdfXmlParser } from './RdfXmlParser';

/**
* An error that includes line and column in the error message.
*/
export class ParseError extends Error {

constructor(parser: RdfXmlParser, message: string) {
const saxParser: SaxesParser = (<any>parser).saxParser;
public constructor(parser: RdfXmlParser, message: string) {
const saxParser: SaxesParser = (<{ saxParser: SaxesParser }><unknown>parser).saxParser;
super(parser.trackPosition ? `Line ${saxParser.line} column ${saxParser.column + 1}: ${message}` : message);
}

}
Loading
Loading