-
Notifications
You must be signed in to change notification settings - Fork 21
/
p_coder.js
58 lines (41 loc) · 1.01 KB
/
p_coder.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Additional functionality for editing code
// add coder-specfic CSS
document.head.insertAdjacentHTML('beforeend','<link rel="stylesheet" href="css/coder.css" />');
let files_to_load = [
'./pjs/dayjs-with-plugins.min.js',
'./pjs/diff.js',
'./pjs/linter.min.js',
'./pjs/stylelint-bundle.min.js',
'./pjs/beautify-css.min.js',
'./pjs/beautify-html.min.js',
'./pjs/beautify.js'
];
let code_to_load = [];
// JAVASCRIPT LINTER
const linter_config = {
// eslint configuration
parserOptions: {
ecmaVersion: 2019,
sourceType: "module",
},
env: {
browser: true,
node: true,
},
extends: "eslint:recommended",
rules: {
//semi: ["error", "never"],
},
};
for(let c = 0; c < files_to_load.length; c++){
code_to_load.push(window.add_script(files_to_load[c]));
}
Promise.all(code_to_load).then((values) => {
//console.log("coder_module: promise.all -> the files have loaded");
//console.log(values);
if(eslint){
window.js_linter = new eslint.Linter();
}else{
console.error("eslint missing");
}
});