web: update to ESLint 9 (#10812)

* web: update to ESLint 9

ESLint 9 has been out for awhile now, and all of the plug-ins that we use have caught up, so it is
time to bite the bullet and upgrade.  This commit:

- upgrades to ESLint 9, and upgrades all associated plugins
- Replaces the `.eslintrc` and `.eslintignore` files with the new, "flat" configuration file,
  "eslint.config.mjs".
- Places the previous "precommit" and "nightmare" rules in `./scripts/eslint.precommit.mjs` and
  `./scripts/eslint.nightmare.mjs`, respectively
- Replaces the scripted wrappers for eslint (`eslint`, `eslint-precommit`) with a single executable
  that takes the arguments `--precommit`, which applies a stricter set of rules, and `--nightmare`,
  which applies an even more terrifyingly strict set of rules.
- Provides the scripted wrapper `./scripts/eslint.mjs` so that eslint can be run from `bun`, if one
  so chooses.
- Fixes *all* of the lint `eslint.config.mjs` now finds, including removing all of the `eslint`
  styling rules and overrides because Eslint now proudly leaves that entirely up to Prettier.

To shut Dependabot up about ESLint.

* Added explanation for no-console removal.

* web: did not need the old and unmaintained nightmare mode; it can be configured directly.
This commit is contained in:
Ken Sternberg
2024-08-07 15:04:18 -07:00
committed by GitHub
parent 322ae4c4ed
commit 79c01ca473
34 changed files with 5658 additions and 5076 deletions

View File

@ -26,11 +26,6 @@ const selectStyles = css`
*/
@customElement("ak-multi-select")
export class AkMultiSelect extends AkControlElement {
constructor() {
super();
this.dataset.akControl = "true";
}
static get styles() {
return [PFBase, PFForm, PFFormControl, selectStyles];
}
@ -94,6 +89,11 @@ export class AkMultiSelect extends AkControlElement {
return this.values;
}
connectedCallback() {
super.connectedCallback();
this.dataset.akControl = "true";
}
renderHelp() {
return [
this.help ? html`<p class="pf-c-form__helper-text">${this.help}</p>` : nothing,

View File

@ -8,8 +8,11 @@ import { classMap } from "lit/directives/class-map.js";
import PFLabel from "@patternfly/patternfly/components/Label/label.css";
import PFBase from "@patternfly/patternfly/patternfly-base.css";
const statusNames = ["error", "warning", "info"] as const;
type StatusName = (typeof statusNames)[number];
// The 'const ... as const' construction will throw a compilation error if the const variable is
// only ever used to generate the type information, so the `_` (ignore unused variable) prefix must
// be used here.
const _statusNames = ["error", "warning", "info"] as const;
type StatusName = (typeof _statusNames)[number];
const statusToDetails = new Map<StatusName, [string, string]>([
["error", ["pf-m-red", "fa-times"]],