Skip to content

Commit

Permalink
Merge pull request #36 from lxsmnsyc/biome
Browse files Browse the repository at this point in the history
Move to Biome
  • Loading branch information
lxsmnsyc authored Jan 15, 2024
2 parents 7118b78 + f3e072f commit 0bd73ed
Show file tree
Hide file tree
Showing 61 changed files with 1,606 additions and 3,199 deletions.
11 changes: 0 additions & 11 deletions .eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
272 changes: 272 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -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
}
}
}
6 changes: 3 additions & 3 deletions docs/optimizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ function Example(props) {
}
```
> **Note**
> [!NOTE]
> Nested branches are also supported.
List of supported branch statements:
Expand All @@ -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
Expand Down Expand Up @@ -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 */`
Expand Down
18 changes: 0 additions & 18 deletions examples/preact/.eslintrc.cjs

This file was deleted.

2 changes: 0 additions & 2 deletions examples/preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading

0 comments on commit 0bd73ed

Please sign in to comment.