Skip to content

Commit

Permalink
test biome
Browse files Browse the repository at this point in the history
  • Loading branch information
MP281X committed Jun 21, 2024
1 parent da943e9 commit bd1013c
Show file tree
Hide file tree
Showing 18 changed files with 185 additions and 3,679 deletions.
28 changes: 8 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# @mp281x/shared-config

A shared configuration package for ESLint, Prettier, and TypeScript.
A shared configuration package for Biome and TypeScript.
This package enforces strict coding standards to ensure uniform code style and prevent subtle bugs.

## Features

- Strict ESLint, Prettier, and TypeScript settings.
- Strict Biome and TypeScript settings.
- Scripts for linting and cleaning the project

## Installation
Expand All @@ -21,8 +21,7 @@ To configure the package, use the following `package.json` or merge it with your
"lint": "shared-config-lint",
"setup": "shared-config-setup"
},
"devDependencies": { "@mp281x/shared-config": "latest" },
"pnpm": { "peerDependencyrules": { "allowedVersions": { "eslint": "*" } } }
"devDependencies": { "@mp281x/shared-config": "latest" }
}
```

Expand All @@ -33,23 +32,13 @@ Put these configs in the respective files
### tsconfig.json

```jsonc
{
"extends": ["@mp281x/shared-config/tsconfig"],
"include": ["index.ts", "src/**/*", "*.config.*"],
"exclude": ["**/node_modules", "**/.*/", "**/dist"]
}
```

### eslint.config.js

```js
export { default } from '@mp281x/shared-config/eslint'
{ "extends": ["@mp281x/shared-config/tsconfig"] }
```

### prettier.config.js
### biome.json

```js
export { default } from '@mp281x/shared-config/prettier'
{ "extends": ["@mp281x/shared-config/biome"] }
```

### .gitignore
Expand All @@ -67,7 +56,6 @@ export { default } from '@mp281x/shared-config/prettier'

# generated files
**/*.g.ts
**/.eslintcache
**/*.tsbuildinfo

# vite
Expand All @@ -91,10 +79,10 @@ Prepend your command with x

```json
{
"scripts": "x next dev --turbo"
"scripts": "x vite dev"
}
```

```sh
pnpm run x next dev --turbo
pnpm run x vite dev
```
1 change: 1 addition & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "extends": ["configs/biome.jsonc"] }
63 changes: 63 additions & 0 deletions configs/biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"$schema": "../node_modules/@biomejs/biome/configuration_schema.json",
"organizeImports": { "enabled": true },
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
"formatter": {
"ignore": ["**/*.g.ts", "**/vite-env.d.ts", "ok/**"],
"enabled": true,
"formatWithErrors": true,
"lineWidth": 120,
"lineEnding": "lf",
"indentWidth": 2,
"indentStyle": "tab",
"attributePosition": "auto"
},
"linter": {
"ignore": ["**/*.g.ts", "**/vite-env.d.ts", "ok/**"],
"enabled": true,
"rules": {
"all": true,
"suspicious": {
"useAwait": "error",
"noConsoleLog": "off",
"noArrayIndexKey": "off"
},
"nursery": {
"noEmptyBlock": "off",
"useSortedClasses": "error"
},
"complexity": {
"noVoid": "off",
"useArrowFunction": "error",
"useLiteralKeys": "off",
"noUselessTypeConstraint": "off",
"noForEach": "off"
},
"style": {
"noDefaultExport": "off",
"useShorthandArrayType": "error",
"useBlockStatements": "off",
"useTemplate": "off",
"noNonNullAssertion": "off"
},
"correctness": {
"noNodejsModules": "off",
"noUnusedVariables": "off",
"noUndeclaredVariables": "off",
"noChildrenProp": "off"
}
}
},
"javascript": {
"formatter": {
"trailingCommas": "none",
"jsxQuoteStyle": "double",
"quoteStyle": "single",
"arrowParentheses": "asNeeded",
"quoteProperties": "asNeeded",
"bracketSpacing": true,
"bracketSameLine": false,
"semicolons": "asNeeded"
}
}
}
Loading

0 comments on commit bd1013c

Please sign in to comment.