1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00

[PM-17496] Migrate eslint to flat config (#12806)

The legacy config is deprecated and will be removed in eslint 10. The flat config also allows us to write js functions which will assist in handling limitations with multiple identical rules.
This commit is contained in:
Oscar Hinton
2025-01-28 16:40:52 +01:00
committed by GitHub
parent 08c42a8a27
commit 70ea75d8f7
29 changed files with 469 additions and 447 deletions

View File

@@ -1,7 +1,8 @@
import { dirname, join } from "path";
import { StorybookConfig } from "@storybook/angular";
import TsconfigPathsPlugin from "tsconfig-paths-webpack-plugin";
import remarkGfm from "remark-gfm";
import TsconfigPathsPlugin from "tsconfig-paths-webpack-plugin";
const config: StorybookConfig = {
stories: [
@@ -29,6 +30,8 @@ const config: StorybookConfig = {
getAbsolutePath("@storybook/addon-designs"),
getAbsolutePath("@storybook/addon-interactions"),
{
// @storybook/addon-docs is part of @storybook/addon-essentials
// eslint-disable-next-line storybook/no-uninstalled-addons
name: "@storybook/addon-docs",
options: {
mdxPluginOptions: {

View File

@@ -50,10 +50,14 @@ const darkTheme = create({
});
export const getPreferredColorScheme = () => {
if (!globalThis || !globalThis.matchMedia) return "light";
if (!globalThis || !globalThis.matchMedia) {
return "light";
}
const isDarkThemePreferred = globalThis.matchMedia("(prefers-color-scheme: dark)").matches;
if (isDarkThemePreferred) return "dark";
if (isDarkThemePreferred) {
return "dark";
}
return "light";
};