diff --git a/configs/biome-config/README.md b/configs/biome-config/README.md index 8a35357..124f4e4 100644 --- a/configs/biome-config/README.md +++ b/configs/biome-config/README.md @@ -26,11 +26,12 @@ This configuration package has the purpose of store my common configurations use ### 💡️ What you will find? -For now, you will found 4 configurations, being three of them based on the main one: +For now, you will find 5 configurations, being four of them based on the main one: -- **`base.json`**: stores the basic/global configuration with comprehensive linting rules for JavaScript/TypeScript projects; +- **`base.json`**: stores the basic/global configuration with comprehensive linting rules for JavaScript/TypeScript projects (framework-agnostic); +- **`react.json`**: extends base configuration with React-specific linting rules (hooks, fragments, etc.); - **`nestjs.jsonc`:** extends base configuration for **Nest.js** projects (allowing decorators, etc.); -- **`solidjs.json`:** extends base configuration for **SolidJS** projects, changing React-specific rules; +- **`solidjs.json`:** extends base configuration for **SolidJS** projects, with SolidJS-specific rules; - **`nextjs.json`:** extends base configuration for **Next.js** projects (App Router), disabling `noDefaultExport` rule for specific Next.js files that require default exports. ## ✨ Features @@ -94,9 +95,9 @@ To install my package and use it is very simple, you only need to follow the ste Below, you can find examples of usages: -- for a **React** project, using only the base configuration; +- for a **React** project, using the base configuration and React-specific rules; - for a **Nest.js** project, using the base configuration and the specific Nest.js configuration with specific rules; -- for a **Next.js** project, using the base configuration and the specific Next.js configuration with App Router rules. +- for a **Next.js** project, using the base configuration, React configuration, and the specific Next.js configuration with App Router rules. #### React project @@ -104,7 +105,8 @@ Below, you can find examples of usages: { "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", "extends": [ - "@tutods/biome-config" + "@tutods/biome-config", + "@tutods/biome-config/react" ] } ``` @@ -128,6 +130,7 @@ Below, you can find examples of usages: "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", "extends": [ "@tutods/biome-config", + "@tutods/biome-config/react", "@tutods/biome-config/nextjs" ] } diff --git a/configs/biome-config/base.json b/configs/biome-config/base.json index ce8d433..77eb9fd 100644 --- a/configs/biome-config/base.json +++ b/configs/biome-config/base.json @@ -72,18 +72,12 @@ "complexity": { "recommended": true, "noForEach": "off", - "noUselessFragments": { - "level": "error", - "fix": "safe", - "options": {} - }, "noUselessStringConcat": "error", "noUselessTernary": "error", "noUselessEscapeInRegex": "error" }, "correctness": { "recommended": true, - "useHookAtTopLevel": "error", "noUnusedImports": { "fix": "safe", "level": "error", @@ -189,8 +183,6 @@ "useAwaitThenable": "error", "useRegexpExec": "warn", "noEqualsToNull": "error", - "noLeakedRender": "error", - "noDuplicatedSpreadProps": "error", "noAmbiguousAnchorText": "warn", "noMultiStr": "error" }, @@ -202,16 +194,6 @@ } }, "overrides": [ - { - "includes": ["**/*.jsx", "**/*.tsx"], - "linter": { - "rules": { - "style": { - "noImplicitBoolean": "off" - } - } - } - }, { "includes": [ "**/rsbuild.config.ts", diff --git a/configs/biome-config/nestjs.json b/configs/biome-config/nestjs.json index 7f25038..4a1ddcc 100644 --- a/configs/biome-config/nestjs.json +++ b/configs/biome-config/nestjs.json @@ -15,9 +15,6 @@ "style": { "useImportType": "off" }, - "correctness": { - "useHookAtTopLevel": "off" - }, "a11y": { "recommended": false }, diff --git a/configs/biome-config/package.json b/configs/biome-config/package.json index af3af11..6347e12 100644 --- a/configs/biome-config/package.json +++ b/configs/biome-config/package.json @@ -23,6 +23,7 @@ "main": "base.json", "exports": { ".": "./base.json", + "./react": "./react.json", "./nestjs": "./nestjs.json", "./solidjs": "./solidjs.json", "./nextjs": "./nextjs.json" diff --git a/configs/biome-config/react.json b/configs/biome-config/react.json new file mode 100644 index 0000000..41fab94 --- /dev/null +++ b/configs/biome-config/react.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://biomejs.dev/schemas/2.3.10/schema.json", + "linter": { + "rules": { + "complexity": { + "noUselessFragments": { + "level": "error", + "fix": "safe", + "options": {} + } + }, + "correctness": { + "useHookAtTopLevel": "error" + }, + "nursery": { + "noLeakedRender": "error", + "noDuplicatedSpreadProps": "error" + } + } + }, + "overrides": [ + { + "includes": ["**/*.jsx", "**/*.tsx"], + "linter": { + "rules": { + "style": { + "noImplicitBoolean": "off" + } + } + } + } + ] +} diff --git a/configs/biome-config/solidjs.json b/configs/biome-config/solidjs.json index 240f2e3..1cab550 100644 --- a/configs/biome-config/solidjs.json +++ b/configs/biome-config/solidjs.json @@ -7,9 +7,6 @@ "rules": { "suspicious": { "noReactSpecificProps": "error" - }, - "correctness": { - "useHookAtTopLevel": "off" } } },