Skip to content

Commit

Permalink
Eslint: don't allow var (GoogleChrome#856)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbenz authored Mar 20, 2023
1 parent ad857a2 commit d0dd2c3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = {
plugins: ['prettier'],
rules: {
'prettier/prettier': ['error'],
'no-var': ['error'],
'no-unused-vars': [
'warn',
{
Expand Down
2 changes: 1 addition & 1 deletion api-samples/printing/printers.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// found in the LICENSE file.

function onPrintButtonClicked(printerId, dpi) {
var ticket = {
let ticket = {
version: '1.0',
print: {
color: { type: 'STANDARD_MONOCHROME' },
Expand Down
4 changes: 3 additions & 1 deletion functional-samples/sample.bookmarks/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function dumpTreeNodes(bookmarkNodes, query) {
}

function dumpNode(bookmarkNode, query) {
let span = '';
if (bookmarkNode.title) {
if (query && !bookmarkNode.children) {
if (
Expand All @@ -51,7 +52,7 @@ function dumpNode(bookmarkNode, query) {
chrome.tabs.create({ url: bookmarkNode.url });
});

var span = $('<span>');
span = $('<span>');
const options = bookmarkNode.children
? $('<span>[<a href="#" id="addlink">Add</a>]</span>')
: $(
Expand Down Expand Up @@ -182,6 +183,7 @@ function dumpNode(bookmarkNode, query) {
}

const li = $(bookmarkNode.title ? '<li>' : '<div>').append(span);

if (bookmarkNode.children && bookmarkNode.children.length > 0) {
li.append(dumpTreeNodes(bookmarkNode.children, query));
}
Expand Down

0 comments on commit d0dd2c3

Please sign in to comment.