fix: lint-staged and merge eslint-config-html (#2550)

This commit is contained in:
Matthieu MOREL
2021-12-11 11:12:14 +01:00
committed by GitHub
parent b7eb71e7d3
commit 67143b7bfd
5 changed files with 30 additions and 40 deletions

View File

@@ -14,7 +14,7 @@
"sourceType": "module"
},
"extends": ["eslint:recommended", "plugin:jsdoc/recommended", "plugin:markdown/recommended", "plugin:prettier/recommended"],
"plugins": ["jest", "jsdoc", "prettier"],
"plugins": ["html", "jest", "jsdoc", "prettier"],
"rules": {
"no-prototype-builtins": 0,
"no-unused-vars": 0,

7
.gitignore vendored
View File

@@ -4,8 +4,7 @@ node_modules/
coverage/
.idea/
dist/*.js
dist/*.map
dist/
yarn-error.log
.npmrc
@@ -13,10 +12,6 @@ token
package-lock.json
dist/classTest.html
dist/sequenceTest.html
.vscode/
cypress/platform/current.html
cypress/platform/experimental.html

View File

@@ -1,5 +1,5 @@
{
"*": [
"*.{js,html,md}": [
"yarn lint:fix"
]
}

View File

@@ -58,11 +58,13 @@
},
flowchart: {
// defaultRenderer: 'dagre-wrapper',
nodeSpacing: 10, curve: 'cardinal', htmlLabels: true
nodeSpacing: 10,
curve: 'cardinal',
htmlLabels: true,
},
htmlLabels: true,
// gantt: { axisFormat: '%m/%d/%Y' },
sequence: { actorFontFamily: 'courier',actorMargin: 50, showSequenceNumbers: false },
sequence: { actorFontFamily: 'courier', actorMargin: 50, showSequenceNumbers: false },
// sequenceDiagram: { actorMargin: 300 } // deprecated
// fontFamily: '"times", sans-serif',
// fontFamily: 'courier',
@@ -70,34 +72,36 @@
curve: 'basis',
securityLevel: 'antiscript',
startOnLoad: false,
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize']
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'],
// themeVariables: {relationLabelColor: 'red'}
});
function callback(){alert('It worked');}
function xssAttack(){
const div = document.createElement('div')
div.id = 'the-malware'
div.className = 'malware'
div.innerHTML = 'XSS Succeeded'
function callback() {
alert('It worked');
}
function xssAttack() {
const div = document.createElement('div');
div.id = 'the-malware';
div.className = 'malware';
div.innerHTML = 'XSS Succeeded';
document.getElementsByTagName('body')[0].appendChild(div);
throw new Error('XSS Succeded');
}
var diagram = "classDiagram\n"
diagram += "classA <-- classB : <ifr";
var diagram = 'classDiagram\n';
diagram += 'classA <-- classB : <ifr';
diagram += "ame/srcdoc='<scr";
diagram += "ipt>parent.xssAttack(`XSS`)</";
diagram += 'ipt>parent.xssAttack(`XSS`)</';
diagram += "script>'>";
// var diagram = "stateDiagram-v2\n";
// diagram += "<img/src='1'/onerror"
// diagram += "=xssAttack()> --> B";
console.log(diagram);
// document.querySelector('#diagram').innerHTML = diagram;
mermaid.render('diagram', diagram, (res) => {
// var diagram = "stateDiagram-v2\n";
// diagram += "<img/src='1'/onerror"
// diagram += "=xssAttack()> --> B";
console.log(diagram);
// document.querySelector('#diagram').innerHTML = diagram;
mermaid.render('diagram', diagram, (res) => {
console.log(res);
document.querySelector('#res').innerHTML = res;
});
});
</script>
</body>
</html>

View File

@@ -5150,15 +5150,6 @@ espree@^9.2.0:
acorn-jsx "^5.3.1"
eslint-visitor-keys "^3.1.0"
espree@^9.1.0:
version "9.2.0"
resolved "https://registry.yarnpkg.com/espree/-/espree-9.2.0.tgz#c50814e01611c2d0f8bd4daa83c369eabba80dbc"
integrity sha512-oP3utRkynpZWF/F2x/HZJ+AGtnIclaR7z1pYPxy7NYM2fSO6LgK/Rkny8anRSPK/VwEA1eqm2squui0T7ZMOBg==
dependencies:
acorn "^8.6.0"
acorn-jsx "^5.3.1"
eslint-visitor-keys "^3.1.0"
esprima@1.1.x, esprima@~1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-1.1.1.tgz#5b6f1547f4d102e670e140c509be6771d6aeb549"