File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -275,6 +275,9 @@ jobs:
275
275
- run :
276
276
name : Test plotly bundles againt unexpected characters
277
277
command : npm run no-bad-char
278
+ - run :
279
+ name : Display function constructors in plotly.js bundle
280
+ command : npm run log-new-func
278
281
- run :
279
282
name : Test certain bundles against function constructors
280
283
command : npm run no-new-func
Original file line number Diff line number Diff line change 37
37
"watch" : " node tasks/watch.js" ,
38
38
"lint" : " eslint --version && eslint ." ,
39
39
"lint-fix" : " eslint . --fix || true" ,
40
+ "log-new-func" : " eslint --no-ignore --no-eslintrc --no-inline-config --rule '{no-new-func: error}' dist/plotly.js 2>&1 | ./tasks/show_eval_lines.sh" ,
40
41
"no-new-func" : " eslint --no-ignore --no-eslintrc --no-inline-config --rule '{no-new-func: error}' $(find dist -type f -iname '*.js' | grep -v plotly-gl* | grep -v plotly-with-meta.* | grep -v plotly.js | grep -v plotly.min.js)" ,
41
42
"no-bad-char" : " eslint --no-ignore --no-eslintrc --no-inline-config --rule '{no-misleading-character-class: error}' $(find dist -type f -iname '*.js' | grep plotly)" ,
42
43
"no-dup-keys" : " eslint --no-ignore --no-eslintrc --no-inline-config --rule '{no-dupe-keys: error}' $(find dist -type f -iname '*.js' | grep plotly)" ,
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ err=0
3
+ src=" "
4
+ while IFS= read -r str
5
+ do
6
+ if [[ " $str " == * " plotly.js/dist" * ]]; then
7
+ src=" $str "
8
+ fi
9
+
10
+ if [[ " $str " == * " error The Function constructor is eval no-new-func" * ]]; then
11
+ str=${str% error* }
12
+ col=${str#*: }
13
+ row=${str%:* }
14
+ pre=$(( row- 10 ))
15
+ err=$(( err+ 1 ))
16
+ echo " ________________________________________________________________________________"
17
+ sed -n " ${pre} ,${row} p" " $src "
18
+
19
+ for (( i = 0 ; i <= col + 10 ; i++ )) ; do
20
+ echo -n " ^"
21
+ done
22
+ echo
23
+
24
+ echo " Count: $err | Line: $row "
25
+ fi
26
+ done
You can’t perform that action at this time.
0 commit comments