diff --git a/biome.json b/biome.json new file mode 100644 index 000000000..cbf239d79 --- /dev/null +++ b/biome.json @@ -0,0 +1,17 @@ +{ + "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", + "files": { + "ignore": ["**/node_modules", "**/dist", "**/types", ".vscode", ".idea"] + }, + "formatter": { + "indentStyle": "space", + "indentSize": 2 + }, + "javascript": { + "formatter": { + "quoteStyle": "single", + "trailingComma": "none", + "semicolons": "asNeeded" + } + } +} diff --git a/commitlint.config.js b/commitlint.config.js index 88f7e9a58..47d88982e 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1,7 +1,7 @@ module.exports = { - extends: [ 'gitmoji' ], - rules: { - 'subject-case': [2, 'always', 'sentence-case'], - 'header-max-length': [2, 'always', 72], - } + extends: ['gitmoji'], + rules: { + 'subject-case': [2, 'always', 'sentence-case'], + 'header-max-length': [2, 'always', 72] + } } diff --git a/examples/greetings-esm/src/example.ts b/examples/greetings-esm/src/example.ts index 864748448..195e896dd 100644 --- a/examples/greetings-esm/src/example.ts +++ b/examples/greetings-esm/src/example.ts @@ -1,6 +1,6 @@ -import {bye, hello, sayHello} from 'greetings' +import { bye, hello, sayHello } from 'greetings' -sayHello("Alice") +sayHello('Alice') -console.log(hello("Bob")) -console.log(bye("Carol")) +console.log(hello('Bob')) +console.log(bye('Carol')) diff --git a/package.json b/package.json index fd278ea98..d2bca702d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,11 @@ { "private": true, + "scripts": { + "lint": "biome format . --write", + "lint:check": "biome check ." + }, "devDependencies": { + "@biomejs/biome": "1.2.2", "commitlint-config-gitmoji": "^2.3.1" } } diff --git a/packages/greetings/src/bye/bye.ts b/packages/greetings/src/bye/bye.ts index dd82b911c..744a954f2 100644 --- a/packages/greetings/src/bye/bye.ts +++ b/packages/greetings/src/bye/bye.ts @@ -1,5 +1,5 @@ import chalk from 'chalk' export function bye(name: string) { - return `Bye ${chalk.red(name)}!`; + return `Bye ${chalk.red(name)}!` } diff --git a/packages/greetings/src/hello/sayHello.ts b/packages/greetings/src/hello/sayHello.ts index 837664ba2..0c8fbd32d 100644 --- a/packages/greetings/src/hello/sayHello.ts +++ b/packages/greetings/src/hello/sayHello.ts @@ -1,5 +1,5 @@ -import {hello} from './hello' +import { hello } from './hello' export function sayHello(name: string) { - console.log(hello(name)) + console.log(hello(name)) } diff --git a/packages/greetings/src/run.ts b/packages/greetings/src/run.ts index 4a1c0d727..24212ba43 100644 --- a/packages/greetings/src/run.ts +++ b/packages/greetings/src/run.ts @@ -1,3 +1,3 @@ -import chalk from 'chalk'; +import chalk from 'chalk' -console.log(chalk.green('Hello, world!')); \ No newline at end of file +console.log(chalk.green('Hello, world!')) diff --git a/packages/greetings/tsup.config.ts b/packages/greetings/tsup.config.ts index 23644cd67..99ff6b636 100644 --- a/packages/greetings/tsup.config.ts +++ b/packages/greetings/tsup.config.ts @@ -6,5 +6,5 @@ export default defineConfig({ outDir: 'dist', format: 'esm', splitting: false, - sourcemap: true, -}) \ No newline at end of file + sourcemap: true +}) diff --git a/packages/tsconfig/base.json b/packages/tsconfig/base.json index 2d77aa4b6..a71b7913f 100644 --- a/packages/tsconfig/base.json +++ b/packages/tsconfig/base.json @@ -28,4 +28,3 @@ "forceConsistentCasingInFileNames": true } } - diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 89b35a093..4bf8f794c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,9 @@ importers: .: devDependencies: + '@biomejs/biome': + specifier: 1.2.2 + version: 1.2.2 commitlint-config-gitmoji: specifier: ^2.3.1 version: 2.3.1 @@ -48,6 +51,74 @@ importers: packages: + /@biomejs/biome@1.2.2: + resolution: {integrity: sha512-fXwXi56ZdaKO/N3rTmhWw41UxstoviODk+wia4WWNSlm23r8xJ/NxjaZ88scV2IsmsFHqc8rmwb2dkrStAdIEw==} + engines: {node: '>=14.*'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@biomejs/cli-darwin-arm64': 1.2.2 + '@biomejs/cli-darwin-x64': 1.2.2 + '@biomejs/cli-linux-arm64': 1.2.2 + '@biomejs/cli-linux-x64': 1.2.2 + '@biomejs/cli-win32-arm64': 1.2.2 + '@biomejs/cli-win32-x64': 1.2.2 + dev: true + + /@biomejs/cli-darwin-arm64@1.2.2: + resolution: {integrity: sha512-Fx1IURKhoqH6wPawtKLT6wcfMSjRRcNK8+VWau0iDOjXvNtjJpSmICbU89B7Vt/gZRwPqkfDMBkFwm6V5vFTSQ==} + engines: {node: '>=14.*'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-darwin-x64@1.2.2: + resolution: {integrity: sha512-JNaAFOI/ZisnmzvcFNd73geJxaFaN2L4YsWM6cgBeKyLY/ycl9C/PBTFfEmeB1c7f5XIIal8P2cj47kLJpN5Ig==} + engines: {node: '>=14.*'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-linux-arm64@1.2.2: + resolution: {integrity: sha512-JHXRnfhOLx8UO/Fcyn2c5pFRri0XKqRZm2wf5oH5GSfLVpckDw2X15dYGbu3nmfM/3pcAaTV46pUpjrCnaAieg==} + engines: {node: '>=14.*'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-linux-x64@1.2.2: + resolution: {integrity: sha512-5Zr+iM7lUKsw81p9PkXRESuH2/AhRZ6RCWkgE+FSLcxMhXy/4RDR+o2YQDsJM6cWKIzOJM05vDHTGrDq7vXE4A==} + engines: {node: '>=14.*'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-win32-arm64@1.2.2: + resolution: {integrity: sha512-HvUcG2p++RvYP0zfOqh+DgiUUH+JI/uETr0kzWlOJ9F3lsG525pkywg4RSd4OvJd7Wpd3wt3UpN/A4IEJaVmbA==} + engines: {node: '>=14.*'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-win32-x64@1.2.2: + resolution: {integrity: sha512-bfaFJwqJ9ApFga2o88OaROSd3pasYRzRGXHJWAE9VUUKdSNSTYxHOqVrNvV54yYPtL6Kt9xkuZa4HNu9it3TaA==} + engines: {node: '>=14.*'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@commitlint/types@17.4.4: resolution: {integrity: sha512-amRN8tRLYOsxRr6mTnGGGvB5EmW/4DDjLMgiwK3CCVEmN6Sr/6xePGEpWaspKkckILuUORCwe6VfDBw6uj4axQ==} engines: {node: '>=v14'}