diff --git a/.eslintrc.yml b/.eslintrc.yml deleted file mode 100644 index ff9f6e0..0000000 --- a/.eslintrc.yml +++ /dev/null @@ -1,3 +0,0 @@ -extends: cheminfo-typescript -parserOptions: - sourceType: module diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..b905e35 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,14 @@ +import cheminfo from 'eslint-config-cheminfo-typescript'; +import globals from 'globals'; + +export default [ + ...cheminfo, + { + languageOptions: { + globals: { + ...globals.node, + }, + }, + rules: {} + } +] \ No newline at end of file diff --git a/package.json b/package.json index fdd09e8..31f554a 100644 --- a/package.json +++ b/package.json @@ -36,18 +36,18 @@ }, "homepage": "https://github.com/mljs/tree-similarity#readme", "devDependencies": { - "@babel/plugin-transform-modules-commonjs": "^7.23.3", - "@babel/preset-typescript": "^7.23.3", - "@vitest/coverage-v8": "^1.2.2", - "eslint": "^8.56.0", - "eslint-config-cheminfo-typescript": "^12.2.0", - "prettier": "^3.2.5", - "rimraf": "^5.0.5", - "typescript": "^5.3.3", - "vitest": "^1.2.2" + "@babel/plugin-transform-modules-commonjs": "^7.25.7", + "@babel/preset-typescript": "^7.25.7", + "@vitest/coverage-v8": "^2.1.3", + "eslint": "^9.12.0", + "eslint-config-cheminfo-typescript": "^16.0.0", + "prettier": "^3.3.3", + "rimraf": "^6.0.1", + "typescript": "^5.6.3", + "vitest": "^2.1.3" }, "dependencies": { "binary-search": "^1.3.6", - "cheminfo-types": "^1.7.2" + "cheminfo-types": "^1.8.0" } } diff --git a/src/compressTree.ts b/src/compressTree.ts index 115a7ba..41937e5 100644 --- a/src/compressTree.ts +++ b/src/compressTree.ts @@ -2,6 +2,9 @@ import { Tree } from './createTree'; /** * Destructive compression in which we reduce the number of decimals + * @param tree + * @param options + * @param options.fixed */ export function compressTree( tree: Tree, diff --git a/src/createTree.ts b/src/createTree.ts index 8a5fe2c..da10865 100644 --- a/src/createTree.ts +++ b/src/createTree.ts @@ -37,6 +37,8 @@ export interface CreateTreeOptions { /** * Function that creates the tree + * @param dataXY + * @param options */ export function createTree( @@ -48,7 +50,7 @@ export function createTree( minWindow = 0.16, threshold = 0.01, from = x[0], - to = x[x.length - 1], + to = x.at(-1) as number, } = options; return mainCreateTree(x, y, from, to, minWindow, threshold); @@ -72,7 +74,7 @@ function mainCreateTree(x, y, from, to, minWindow, threshold) { if (x[i] >= to) { break; } - sum += y[i]; + sum += y[i] as number; center += x[i] * y[i]; } diff --git a/src/treeSimilarity.ts b/src/treeSimilarity.ts index 547ed2c..c898193 100644 --- a/src/treeSimilarity.ts +++ b/src/treeSimilarity.ts @@ -8,7 +8,10 @@ export interface TreeSimilarityOptions { /** * Similarity between two nodes - * @return similarity measure between tree nodes + * @param treeA + * @param treeB + * @param options + * @returns similarity measure between tree nodes */ export function treeSimilarity( treeA: Tree | null, diff --git a/tsconfig.json b/tsconfig.json index 7eed2d9..2c9cf1b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,8 +7,8 @@ "outDir": "lib", "sourceMap": true, "strict": true, - "target": "es2020", - "noImplicitAny": false, + "target": "es2022", + "noImplicitAny": false }, "include": ["./src/**/*"] -} \ No newline at end of file +}