Skip to content

Commit

Permalink
feat: dep bumps and fixes (#680)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsladerman authored Feb 11, 2025
1 parent a561456 commit 8773ea9
Show file tree
Hide file tree
Showing 26 changed files with 2,008 additions and 1,506 deletions.
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

26 changes: 0 additions & 26 deletions .eslintrc.cjs

This file was deleted.

100 changes: 100 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import { fixupPluginRules } from '@eslint/compat'
import importPlugin from 'eslint-plugin-import'
import prettier from 'eslint-plugin-prettier/recommended'
import react from 'eslint-plugin-react'
import reactHooksPlugin from 'eslint-plugin-react-hooks'
import storybook from 'eslint-plugin-storybook'
import globals from 'globals'
import tseslint from 'typescript-eslint'

export default [
{ ignores: ['/coverage/**/*', '/storybook-static/**/*', '.storybook'] },
...tseslint.configs.recommendedTypeChecked,
react.configs.flat.recommended,
react.configs.flat['jsx-runtime'],
importPlugin.flatConfigs.recommended,
prettier,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
ecmaFeatures: {
jsx: true,
},
},

globals: {
...globals.browser,
},
},

plugins: {
react,
'react-hooks': fixupPluginRules(reactHooksPlugin),
storybook,
},

settings: {
react: {
version: 'detect',
},
},

rules: {
...reactHooksPlugin.configs.recommended.rules,

// Typescript
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-redundant-type-constituents': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/no-duplicate-type-constituents': 'off',
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-base-to-string': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/consistent-type-exports': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],

// React
// Allow css prop for styled-components
'react/no-unknown-property': ['error', { ignore: ['css'] }],
'react/require-default-props': 'off',
'react/destructuring-assignment': 'off',
'react/prop-types': 'off',
'react/display-name': 'off',
'react/jsx-key': 'off',
'react/no-unescaped-entities': 'off',

// Prettier
'prettier/prettier': 'error',

// Other
'import/no-unresolved': 'off',
'import/extensions': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-named-as-default': 'off',
'import/named': 'off',

'no-unused-vars': 'off',
},
},
]
39 changes: 21 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"test:ui": "vitest --ui",
"lint": "prettier --check ./src && eslint . --ext ts,tsx,js,jsx",
"lint": "run-p lint:format lint:js",
"lint:format": "prettier --check ./src",
"lint:js": "eslint ./src",
"fix": "run-s fix:format fix:js",
"fix:format": "prettier --write --no-error-on-unmatched-pattern ./src",
"fix:js": "eslint --fix . --ext ts,tsx,js,jsx",
"fix:js": "eslint ./src --fix",
"prepublishOnly": "npm run build",
"firebase:start": "yarn build:storybook && npx firebase emulators:start"
},
Expand Down Expand Up @@ -80,6 +82,7 @@
"@babel/preset-react": "7.23.3",
"@emotion/react": "11.11.1",
"@emotion/styled": "11.11.0",
"@eslint/compat": "1.1.1",
"@pluralsh/eslint-config-typescript": "2.5.147",
"@react-types/shared": "3.22.0",
"@storybook/addon-actions": "8.3.5",
Expand All @@ -95,28 +98,27 @@
"@testing-library/jest-dom": "5.17.0",
"@types/chroma-js": "2.4.3",
"@types/lodash-es": "4.17.12",
"@types/react": "19.0.2",
"@types/react-dom": "19.0.2",
"@types/react": "19.0.8",
"@types/react-dom": "19.0.3",
"@types/react-transition-group": "4.4.12",
"@typescript-eslint/eslint-plugin": "6.14.0",
"@typescript-eslint/parser": "6.14.0",
"@vitejs/plugin-react": "4.3.2",
"@typescript-eslint/eslint-plugin": "8.24.0",
"@typescript-eslint/parser": "8.24.0",
"@vitejs/plugin-react": "4.3.4",
"@vitest/coverage-v8": "1.0.4",
"@vitest/ui": "1.0.4",
"babel-loader": "9.1.3",
"babel-plugin-styled-components": "2.1.4",
"conventional-changelog-conventionalcommits": "6.1.0",
"eslint": "8.55.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-import-newlines": "1.3.4",
"eslint-plugin-jsx-a11y": "6.8.0",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-react-hooks": "4.6.0",
"eslint": "9.20.0",
"eslint-config-prettier": "10.0.1",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-prettier": "5.2.3",
"eslint-plugin-react": "7.37.4",
"eslint-plugin-react-hooks": "4.6.2",
"eslint-plugin-storybook": "0.6.15",
"firebase-tools": "11.30.0",
"fuse.js": "6.6.2",
"globals": "15.10.0",
"honorable": "1.0.0-beta.17",
"honorable-theme-default": "1.0.0-beta.5",
"http-server": "14.1.1",
Expand All @@ -132,7 +134,8 @@
"rimraf": "5.0.5",
"storybook": "8.3.5",
"styled-components": "6.1.13",
"typescript": "5.6.2",
"typescript": "5.7.3",
"typescript-eslint": "8.24.0",
"vite": "5.4.8",
"vite-plugin-dts": "4.3.0",
"vitest": "2.1.2"
Expand All @@ -154,7 +157,7 @@
"lint-staged": {
"./src/**/*.{js,jsx,ts,tsx}": [
"prettier --write",
"eslint --fix --ext ts,tsx,js,jsx"
"eslint --fix"
]
}
}
}
23 changes: 9 additions & 14 deletions src/components/AppIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,15 @@ import { type styledTheme as theme } from '../theme'

import { type FillLevel, useFillLevel } from './contexts/FillLevelContext'

const HUES = ['default', 'lighter', 'lightest'] as const
const SIZES = [
'xxsmall',
'xsmall',
'small',
'medium',
'large',
'xlarge',
] as const
const SPACINGS = ['none', 'padding'] as const

type AppIconHue = (typeof HUES)[number]
type AppIconSize = (typeof SIZES)[number]
type AppIconSpacing = (typeof SPACINGS)[number]
type AppIconHue = 'default' | 'lighter' | 'lightest'
type AppIconSize =
| 'xxsmall'
| 'xsmall'
| 'small'
| 'medium'
| 'large'
| 'xlarge'
type AppIconSpacing = 'none' | 'padding'

type AppIconProps = {
size?: AppIconSize
Expand Down
11 changes: 7 additions & 4 deletions src/components/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import { Div, Flex, type FlexProps, Span, type SpanProps } from 'honorable'
import { type ReactNode } from 'react'
import styled from 'styled-components'

import { type ColorKey, type SeverityExt, sanitizeSeverity } from '../types'
import { type SeverityExt, sanitizeSeverity } from '../types'

import { SemanticColorKey } from '../theme/colors'
import { FillLevelProvider } from './contexts/FillLevelContext'
import IconFrame from './IconFrame'
import CheckRoundedIcon from './icons/CheckRoundedIcon'
Expand Down Expand Up @@ -32,14 +33,16 @@ export type BannerProps = FlexProps & {
onClose?: () => void
}

const severityToIconColorKey: Readonly<Record<BannerSeverity, ColorKey>> = {
const severityToIconColorKey: Readonly<
Record<BannerSeverity, SemanticColorKey>
> = {
info: 'icon-info',
danger: 'icon-danger',
warning: 'icon-warning',
success: 'icon-success',
}

const severityToBorderColorKey: Record<BannerSeverity, ColorKey> = {
const severityToBorderColorKey: Record<BannerSeverity, SemanticColorKey> = {
info: 'border-info',
danger: 'border-danger',
warning: 'border-warning',
Expand All @@ -54,7 +57,7 @@ const severityToIcon: Record<BannerSeverity, ReturnType<typeof createIcon>> = {
}

const BannerOuter: any = styled.div<{
$borderColorKey: ColorKey
$borderColorKey: SemanticColorKey
$fullWidth?: boolean
}>(({ $borderColorKey, $fullWidth, theme }) => ({
display: 'inline-flex',
Expand Down
1 change: 0 additions & 1 deletion src/components/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ function CalendarGrid({
date={date}
/>
) : (
// eslint-disable-next-line jsx-a11y/control-has-associated-label
<td key={i} />
)
)}
Expand Down
8 changes: 4 additions & 4 deletions src/components/Callout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import styled, { useTheme } from 'styled-components'
import { Flex } from 'honorable'
import AnimateHeight from 'react-animate-height'

import { type ColorKey, type SeverityExt, sanitizeSeverity } from '../types'
import { type SeverityExt, sanitizeSeverity } from '../types'

import { CaretDownIcon, CloseIcon, InfoOutlineIcon } from '../icons'

Expand All @@ -29,6 +29,7 @@ import InfoIcon from './icons/InfoIcon'
import StatusOkIcon from './icons/StatusOkIcon'
import WarningIcon from './icons/WarningIcon'
import IconFrame from './IconFrame'
import { SemanticColorKey } from '../theme/colors'

const CALLOUT_SEVERITIES = [
'info',
Expand All @@ -46,15 +47,15 @@ const DEFAULT_SEVERITY: CalloutSeverity = 'info'

export type CalloutSize = 'compact' | 'full'

const severityToIconColorKey: Record<CalloutSeverity, ColorKey> = {
const severityToIconColorKey: Record<CalloutSeverity, SemanticColorKey> = {
info: 'icon-info',
neutral: 'icon-light',
success: 'icon-success',
warning: 'icon-warning',
danger: 'icon-danger',
}

const severityToBorderColorKey: Record<CalloutSeverity, ColorKey> = {
const severityToBorderColorKey: Record<CalloutSeverity, SemanticColorKey> = {
info: 'border-info',
neutral: 'border-selected',
success: 'border-success',
Expand Down Expand Up @@ -231,7 +232,6 @@ function Callout({
>
<IconFrame
textValue=""
display="flex"
size="small"
clickable
{...(closeable && onClose
Expand Down
4 changes: 1 addition & 3 deletions src/components/Chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ import { Spinner } from './Spinner'
import Tooltip from './Tooltip'

export const CHIP_CLOSE_ATTR_KEY = 'data-close-button' as const
const SIZES = ['small', 'medium', 'large'] as const

export type ChipSize = (typeof SIZES)[number]
export type ChipSize = 'small' | 'medium' | 'large'
export type ChipSeverity = (typeof SEVERITIES)[number]

export type ChipProps = Omit<FlexProps, 'size'> &
Expand Down
Loading

0 comments on commit 8773ea9

Please sign in to comment.