Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm: bump eslint from 8.57.0 to 9.1.1 #3829

Merged
merged 3 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

42 changes: 0 additions & 42 deletions .eslintrc

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -190,18 +190,21 @@ describe('chromedash-admin-blink-component-listing', () => {
sandbox.assert.callCount(eventListeners.add, 0);
sandbox.assert.callCount(eventListeners.remove, 0);
});
// eslint-disable-next-line max-len
it('should make successful adminRemoveComponentUser event if removeUserFromComponent OK', async () => {
const alertStub = sandbox.stub(window, 'alert');
// Must select user is currently a subscriber.
element._getOptionsElement().options[1].selected = true;
client.removeUserFromComponent.resolves({});
element._removeUser();
const ev = await oneEvent(element, 'adminRemoveComponentUser');
expect(ev).to.exist;
expect(alertStub).to.have.callCount(0);
sandbox.assert.callCount(eventListeners.add, 0);
sandbox.assert.callCount(eventListeners.remove, 1);
});
it(
'should make successful adminRemoveComponentUser event if ' +
'removeUserFromComponent OK',
async () => {
const alertStub = sandbox.stub(window, 'alert');
// Must select user is currently a subscriber.
element._getOptionsElement().options[1].selected = true;
client.removeUserFromComponent.resolves({});
element._removeUser();
const ev = await oneEvent(element, 'adminRemoveComponentUser');
expect(ev).to.exist;
expect(alertStub).to.have.callCount(0);
sandbox.assert.callCount(eventListeners.add, 0);
sandbox.assert.callCount(eventListeners.remove, 1);
}
);
});
});
1 change: 0 additions & 1 deletion client-src/elements/chromedash-featurelist.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {LitElement, html} from 'lit';
// eslint-disable-next-line no-unused-vars
import './chromedash-feature';
import {FEATURELIST_CSS} from '../css/elements/chromedash-featurelist-css.js';

Expand Down
2 changes: 0 additions & 2 deletions client-src/elements/chromedash-ot-creation-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ export class ChromedashOTCreationPage extends LitElement {
transform: translate(-50%, -50%);
height: 300px;
}
.big-spinner {
}
`,
];
}
Expand Down
2 changes: 1 addition & 1 deletion client-src/js-src/features-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const legendEl = document.querySelector('chromedash-legend');
function debounce(func, threshold_ms = 300) {
let timeout;
return function (...args) {
const context = this; // eslint-disable-line no-invalid-this
const context = this;
const later = () => {
func.apply(context, args);
};
Expand Down
2 changes: 0 additions & 2 deletions client-src/js-src/metric.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-unused-vars */

/**
* Copyright 2016 Google Inc. All rights reserved.
*
Expand Down
2 changes: 0 additions & 2 deletions client-src/js-src/openapi-client.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-unused-vars */

/**
* Copyright 2016 Google Inc. All rights reserved.
*
Expand Down
1 change: 0 additions & 1 deletion client-src/js-src/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
'use strict';

// Google Analytics
/* eslint-disable */
// Global site tag (gtag.js) - Google Analytics
window.dataLayer = window.dataLayer || [];
function gtag() {
Expand Down
53 changes: 53 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import js from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import gts from "./node_modules/gts/build/src/index.js";


export default [
js.configs.recommended,
eslintConfigPrettier,
{
rules: gts.rules,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried to see if these rules are working? I see these issues:

google/gts#847 (comment)
google/gts#830

I don't think anything is stopping us from using the flat config but I couldn't find any examples of gts being configured in the flat config format. So I figured I would ask.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it seems to work. E.g., it complains if I mess up the formatting or have any unused variable.

},
{
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
globals: {
"ga": true,
"Metric": true
},
},
rules: {
"no-warning-comments": "off",
"no-unused-vars": ["error", {
"vars": "all",
"args": "after-used",
"argsIgnorePattern": "^var_args$"
}],
"require-jsdoc": 0,
"valid-jsdoc": "off",
"no-var": 1,
"prettier/prettier": "off",
// TODO: Re-enable these rules from gts.
"eqeqeq": "off",
"no-const-assign": "off",
"no-dupe-class-members": "off",
"no-dupe-keys": "off",
"no-empty-pattern": "off",
"no-prototype-builtins": "off",
"no-self-assign": "off",
"no-undef": "off",
"no-unreachable": "off",
"no-useless-escape": "off",
"node/no-extraneous-import": "off",
"node/no-missing-import": "off",
"node/no-unpublished-import": "off",
},
ignores: [
"**/node_modules/**",
"static/dist/",
"**/*.min.js"
]
}
];
Loading