diff --git a/.eslintrc.yml b/.eslintrc.yml index f40ac5c..00ffb08 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -1,3 +1,6 @@ extends: cheminfo parserOptions: sourceType: module +env: + jest: true + node: true \ No newline at end of file diff --git a/.npmrc b/.npmrc index 43c97e7..b15cbc2 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1,2 @@ package-lock=false + diff --git a/package.json b/package.json index 8640a6c..ae2d86f 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,9 @@ "build": "cheminfo-build --entry src/index.js --root XPS", "eslint": "eslint src", "eslint-fix": "npm run eslint -- --fix", - "prepublishOnly": "rollup -c", + "prepack": "rollup -c", + "prettier": "prettier --check src", + "prettier-write": "prettier --write src", "test": "npm run test-coverage && npm run eslint", "test-coverage": "jest --coverage", "test-only": "jest" @@ -39,23 +41,20 @@ "trailingComma": "all" }, "devDependencies": { - "@babel/plugin-transform-modules-commonjs": "^7.14.5", - "@types/jest": "^26.0.24", - "cheminfo-build": "^1.1.11", - "eslint": "^7.31.0", - "eslint-config-cheminfo": "^5.2.4", - "eslint-plugin-import": "^2.23.4", - "eslint-plugin-jest": "^24.3.7", - "eslint-plugin-prettier": "^3.4.0", - "jest": "^27.0.6", - "papaparse": "^5.3.1", - "prettier": "^2.3.2", - "rollup": "^2.53.3" + "@babel/plugin-transform-modules-commonjs": "^7.23.3", + "@types/jest": "^29.5.11", + "cheminfo-build": "^1.2.0", + "eslint": "^8.56.0", + "eslint-config-cheminfo": "^9.1.1", + "jest": "^29.7.0", + "papaparse": "^5.4.1", + "prettier": "^3.2.4", + "rollup": "^4.9.6" }, "dependencies": { - "common-spectrum": "0.40.0", - "ensure-string": "^0.1.1", - "ml-gsd": "^6.6.3", + "common-spectrum": "2.4.0", + "ensure-string": "^1.2.0", + "ml-gsd": "^12.1.3", "vamas": "^0.1.2" }, "info": { diff --git a/src/__tests__/index.test.js b/src/__tests__/index.test.js index 0da95fa..1b7f386 100644 --- a/src/__tests__/index.test.js +++ b/src/__tests__/index.test.js @@ -32,5 +32,5 @@ describe('fromVamas', () => { expect(cheminfo).toHaveLength(54); expect(cheminfo[0]).toMatch('region'); expect(cheminfo[7]).toMatch('S 2p WS2'); - }) + }); }); diff --git a/src/__tests__/peakPicking.test.js b/src/__tests__/peakPicking.test.js index 131d053..266f8df 100644 --- a/src/__tests__/peakPicking.test.js +++ b/src/__tests__/peakPicking.test.js @@ -14,6 +14,6 @@ describe('peakPicking', () => { it('check number of peaks with default options', () => { let result = peakPicking(analysis.getXYSpectrum()); - expect(result).toHaveLength(118); + expect(result).toHaveLength(12); }); }); diff --git a/src/from/__tests__/fromVamas.test.js b/src/from/__tests__/fromVamas.test.js index ea16be6..b57423e 100644 --- a/src/from/__tests__/fromVamas.test.js +++ b/src/from/__tests__/fromVamas.test.js @@ -19,7 +19,6 @@ describe('fromVamas', () => { expect(typeof result.meta.cheminfo.meta).toBe('object'); }); - it('auger', () => { let result = fromVamas(augerText).spectra[0]; expect(Object.keys(result.variables)).toHaveLength(2); diff --git a/src/jsgraph/getAnnotations.js b/src/jsgraph/getAnnotations.js index b1e7c8c..d683faa 100644 --- a/src/jsgraph/getAnnotations.js +++ b/src/jsgraph/getAnnotations.js @@ -25,9 +25,9 @@ export function getAnnotations(components, options = {}) { let annotation = { line: 1, type: 'rect', - strokeColor: strokeColor, + strokeColor, strokeWidth: 0, - fillColor: fillColor, + fillColor, }; if (creationFct) { creationFct(annotation, component);