Update package configuration and TypeScript settings; add build script, versioning, and output directories. Refactor NamedType equality check for conciseness. Change import statements to use 'type' for IDisposable in Disposable and DisposableList classes.
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
{
|
||||
"name": "platform-ts",
|
||||
"module": "index.ts",
|
||||
"version": "0.0.1",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"format": "prettier --write .",
|
||||
"lint": "eslint --max-warnings 0 ./src",
|
||||
"prelint:fix": "bun run format",
|
||||
"lint:fix": "eslint --fix ./src"
|
||||
"lint:fix": "eslint --fix ./src",
|
||||
"build": "tsc"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/css": "0.13.0",
|
||||
|
||||
@@ -13,11 +13,7 @@ export default class NamedType extends Type {
|
||||
}
|
||||
|
||||
public override equals(other: Type): boolean {
|
||||
return (
|
||||
super.equals(other) &&
|
||||
other instanceof NamedType &&
|
||||
this.getName() === other.getName()
|
||||
);
|
||||
return super.equals(other) && other instanceof NamedType && this.getName() === other.getName();
|
||||
}
|
||||
|
||||
public overridetoURN(): string {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import IDisposable from './IDisposable';
|
||||
import type IDisposable from './IDisposable';
|
||||
|
||||
export default class Disposable implements IDisposable {
|
||||
private readonly _cleanup: () => void;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import IDisposable from './IDisposable';
|
||||
import type IDisposable from './IDisposable';
|
||||
|
||||
export default class DisposableList implements IDisposable {
|
||||
private readonly _list: IDisposable[];
|
||||
@@ -15,7 +15,7 @@ export default class DisposableList implements IDisposable {
|
||||
while (this._list.length) {
|
||||
const disposable = this._list.shift();
|
||||
|
||||
disposable.dispose();
|
||||
disposable!.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,12 +7,18 @@
|
||||
"moduleDetection": "force",
|
||||
"jsx": "react-jsx",
|
||||
"allowJs": true,
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"sourceMap": true,
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"declarationDir": "./dist/types",
|
||||
|
||||
// Bundler mode
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"allowImportingTsExtensions": false,
|
||||
"verbatimModuleSyntax": true,
|
||||
"noEmit": true,
|
||||
"noEmit": false,
|
||||
|
||||
// Best practices
|
||||
"strict": true,
|
||||
@@ -25,5 +31,7 @@
|
||||
"noUnusedLocals": false,
|
||||
"noUnusedParameters": false,
|
||||
"noPropertyAccessFromIndexSignature": false
|
||||
}
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules/**/*", "test/**/*"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user