Skip to content

Commit 50ad55d

Browse files
committed
furystack migrations, added eslint plugin
1 parent 2e52b4f commit 50ad55d

17 files changed

Lines changed: 35 additions & 18 deletions

.cursor/rules/CODE_STYLE.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ type MyComponentProps = {
217217

218218
// 3. Component
219219
export const MyComponent = Shade<MyComponentProps>({
220-
shadowDomName: 'my-component',
220+
customElementName: 'my-component',
221221
render: ({ props }) => {
222222
return <div>{props.title}</div>;
223223
},

.cursor/rules/TYPESCRIPT_GUIDELINES.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ type MonacoEditorProps = {
9494
};
9595

9696
export const MonacoEditor = Shade<MonacoEditorProps>({
97-
shadowDomName: 'monaco-editor',
97+
customElementName: 'monaco-editor',
9898
render: ({ props }) => {
9999
return (
100100
<div data-testid="editor">

eslint.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import eslint from '@eslint/js'
44
import prettierConfig from 'eslint-config-prettier'
5+
import furystack from '@furystack/eslint-plugin'
56
import jsdoc from 'eslint-plugin-jsdoc'
67
import playwright from 'eslint-plugin-playwright'
78
import tseslint from 'typescript-eslint'
@@ -43,8 +44,11 @@ export default tseslint.config(
4344
},
4445
plugins: {
4546
jsdoc,
47+
furystack,
4648
},
4749
rules: {
50+
...furystack.configs.recommendedStrict.rules,
51+
...furystack.configs.shadesStrict.rules,
4852
'@typescript-eslint/no-unused-vars': 'off', // Use Typescript own check for this
4953
'@typescript-eslint/ban-types': 'off',
5054
'@typescript-eslint/explicit-member-accessibility': [

frontend/src/components/body.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ValidatePage } from '../pages/validate.js'
44
import { Home } from '../pages/home.js'
55

66
export const Body = Shade({
7-
shadowDomName: 'shade-app-body',
7+
customElementName: 'shade-app-body',
88
render: () => {
99
return (
1010
<NestedRouter

frontend/src/components/github-logo/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable @typescript-eslint/ban-ts-comment */
22
import { createComponent, Shade } from '@furystack/shades'
3-
import { ThemeProviderService } from '@furystack/shades-common-components'
3+
import { getTextColor, ThemeProviderService } from '@furystack/shades-common-components'
44
// @ts-ignore
55
import ghLight from './gh-light.png'
66
// @ts-ignore
@@ -11,17 +11,17 @@ type GithubLogoProps = Omit<Partial<HTMLImageElement>, 'style' | 'src' | 'alt'>
1111
}
1212

1313
export const GithubLogo = Shade<GithubLogoProps>({
14-
shadowDomName: 'github-logo',
14+
customElementName: 'github-logo',
1515

1616
render: ({ props, useDisposable, useState, injector }) => {
1717
const themeProvider = injector.getInstance(ThemeProviderService)
1818
const [theme, setTheme] = useState(
1919
'themeName',
20-
themeProvider.getTextColor(themeProvider.theme.background.paper, 'light', 'dark'),
20+
getTextColor(themeProvider.theme.background.paper, 'light', 'dark'),
2121
)
2222
useDisposable('themeChange', () =>
2323
themeProvider.subscribe('themeChanged', () => {
24-
const value = themeProvider.getTextColor(themeProvider.theme.background.paper, 'light', 'dark')
24+
const value = getTextColor(themeProvider.theme.background.paper, 'light', 'dark')
2525
setTheme(value)
2626
}),
2727
)

frontend/src/components/header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const AppBarLink = styledShade(ShadeAppBarLink, {
1010
})
1111

1212
export const Header = Shade({
13-
shadowDomName: 'shade-app-header',
13+
customElementName: 'shade-app-header',
1414
render: () => {
1515
return (
1616
<AppBar id="header">

frontend/src/components/json-schema-selector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type JsonSchemaSelectorProps = {
88
}
99

1010
export const JsonSchemaSelector = Shade<JsonSchemaSelectorProps>({
11-
shadowDomName: 'shade-json-schema-selector',
11+
customElementName: 'shade-json-schema-selector',
1212
css: {
1313
'& .material-symbols-outlined': {
1414
fontSize: '1.15em',

frontend/src/components/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Body } from './body.js'
44
import { Header } from './header.js'
55

66
export const Layout = Shade({
7-
shadowDomName: 'shade-app-layout',
7+
customElementName: 'shade-app-layout',
88
render: () => {
99
return (
1010
<PageLayout

frontend/src/components/monaco/monaco-diff-editor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export type MonacoDiffEditorProps = {
1717
}
1818

1919
export const MonacoDiffEditor = Shade<MonacoDiffEditorProps>({
20-
shadowDomName: 'monaco-diff-editor',
20+
customElementName: 'monaco-diff-editor',
2121
render: ({ useRef, useDisposable, injector, props, useHostProps }) => {
2222
const containerRef = useRef<HTMLDivElement>('container')
2323
const themeProvider = injector.getInstance(ThemeProviderService)

frontend/src/components/monaco/monaco-editor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export type MonacoEditorProps = {
1717
}
1818

1919
export const MonacoEditor = Shade<MonacoEditorProps>({
20-
shadowDomName: 'monaco-editor',
20+
customElementName: 'monaco-editor',
2121
render: ({ useRef, useDisposable, injector, props, useHostProps }) => {
2222
const containerRef = useRef<HTMLDivElement>('container')
2323
const themeProvider = injector.getInstance(ThemeProviderService)

0 commit comments

Comments
 (0)