Skip to content

Commit

Permalink
fix: lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
henrynoowah committed Jan 15, 2025
1 parent edaf561 commit 6e18323
Show file tree
Hide file tree
Showing 10 changed files with 340 additions and 374 deletions.
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build": "storybook build --docs",
"start": "serve storybook-static -p 6006",
"clean": "rm -rf .turbo && rm -rf node_modules",
"lint": "eslint ./stories/*.stories.tsx --max-warnings 0 --flag unstable_ts_config"
"lint": "eslint ./stories/*.stories.tsx --max-warnings 0"
},
"dependencies": {
"@noowah/content-builder": "workspace:*",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"@changesets/cli": "^2.27.1",
"prettier": "^3.2.5",
"turbo": "^2.0.3",
"typescript": "^5.5.4"
"typescript": "^5.5.4",
"eslint": "^9.18.0"
},
"engines": {
"node": ">=18"
Expand Down
3 changes: 1 addition & 2 deletions packages/config-eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@
"./storybook": "./storybook.ts"
},
"devDependencies": {
"@eslint/js": "^9.17.0",
"@eslint/js": "^9.18.0",
"@next/eslint-plugin-next": "^15.1.0",
"@types/eslint-config-prettier": "^6.11.3",
"@typescript-eslint/eslint-plugin": "^8.15.0",
"@typescript-eslint/parser": "^8.15.0",
"eslint": "^9.15.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-only-warn": "^1.1.0",
"eslint-plugin-storybook": "^0.11.2",
Expand Down
13 changes: 12 additions & 1 deletion packages/config-eslint/react-internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,18 @@ const config = [
plugins: {
"react-hooks": hooksPlugin,
},
rules: hooksPlugin.configs.recommended.rules,
rules: {
...hooksPlugin.configs.recommended.rules,
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"react-hooks/exhaustive-deps": "off",
},
},
eslintConfigPrettier,
];
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "MIT",
"scripts": {
"build": "npm run build:tailwind & tsup --clean",
"lint": "tsc --noEmit",
"lint": "eslint src/**/*.tsx --max-warnings 0",
"dev": "concurrently \"npm run watch:tailwind --watch\" \"tsup --watch\"",
"watch:tailwind": "npx tailwind -i ./src/global.css -o ./dist/index.css --watch",
"build:tailwind": "npx tailwind -i ./src/global.css -o ./dist/index.css",
Expand Down
52 changes: 25 additions & 27 deletions packages/ui/src/components/editor/block-editor/BlockEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,31 @@ interface BlockProps {
resizable?: boolean;
}

const BlockEditor = forwardRef<Block, BlockProps>(
({ block, onChange, bounds, onClick }, _) => {
switch (block.type) {
case "html":
return (
<TiptapEditor
key={`section-block-container-${block.id}`}
content={block.content}
onUpdate={(value) => onChange?.({ ...block, content: value })}
/>
);
case "gallery":
return (
<Carousel key={`section-block-container-${block.id}`} {...block} />
);
case "image":
return (
<ImageBlock
key={`section-block-container-${block.id}`}
block={block}
onChange={(block) => onChange?.({ ...block })}
/>
);
default:
return null;
}
const BlockEditor = forwardRef<Block, BlockProps>(({ block, onChange }, _) => {
switch (block.type) {
case "html":
return (
<TiptapEditor
key={`section-block-container-${block.id}`}
content={block.content}
onUpdate={(value) => onChange?.({ ...block, content: value })}
/>
);
case "gallery":
return (
<Carousel key={`section-block-container-${block.id}`} {...block} />
);
case "image":
return (
<ImageBlock
key={`section-block-container-${block.id}`}
block={block}
onChange={(block) => onChange?.({ ...block })}
/>
);
default:
return null;
}
);
});

export default BlockEditor;
Loading

0 comments on commit 6e18323

Please sign in to comment.