Add no-var rule.

This commit is contained in:
Sidharth Vinod
2022-09-05 22:31:57 +05:30
parent d898b8a7e7
commit b79ea6c0fe
60 changed files with 172 additions and 169 deletions

View File

@@ -1553,7 +1553,7 @@ Returns **void**
```html
<script>
var config = {
let config = {
theme: 'default',
logLevel: 'fatal',
securityLevel: 'strict',

View File

@@ -558,7 +558,7 @@ click Shape2 call callbackFunction() "This is a tooltip for a callback"
```html
<script>
var callbackFunction = function () {
let callbackFunction = function () {
alert('A callback was triggered');
};
</script>
@@ -622,10 +622,10 @@ Beginner's tip—a full example using interactive links in an HTML page:
</pre>
<script>
var callback = function () {
let callback = function () {
alert('A callback was triggered');
};
var config = {
let config = {
startOnLoad: true,
securityLevel: 'loose',
};

View File

@@ -641,7 +641,7 @@ A node can have click events bound that lead to either a JavaScript callback or
```html
<script>
var callback = function (nodeId) {
let callback = function (nodeId) {
alert('A callback was triggered on ' + nodeId);
};
</script>
@@ -719,10 +719,10 @@ Beginner's tip—here's a full example of using interactive links in HTML:
</pre>
<script>
var callback = function () {
let callback = function () {
alert('A callback was triggered');
};
var config = {
let config = {
startOnLoad: true,
flowchart: {
useMaxWidth: true,

View File

@@ -685,7 +685,7 @@ Examples of tooltip usage below:
```html
<script>
var callback = function () {
let callback = function () {
alert('A callback was triggered');
};
</script>
@@ -761,10 +761,10 @@ Beginner's tip—a full example using interactive links in a html context:
</pre>
<script>
var callback = function () {
let callback = function () {
alert('A callback was triggered');
};
var config = {
let config = {
startOnLoad: true,
flowchart: { useMaxWidth: true, htmlLabels: true, curve: 'cardinal' },
securityLevel: 'loose',

View File

@@ -377,13 +377,13 @@ Beginner's tip—a full example using interactive links in an html context:
</pre>
<script>
var printArguments = function (arg1, arg2, arg3) {
let printArguments = function (arg1, arg2, arg3) {
alert('printArguments called with arguments: ' + arg1 + ', ' + arg2 + ', ' + arg3);
};
var printTask = function (taskId) {
let printTask = function (taskId) {
alert('taskId: ' + taskId);
};
var config = {
let config = {
startOnLoad: true,
securityLevel: 'loose',
};

View File

@@ -38,7 +38,7 @@
}
</script>
<script>
var require = {
let require = {
paths: { vs: 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.29.1/min/vs' },
};
</script>
@@ -60,16 +60,16 @@
<body>
<div id="app"></div>
<script>
var initEditor = exports.default;
var parser = new DOMParser();
var currentCodeExample = 0;
var colorize = [];
let initEditor = exports.default;
let parser = new DOMParser();
let currentCodeExample = 0;
let colorize = [];
function colorizeEverything(html) {
initEditor(monaco);
return new Promise((resolve, reject) => {
monaco.editor.setTheme('mermaid');
var parsed = parser.parseFromString(html, 'text/html').body;
let parsed = parser.parseFromString(html, 'text/html').body;
Promise.all(
[...parsed.querySelectorAll('pre[id*="code"]')].map((codeBlock) =>
monaco.editor.colorize(codeBlock.innerText, 'mermaid')
@@ -126,7 +126,7 @@
function (hook, vm) {
hook.beforeEach(function (html) {
url = 'https://github.com/mermaid-js/mermaid/blob/develop/src/docs/' + vm.route.file;
var editHtml = '[:memo: Edit this Page](' + url + ')\n';
let editHtml = '[:memo: Edit this Page](' + url + ')\n';
return editHtml + html;
});
@@ -145,7 +145,7 @@
],
};
var num = 0;
let num = 0;
const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;
const conf = {

View File

@@ -211,11 +211,11 @@ The example below show an outline of how this could be used. The example just lo
$(function () {
// Example of using the API var
element = document.querySelector('#graphDiv');
var insertSvg = function (svgCode, bindFunctions) {
let insertSvg = function (svgCode, bindFunctions) {
element.innerHTML = svgCode;
};
var graphDefinition = 'graph TB\na-->b';
var graph = mermaid.mermaidAPI.render('graphDiv', graphDefinition, insertSvg);
let graphDefinition = 'graph TB\na-->b';
let graph = mermaid.mermaidAPI.render('graphDiv', graphDefinition, insertSvg);
});
</script>
```
@@ -339,7 +339,7 @@ on what kind of integration you use.
```html
<script src="../dist/mermaid.js"></script>
<script>
var config = { startOnLoad: true, flowchart: { useMaxWidth: false, htmlLabels: true } };
let config = { startOnLoad: true, flowchart: { useMaxWidth: false, htmlLabels: true } };
mermaid.initialize(config);
</script>
```