Skip to content

Commit

Permalink
PATCH: Enable eslint and implement TS1371
Browse files Browse the repository at this point in the history
  • Loading branch information
mochnatiy committed Feb 3, 2023
1 parent e030d69 commit dd31505
Show file tree
Hide file tree
Showing 26 changed files with 10,690 additions and 141 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
mode_modules
28 changes: 28 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended'
],
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
ecmaVersion: 'ES2015',
tsconfigRootDir: './'
},
plugins: ['@typescript-eslint'],
root: true,
rules: {
'no-case-declarations': 1,
'no-console': 1,
'no-dupe-else-if': 1,
'no-prototype-builtins': 1,
'no-undef': 1,
'no-useless-escape': 1,
'prefer-const': 1,
'@typescript-eslint/ban-types': 1,
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-extra-semi': 1,
'@typescript-eslint/no-this-alias': 1
}
};
2 changes: 1 addition & 1 deletion convertToJs.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ParseConformance } from './parseConformance';
import type { ParseConformance } from './parseConformance';
export declare class ConvertToJs {
private parser;
constructor(parser?: ParseConformance);
Expand Down
10 changes: 5 additions & 5 deletions convertToJs.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as convert from 'xml-js';
import {ParseConformance} from './parseConformance';
import {XmlHelper} from './xmlHelper';
import {ParsedProperty} from "./model/parsed-property";
import {Constants} from "./constants";
import {XmlElement} from "./convertToXml";
import { ParseConformance } from './parseConformance';
import { XmlHelper } from './xmlHelper';
import type { ParsedProperty } from "./model/parsed-property";
import { Constants } from "./constants";
import type { XmlElement } from "./convertToXml";

export class ConvertToJs {
private parser: ParseConformance;
Expand Down
2 changes: 1 addition & 1 deletion convertToXml.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ParseConformance } from './parseConformance';
import type { ParseConformance } from './parseConformance';
export interface XmlDeclaration {
attributes?: {
[id: string]: any;
Expand Down
10 changes: 5 additions & 5 deletions convertToXml.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as convert from 'xml-js';
import {ParseConformance} from './parseConformance';
import {ParsedStructure} from "./model/parsed-structure";
import {ParsedProperty} from './model/parsed-property';
import {XmlHelper} from './xmlHelper';
import {Constants} from "./constants";
import { ParseConformance } from './parseConformance';
import type { ParsedStructure } from "./model/parsed-structure";
import type { ParsedProperty } from './model/parsed-property';
import { XmlHelper } from './xmlHelper';
import { Constants } from "./constants";

export interface XmlDeclaration {
attributes?: { [id: string]: any };
Expand Down
8 changes: 4 additions & 4 deletions fhir.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ParseConformance } from './parseConformance';
import { Bundle } from "./model/bundle";
import { ValidatorOptions } from './validator';
import type { ParseConformance } from './parseConformance';
import type { Bundle } from "./model/bundle";
import type { ValidatorOptions, ValidatorResponse } from './validator';
export declare enum Versions {
STU3 = "STU3",
R4 = "R4",
Expand All @@ -15,7 +15,7 @@ export declare class Fhir {
resourceType: any;
};
xmlToJson(xml: string): string;
validate(input: string | Object, options?: ValidatorOptions): import("./validator").ValidatorResponse;
validate(input: string | Object, options?: ValidatorOptions): ValidatorResponse;
evaluate(resource: string | Object, fhirPathString: string): any;
resolve(reference: string): void;
generateSnapshot(bundle: Bundle): void;
Expand Down
15 changes: 8 additions & 7 deletions fhir.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import {ParseConformance} from './parseConformance';
import {Bundle} from "./model/bundle";
import {Validator, ValidatorOptions} from './validator';
import {ConvertToJs} from './convertToJs';
import {ConvertToXml} from './convertToXml';
import {FhirPath} from './fhirPath';
import {SnapshotGenerator} from './snapshotGenerator';
import { ParseConformance } from './parseConformance';
import type { Bundle } from "./model/bundle";
import type { ValidatorOptions } from './validator';
import { Validator } from './validator';
import { ConvertToJs } from './convertToJs';
import { ConvertToXml } from './convertToXml';
import { FhirPath } from './fhirPath';
import { SnapshotGenerator } from './snapshotGenerator';

export enum Versions {
STU3 = 'STU3',
Expand Down
2 changes: 1 addition & 1 deletion fhirPath.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ParseConformance} from './parseConformance';
import { ParseConformance } from './parseConformance';

interface PathStructure {
name?: string;
Expand Down
2 changes: 1 addition & 1 deletion model/bundle.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {StructureDefinition} from "./structure-definition";
import type { StructureDefinition } from "./structure-definition";

export interface Bundle {
resourceType: string;
Expand Down
2 changes: 1 addition & 1 deletion model/parsed-structure.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ParsedProperty } from "./parsed-property";
import type { ParsedProperty } from "./parsed-property";
export interface ParsedStructure {
_url: string;
_type: string;
Expand Down
2 changes: 1 addition & 1 deletion model/parsed-structure.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ParsedProperty} from "./parsed-property";
import type { ParsedProperty } from "./parsed-property";

export interface ParsedStructure {
_url: string;
Expand Down
2 changes: 1 addition & 1 deletion model/parsed-system.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ParsedConcept } from "./parsed-concept";
import type { ParsedConcept } from "./parsed-concept";
export interface ParsedSystem {
uri: string;
codes: ParsedConcept[];
Expand Down
2 changes: 1 addition & 1 deletion model/parsed-system.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ParsedConcept} from "./parsed-concept";
import type { ParsedConcept } from "./parsed-concept";

export interface ParsedSystem {
uri: string;
Expand Down
2 changes: 1 addition & 1 deletion model/parsed-value-set.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ParsedSystem } from "./parsed-system";
import type { ParsedSystem } from "./parsed-system";
export interface ParsedValueSet {
systems: ParsedSystem[];
}
2 changes: 1 addition & 1 deletion model/parsed-value-set.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ParsedSystem} from "./parsed-system";
import type { ParsedSystem } from "./parsed-system";

export interface ParsedValueSet {
systems: ParsedSystem[];
Expand Down
2 changes: 1 addition & 1 deletion model/structure-definition.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ElementDefinition } from "./element-definition";
import type { ElementDefinition } from "./element-definition";
export interface StructureDefinition {
resourceType: string;
id?: string;
Expand Down
2 changes: 1 addition & 1 deletion model/structure-definition.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ElementDefinition} from "./element-definition";
import type { ElementDefinition } from "./element-definition";

export interface StructureDefinition {
resourceType: string;
Expand Down
Loading

0 comments on commit dd31505

Please sign in to comment.