diff --git a/.eslintrc b/.eslintrc
deleted file mode 100644
index a8427f9..0000000
--- a/.eslintrc
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "root": true,
- "parserOptions": {
- "project": [
- "./packages/*/tsconfig.eslint.json"
- ]
- },
- "extends": [
- "lxsmnsyc/typescript"
- ]
-}
\ No newline at end of file
diff --git a/README.md b/README.md
index 86a136f..0a39100 100644
--- a/README.md
+++ b/README.md
@@ -24,7 +24,7 @@ Forgetti is an auto-memoization Babel plugin I made for a hook-based flow like R
## Why
-> **Note**
+> [!NOTE]
> Please watch the video. Video explains about the problems it solves and benefits it delivers
[![React without memo](https://img.youtube.com/vi/lGEMwh32soc/0.jpg)](https://www.youtube.com/watch?v=lGEMwh32soc "React without memo")
diff --git a/biome.json b/biome.json
new file mode 100644
index 0000000..4ca4f85
--- /dev/null
+++ b/biome.json
@@ -0,0 +1,272 @@
+{
+ "$schema": "https://unpkg.com/@biomejs/biome/configuration_schema.json",
+ "files": {
+ "ignore": ["node_modules/**/*"]
+ },
+ "vcs": {
+ "useIgnoreFile": true
+ },
+ "linter": {
+ "enabled": true,
+ "ignore": ["node_modules/**/*"],
+ "rules": {
+ "a11y": {
+ "noAccessKey": "error",
+ "noAriaHiddenOnFocusable": "off",
+ "noAriaUnsupportedElements": "error",
+ "noAutofocus": "error",
+ "noBlankTarget": "error",
+ "noDistractingElements": "error",
+ "noHeaderScope": "error",
+ "noInteractiveElementToNoninteractiveRole": "error",
+ "noNoninteractiveElementToInteractiveRole": "error",
+ "noNoninteractiveTabindex": "error",
+ "noPositiveTabindex": "error",
+ "noRedundantAlt": "error",
+ "noRedundantRoles": "error",
+ "noSvgWithoutTitle": "error",
+ "useAltText": "error",
+ "useAnchorContent": "error",
+ "useAriaActivedescendantWithTabindex": "error",
+ "useAriaPropsForRole": "error",
+ "useButtonType": "error",
+ "useHeadingContent": "error",
+ "useHtmlLang": "error",
+ "useIframeTitle": "warn",
+ "useKeyWithClickEvents": "warn",
+ "useKeyWithMouseEvents": "warn",
+ "useMediaCaption": "error",
+ "useValidAnchor": "error",
+ "useValidAriaProps": "error",
+ "useValidAriaRole": "error",
+ "useValidAriaValues": "error",
+ "useValidLang": "error"
+ },
+ "complexity": {
+ "noBannedTypes": "error",
+ "noExcessiveCognitiveComplexity": "error",
+ "noExtraBooleanCast": "error",
+ "noForEach": "error",
+ "noMultipleSpacesInRegularExpressionLiterals": "warn",
+ "noStaticOnlyClass": "error",
+ "noThisInStatic": "error",
+ "noUselessCatch": "error",
+ "noUselessConstructor": "error",
+ "noUselessEmptyExport": "error",
+ "noUselessFragments": "error",
+ "noUselessLabel": "error",
+ "noUselessRename": "error",
+ "noUselessSwitchCase": "error",
+ "noUselessThisAlias": "error",
+ "noUselessTypeConstraint": "error",
+ "noVoid": "off",
+ "noWith": "error",
+ "useArrowFunction": "error",
+ "useFlatMap": "error",
+ "useLiteralKeys": "error",
+ "useOptionalChain": "warn",
+ "useRegexLiterals": "error",
+ "useSimpleNumberKeys": "error",
+ "useSimplifiedLogicExpression": "error"
+ },
+ "correctness": {
+ "noChildrenProp": "error",
+ "noConstantCondition": "error",
+ "noConstAssign": "error",
+ "noConstructorReturn": "error",
+ "noEmptyCharacterClassInRegex": "error",
+ "noEmptyPattern": "error",
+ "noGlobalObjectCalls": "error",
+ "noInnerDeclarations": "error",
+ "noInvalidConstructorSuper": "error",
+ "noInvalidNewBuiltin": "error",
+ "noNewSymbol": "error",
+ "noNonoctalDecimalEscape": "error",
+ "noPrecisionLoss": "error",
+ "noRenderReturnValue": "error",
+ "noSelfAssign": "error",
+ "noSetterReturn": "error",
+ "noStringCaseMismatch": "error",
+ "noSwitchDeclarations": "error",
+ "noUndeclaredVariables": "error",
+ "noUnnecessaryContinue": "error",
+ "noUnreachable": "error",
+ "noUnreachableSuper": "error",
+ "noUnsafeFinally": "error",
+ "noUnsafeOptionalChaining": "error",
+ "noUnusedLabels": "error",
+ "noUnusedVariables": "error",
+ "noVoidElementsWithChildren": "error",
+ "noVoidTypeReturn": "error",
+ "useExhaustiveDependencies": "error",
+ "useHookAtTopLevel": "error",
+ "useIsNan": "error",
+ "useValidForDirection": "error",
+ "useYield": "error"
+ },
+ "performance": {
+ "noAccumulatingSpread": "error",
+ "noDelete": "off"
+ },
+ "security": {
+ "noDangerouslySetInnerHtml": "error",
+ "noDangerouslySetInnerHtmlWithChildren": "error"
+ },
+ "style": {
+ "noArguments": "error",
+ "noCommaOperator": "off",
+ "noDefaultExport": "off",
+ "noImplicitBoolean": "error",
+ "noInferrableTypes": "error",
+ "noNamespace": "error",
+ "noNegationElse": "error",
+ "noNonNullAssertion": "off",
+ "noParameterAssign": "off",
+ "noParameterProperties": "off",
+ "noRestrictedGlobals": "error",
+ "noShoutyConstants": "error",
+ "noUnusedTemplateLiteral": "error",
+ "noUselessElse": "error",
+ "noVar": "error",
+ "useAsConstAssertion": "error",
+ "useBlockStatements": "error",
+ "useCollapsedElseIf": "error",
+ "useConst": "error",
+ "useDefaultParameterLast": "error",
+ "useEnumInitializers": "error",
+ "useExponentiationOperator": "error",
+ "useFragmentSyntax": "error",
+ "useLiteralEnumMembers": "error",
+ "useNamingConvention": "off",
+ "useNumericLiterals": "error",
+ "useSelfClosingElements": "error",
+ "useShorthandArrayType": "error",
+ "useShorthandAssign": "error",
+ "useSingleCaseStatement": "error",
+ "useSingleVarDeclarator": "error",
+ "useTemplate": "off",
+ "useWhile": "error"
+ },
+ "suspicious": {
+ "noApproximativeNumericConstant": "error",
+ "noArrayIndexKey": "error",
+ "noAssignInExpressions": "error",
+ "noAsyncPromiseExecutor": "error",
+ "noCatchAssign": "error",
+ "noClassAssign": "error",
+ "noCommentText": "error",
+ "noCompareNegZero": "error",
+ "noConfusingLabels": "error",
+ "noConfusingVoidType": "error",
+ "noConsoleLog": "warn",
+ "noConstEnum": "off",
+ "noControlCharactersInRegex": "error",
+ "noDebugger": "off",
+ "noDoubleEquals": "error",
+ "noDuplicateCase": "error",
+ "noDuplicateClassMembers": "error",
+ "noDuplicateJsxProps": "error",
+ "noDuplicateObjectKeys": "error",
+ "noDuplicateParameters": "error",
+ "noEmptyInterface": "error",
+ "noExplicitAny": "warn",
+ "noExtraNonNullAssertion": "error",
+ "noFallthroughSwitchClause": "error",
+ "noFunctionAssign": "error",
+ "noGlobalIsFinite": "error",
+ "noGlobalIsNan": "error",
+ "noImplicitAnyLet": "off",
+ "noImportAssign": "error",
+ "noLabelVar": "error",
+ "noMisleadingInstantiator": "error",
+ "noMisrefactoredShorthandAssign": "off",
+ "noPrototypeBuiltins": "error",
+ "noRedeclare": "error",
+ "noRedundantUseStrict": "error",
+ "noSelfCompare": "off",
+ "noShadowRestrictedNames": "error",
+ "noSparseArray": "off",
+ "noUnsafeDeclarationMerging": "error",
+ "noUnsafeNegation": "error",
+ "useDefaultSwitchClauseLast": "error",
+ "useGetterReturn": "error",
+ "useIsArray": "error",
+ "useNamespaceKeyword": "error",
+ "useValidTypeof": "error"
+ },
+ "nursery": {
+ "noDuplicateJsonKeys": "off",
+ "noEmptyBlockStatements": "error",
+ "noEmptyTypeParameters": "error",
+ "noGlobalEval": "off",
+ "noGlobalAssign": "error",
+ "noInvalidUseBeforeDeclaration": "error",
+ "noMisleadingCharacterClass": "error",
+ "noNodejsModules": "off",
+ "noThenProperty": "warn",
+ "noUnusedImports": "error",
+ "noUnusedPrivateClassMembers": "error",
+ "noUselessLoneBlockStatements": "error",
+ "noUselessTernary": "error",
+ "useAwait": "error",
+ "useConsistentArrayType": "error",
+ "useExportType": "error",
+ "useFilenamingConvention": "off",
+ "useForOf": "warn",
+ "useGroupedTypeImport": "error",
+ "useImportRestrictions": "off",
+ "useImportType": "error",
+ "useNodejsImportProtocol": "warn",
+ "useNumberNamespace": "error",
+ "useShorthandFunctionType": "warn"
+ }
+ }
+ },
+ "formatter": {
+ "enabled": true,
+ "ignore": ["node_modules/**/*"],
+ "formatWithErrors": false,
+ "indentWidth": 2,
+ "indentStyle": "space",
+ "lineEnding": "lf",
+ "lineWidth": 80
+ },
+ "organizeImports": {
+ "enabled": true,
+ "ignore": ["node_modules/**/*"]
+ },
+ "javascript": {
+ "formatter": {
+ "enabled": true,
+ "arrowParentheses": "asNeeded",
+ "bracketSameLine": false,
+ "bracketSpacing": true,
+ "indentWidth": 2,
+ "indentStyle": "space",
+ "jsxQuoteStyle": "double",
+ "lineEnding": "lf",
+ "lineWidth": 80,
+ "quoteProperties": "asNeeded",
+ "quoteStyle": "single",
+ "semicolons": "always",
+ "trailingComma": "all"
+ },
+ "globals": [],
+ "parser": {
+ "unsafeParameterDecoratorsEnabled": true
+ }
+ },
+ "json": {
+ "formatter": {
+ "enabled": true,
+ "indentWidth": 2,
+ "indentStyle": "space",
+ "lineEnding": "lf",
+ "lineWidth": 80
+ },
+ "parser": {
+ "allowComments": false,
+ "allowTrailingCommas": false
+ }
+ }
+}
diff --git a/docs/optimizations.md b/docs/optimizations.md
index f08ff24..629b2e3 100644
--- a/docs/optimizations.md
+++ b/docs/optimizations.md
@@ -378,7 +378,7 @@ function Example(props) {
}
```
-> **Note**
+> [!NOTE]
> Nested branches are also supported.
List of supported branch statements:
@@ -389,7 +389,7 @@ List of supported branch statements:
- block statements
- labeled statements
-> **Note**
+> [!NOTE]
> Branched statements are usually illegal in a hook-based system (like React), but a `memo` or `callback` call inside the branches are allowed.
#### Loops
@@ -463,7 +463,7 @@ function Example(props) {
}
```
-> **Note**
+> [!NOTE]
> You can use `/* @forgetti skip */` just before the JSX if you want to opt-out of this feature.
## `/* @forgetti skip */`
diff --git a/examples/preact/.eslintrc.cjs b/examples/preact/.eslintrc.cjs
deleted file mode 100644
index e98af6d..0000000
--- a/examples/preact/.eslintrc.cjs
+++ /dev/null
@@ -1,18 +0,0 @@
-module.exports = {
- "root": true,
- "extends": [
- "lxsmnsyc/typescript/react"
- ],
- "parserOptions": {
- "project": "./tsconfig.eslint.json",
- "tsconfigRootDir": __dirname,
- },
- "rules": {
- "import/no-extraneous-dependencies": [
- "error", {
- "devDependencies": ["**/*.test.ts"]
- }
- ],
- "no-param-reassign": "off"
- }
-};
\ No newline at end of file
diff --git a/examples/preact/package.json b/examples/preact/package.json
index 66fdb2f..cd50425 100644
--- a/examples/preact/package.json
+++ b/examples/preact/package.json
@@ -8,8 +8,6 @@
},
"devDependencies": {
"@preact/preset-vite": "^2.6.0",
- "eslint": "^8.51.0",
- "eslint-config-lxsmnsyc": "^0.6.5",
"typescript": "^5.2.2",
"vite": "^4.5.0",
"vite-plugin-forgetti": "0.7.2"
diff --git a/examples/preact/src/App.tsx b/examples/preact/src/App.tsx
index 4342893..6fb9aa8 100644
--- a/examples/preact/src/App.tsx
+++ b/examples/preact/src/App.tsx
@@ -15,26 +15,24 @@ interface TodoListItemProps {
function TodoListItem({ item, setList }: TodoListItemProps): JSX.Element {
return (
-
-
- {item.message}
-
+
+
{item.message}