Bug 1895692 - turn off import/no-unassigned-import for storybook files, r=reusable-components-reviewers,frontend-codestyle-reviewers,hjones

Differential Revision: https://phabricator.services.mozilla.com/D210475
This commit is contained in:
Gijs Kruitbosch 2024-05-15 16:08:57 +00:00
parent 55089cab2f
commit 6caf5c363c
26 changed files with 10 additions and 29 deletions

View File

@ -129,6 +129,16 @@ module.exports = {
"import/no-useless-path-segments": "error",
},
},
{
// Turn off no-unassigned-import for files that typically test our
// custom elements, which are imported for the side effects (ie
// the custom element being registered) rather than any particular
// export:
files: ["**/*.stories.mjs"],
rules: {
"import/no-unassigned-import": "off",
},
},
{
files: [
// Bug 1773475 - For now, turn off no-unresolved on some paths where we import

View File

@ -4,11 +4,8 @@
// eslint-disable-next-line import/no-unresolved
import { html } from "lit.all.mjs";
// eslint-disable-next-line import/no-unassigned-import
import "./login-password-field.mjs";
// eslint-disable-next-line import/no-unassigned-import
import "./login-username-field.mjs";
// eslint-disable-next-line import/no-unassigned-import
import "./login-origin-field.mjs";
export default {

View File

@ -4,7 +4,6 @@
// eslint-disable-next-line import/no-unresolved
import { html } from "lit.all.mjs";
// eslint-disable-next-line import/no-unassigned-import
import "./login-alert.mjs";
export default {

View File

@ -4,7 +4,6 @@
// eslint-disable-next-line import/no-unresolved
import { html } from "lit.all.mjs";
// eslint-disable-next-line import/no-unassigned-import
import "./login-list-lit-item.mjs";
export default {

View File

@ -4,7 +4,6 @@
// eslint-disable-next-line import/no-unresolved
import { html } from "lit.all.mjs";
// eslint-disable-next-line import/no-unassigned-import
import "./backup-settings.mjs";
export default {

View File

@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { html } from "lit.all.mjs";
// eslint-disable-next-line import/no-unassigned-import
import "browser/components/firefoxview/fxview-tab-list.mjs";
const DATE_TIME_FORMATS = {

View File

@ -4,7 +4,6 @@
// eslint-disable-next-line import/no-unresolved
import { html, ifDefined } from "lit.all.mjs";
// eslint-disable-next-line import/no-unassigned-import
import "browser/components/shopping/content/letter-grade.mjs";
export default {

View File

@ -4,7 +4,6 @@
import { html } from "lit.all.mjs";
// Imported for side-effects.
// eslint-disable-next-line import/no-unassigned-import
import "../../aboutlogins/content/components/login-command-button.mjs";
const BUTTON_TYPES = {

View File

@ -4,7 +4,6 @@
import { html } from "lit.all.mjs";
// Imported for side-effects.
// eslint-disable-next-line import/no-unassigned-import
import "../../aboutlogins/content/components/login-timeline.mjs";
export default {

View File

@ -4,14 +4,11 @@
// Imported for side-effects.
import { html } from "lit.all.mjs";
// eslint-disable-next-line import/no-unassigned-import
import "chrome://global/content/elements/panel-list.js";
// eslint-disable-next-line import/no-unassigned-import
import "browser/components/migration/content/migration-wizard.mjs";
import { MigrationWizardConstants } from "chrome://browser/content/migration/migration-wizard-constants.mjs";
// Imported for side-effects.
// eslint-disable-next-line import/no-unassigned-import
import "toolkit-widgets/named-deck.js";
export default {

View File

@ -4,7 +4,6 @@
import { html } from "lit.all.mjs";
// Imported for side-effects.
// eslint-disable-next-line import/no-unassigned-import
import "toolkit-widgets/named-deck.js";
export default {

View File

@ -4,7 +4,6 @@
// eslint-disable-next-line import/no-unresolved
import { html, ifDefined } from "lit.all.mjs";
// eslint-disable-next-line import/no-unassigned-import
import "browser/components/shopping/content/shopping-card.mjs";
export default {

View File

@ -4,7 +4,6 @@
// eslint-disable-next-line import/no-unresolved
import { html, ifDefined } from "lit.all.mjs";
// eslint-disable-next-line import/no-unassigned-import
import "browser/components/shopping/content/shopping-container.mjs";
// Bug 1845737: These should get imported by ShoppingMessageBar
window.MozXULElement.insertFTLIfNeeded("browser/shopping.ftl");

View File

@ -4,7 +4,6 @@
// eslint-disable-next-line import/no-unresolved
import { html, ifDefined } from "lit.all.mjs";
// eslint-disable-next-line import/no-unassigned-import
import "browser/components/shopping/content/shopping-message-bar.mjs";
window.MozXULElement.insertFTLIfNeeded("browser/shopping.ftl");

View File

@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { html } from "../../content/widgets/vendor/lit.all.mjs";
// eslint-disable-next-line import/no-unassigned-import
import "chrome://global/content/reader/color-input.mjs";
export default {

View File

@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { html } from "../../content/widgets/vendor/lit.all.mjs";
// eslint-disable-next-line import/no-unassigned-import
import "chrome://global/content/reader/moz-slider.mjs";
export default {

View File

@ -45,7 +45,6 @@ customElements.define("{element_name}", {class_name});
STORY_HEADER = """{license}
{html_lit_import}
// eslint-disable-next-line import/no-unassigned-import
{fixme_comment}import "{element_path}";
export default {{

View File

@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { html, ifDefined } from "../vendor/lit.all.mjs";
// eslint-disable-next-line import/no-unassigned-import
import "./moz-button.mjs";
export default {

View File

@ -4,7 +4,6 @@
// eslint-disable-next-line import/no-unresolved
import { classMap, html, ifDefined } from "lit.all.mjs";
// eslint-disable-next-line import/no-unassigned-import
import "./moz-card.mjs";
export default {

View File

@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { html, ifDefined } from "../vendor/lit.all.mjs";
// eslint-disable-next-line import/no-unassigned-import
import "./moz-five-star.mjs";
export default {

View File

@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { html, ifDefined } from "../vendor/lit.all.mjs";
// eslint-disable-next-line import/no-unassigned-import
import "./moz-label.mjs";
MozXULElement.insertFTLIfNeeded("locales-preview/moz-label.storybook.ftl");

View File

@ -1,7 +1,6 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-disable import/no-unassigned-import */
import { html, ifDefined } from "../vendor/lit.all.mjs";
import "./moz-message-bar.mjs";

View File

@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { html, when } from "../vendor/lit.all.mjs";
// eslint-disable-next-line import/no-unassigned-import
import "./moz-page-nav.mjs";
export default {

View File

@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { html, ifDefined } from "../vendor/lit.all.mjs";
// eslint-disable-next-line import/no-unassigned-import
import "./moz-support-link.mjs";
MozXULElement.insertFTLIfNeeded(

View File

@ -1,7 +1,6 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-disable import/no-unassigned-import */
import { html, ifDefined } from "../vendor/lit.all.mjs";
import "./moz-toggle.mjs";

View File

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// eslint-disable-next-line import/no-unassigned-import
import "./panel-list.js";
import { html, ifDefined } from "../vendor/lit.all.mjs";