Skip to content

Commit

Permalink
chore: update dependencies and migrate to vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
lpatiny committed Oct 2, 2024
1 parent 3c2fb71 commit fa981ab
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 26 deletions.
6 changes: 0 additions & 6 deletions .eslintrc.yml

This file was deleted.

16 changes: 16 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import cheminfo from 'eslint-config-cheminfo';
import globals from 'globals';

export default [
...cheminfo,
{
languageOptions: {
globals: {
...globals.node,
},
},
rules: {
// "camelcase": "off",
}
}
]
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"prettier": "prettier --check src",
"prettier-write": "prettier --write src",
"test": "npm run test-coverage && npm run eslint && npm run prettier",
"test-coverage": "jest --coverage",
"test-only": "jest"
"test-coverage": "vitest run --coverage",
"test-only": "vitest"
},
"repository": {
"type": "git",
Expand All @@ -35,20 +35,20 @@
"testEnvironment": "node"
},
"devDependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.24.1",
"@types/jest": "^29.5.12",
"@types/node": "^20.12.12",
"@babel/plugin-transform-modules-commonjs": "^7.24.8",
"@types/node": "^22.7.4",
"@vitest/coverage-v8": "^2.1.1",
"cheminfo-build": "^1.2.0",
"eslint": "^8.57.0",
"eslint-config-cheminfo": "^9.2.0",
"jest": "^29.7.0",
"eslint-config-cheminfo": "^11.1.2",
"jest-matcher-deep-close-to": "^3.0.2",
"prettier": "^3.2.5",
"rollup": "^4.18.0"
"prettier": "^3.3.3",
"rollup": "^4.24.0"
},
"dependencies": {
"common-spectrum": "2.8.0",
"ml-gsd": "^12.1.6"
"ml-gsd": "^12.1.8",
"vitest": "^2.1.1"
},
"info": {
"logo": "https://raw.githubusercontent.com/cheminfo/font/main/src/uv/assignment.svg",
Expand Down
6 changes: 4 additions & 2 deletions src/__tests__/index.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { readFileSync } from 'fs';
import { join } from 'path';
import { readFileSync } from 'node:fs';
import { join } from 'node:path';

import { test, expect } from 'vitest'

import { fromText } from '..';

Expand Down
6 changes: 3 additions & 3 deletions src/from/fromJcamp.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { spectrumCallback } from './utils/spectrumCallback';
* @param {ArrayBuffer|string} jcamp

Check warning on line 7 in src/from/fromJcamp.js

View workflow job for this annotation

GitHub Actions / nodejs / lint-eslint

Missing JSDoc @param "jcamp" description
* @param {object} [options={}]

Check warning on line 8 in src/from/fromJcamp.js

View workflow job for this annotation

GitHub Actions / nodejs / lint-eslint

Missing JSDoc @param "options" description
* @param {string|number} [options.id=Math.random()]

Check warning on line 9 in src/from/fromJcamp.js

View workflow job for this annotation

GitHub Actions / nodejs / lint-eslint

Missing JSDoc @param "options.id" description
* @param {string} [options.label=options.id] human redeable label
* @param {string} [options.spectrumCallback] a callback to apply on variables when creating spectrum. Default will add a and t
* @return {Analysis} - New class element with the given data
* @param {string} [options.label=options.id] - human redeable label
* @param {string} [options.spectrumCallback] - a callback to apply on variables when creating spectrum. Default will add a and t
* @returns {Analysis} - New class element with the given data

Check warning on line 12 in src/from/fromJcamp.js

View workflow job for this annotation

GitHub Actions / nodejs / lint-eslint

The type 'Analysis' is undefined
*/
export function fromJcamp(jcamp, options = {}) {
return commonFromJcamp(jcamp, { ...options, spectrumCallback });
Expand Down
10 changes: 5 additions & 5 deletions src/jsgraph/getAnnotations.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @typedef {Object} Peak
* @typedef {object} Peak
* @property {number} wavelength

Check warning on line 3 in src/jsgraph/getAnnotations.js

View workflow job for this annotation

GitHub Actions / nodejs / lint-eslint

Missing JSDoc @Property "wavelength" description
* @property {number} absorbance

Check warning on line 4 in src/jsgraph/getAnnotations.js

View workflow job for this annotation

GitHub Actions / nodejs / lint-eslint

Missing JSDoc @Property "absorbance" description
* @property {number} kind

Check warning on line 5 in src/jsgraph/getAnnotations.js

View workflow job for this annotation

GitHub Actions / nodejs / lint-eslint

Missing JSDoc @Property "kind" description
Expand All @@ -8,13 +8,13 @@

/**
* Creates annotations for jsgraph that allows to display the result of peak picking
* @param {array<Peak>} peaks
* @param {Array<Peak>} peaks

Check warning on line 11 in src/jsgraph/getAnnotations.js

View workflow job for this annotation

GitHub Actions / nodejs / lint-eslint

Missing JSDoc @param "peaks" description
* @param {object} [options={}]
* @param {string} [options.fillColor='green']
* @param {string} [options.strokeColor='red']
* @param {string} [options.showKind=true] Display the kind, 'm', 'w', 'S'
* @param {string} [options.showAssignment=true] Display the assignment
* @param {function} [options.createFct] (annotation, peak) => {}: callback allowing to add properties
* @param {string} [options.showKind=true] - Display the kind, 'm', 'w', 'S'
* @param {string} [options.showAssignment=true] - Display the assignment
* @param {Function} [options.createFct] - (annotation, peak) => {}: callback allowing to add properties
* @returns array
*/

Expand Down

0 comments on commit fa981ab

Please sign in to comment.