Skip to content

Commit 66b375d

Browse files
committed
build: upgrade and fix linting
1 parent b255464 commit 66b375d

27 files changed

+227
-1859
lines changed

.prettierignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
.pnp.js
1+
.pnp.*
22
.yarnrc.yml
33
.yarn

eslint.config.cjs

-9
This file was deleted.

eslint.config.mjs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import js from "@eslint/js";
2+
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
3+
import jest from "eslint-plugin-jest";
4+
import globals from "globals";
5+
6+
export default [
7+
js.configs.recommended,
8+
eslintPluginPrettierRecommended,
9+
jest.configs['flat/recommended'],
10+
{
11+
languageOptions: {
12+
globals: {
13+
...globals.browser,
14+
},
15+
},
16+
rules: {
17+
"no-console": "off",
18+
"no-unused-vars": "warn"
19+
}
20+
}
21+
];

examples/boundingbox.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

examples/css_styled.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

examples/customLayout.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

examples/customLayoutCanvas.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

examples/customLayoutDistinct.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

examples/dynamic.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

examples/dynamicDistinct.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

examples/interactive.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

examples/intersection_tooltip.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

examples/medical.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

examples/orientation_order.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

examples/scaled.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

examples/simple.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

examples/simple_viewbox.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

examples/styled.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

examples/styled_centre.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

examples/sublabels.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

examples/sublabels_static.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

examples/venn_venn.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

examples/venn_venn_distinct.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

examples/weighted.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"@babel/core": "^7.24.7",
6262
"@babel/plugin-transform-runtime": "^7.24.7",
6363
"@babel/preset-env": "^7.24.7",
64+
"@eslint/js": "^9.4.0",
6465
"@rollup/plugin-babel": "^6.0.4",
6566
"@rollup/plugin-commonjs": "^26.0.1",
6667
"@rollup/plugin-node-resolve": "^15.2.3",
@@ -69,11 +70,12 @@
6970
"canvas": "^2.11.2",
7071
"eslint": "^9.4.0",
7172
"eslint-config-prettier": "^9.1.0",
73+
"eslint-plugin-jest": "^28.6.0",
7274
"eslint-plugin-prettier": "^5.1.3",
75+
"globals": "^15.4.0",
7376
"jest": "^29.7.0",
7477
"jest-image-snapshot": "^6.4.0",
7578
"prettier": "^3.3.1",
76-
"release-it": "^17.3.0",
7779
"rimraf": "^5.0.7",
7880
"rollup": "^4.18.0",
7981
"rollup-plugin-pnp-resolve": "^2.0.0",

src/diagram.js

+14-16
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import { venn, lossFunction, logRatioLossFunction, normalizeSolution, scaleSolut
22
import { intersectionArea, distance, getCenter } from './circleintersection';
33
import { nelderMead } from 'fmin';
44

5-
/*global console:true*/
6-
75
/**
86
* VennDiagram includes an optional `options` parameter containing the following option(s):
97
*
@@ -45,19 +43,19 @@ export function VennDiagram(options = {}) {
4543
options && options.colourScheme
4644
? options.colourScheme
4745
: options && options.colorScheme
48-
? options.colorScheme
49-
: [
50-
'#1f77b4',
51-
'#ff7f0e',
52-
'#2ca02c',
53-
'#d62728',
54-
'#9467bd',
55-
'#8c564b',
56-
'#e377c2',
57-
'#7f7f7f',
58-
'#bcbd22',
59-
'#17becf',
60-
],
46+
? options.colorScheme
47+
: [
48+
'#1f77b4',
49+
'#ff7f0e',
50+
'#2ca02c',
51+
'#d62728',
52+
'#9467bd',
53+
'#8c564b',
54+
'#e377c2',
55+
'#7f7f7f',
56+
'#bcbd22',
57+
'#17becf',
58+
],
6159
colourIndex = 0,
6260
colours = function (key) {
6361
if (key in colourMap) {
@@ -308,7 +306,7 @@ export function VennDiagram(options = {}) {
308306
};
309307

310308
chart.colors = function (_) {
311-
if (!arguments.length) return colors;
309+
if (!arguments.length) return colours;
312310
colours = _;
313311
return chart;
314312
};

0 commit comments

Comments
 (0)