Skip to content

Commit

Permalink
πŸ§‘β€πŸ’» chore: Add biome linter and formatter (#879)
Browse files Browse the repository at this point in the history
* πŸ§‘β€πŸ’» chore: Add `biome` linter and formatter

* Format code
  • Loading branch information
duckception authored Sep 19, 2023
1 parent da12f3f commit eebae94
Show file tree
Hide file tree
Showing 10 changed files with 109 additions and 17 deletions.
17 changes: 17 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
10 changes: 5 additions & 5 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -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]
}
}
8 changes: 4 additions & 4 deletions examples/greetings-esm/src/example.ts
Original file line number Diff line number Diff line change
@@ -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'))
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
2 changes: 1 addition & 1 deletion packages/greetings/src/bye/bye.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import chalk from 'chalk'

export function bye(name: string) {
return `Bye ${chalk.red(name)}!`;
return `Bye ${chalk.red(name)}!`
}
4 changes: 2 additions & 2 deletions packages/greetings/src/hello/sayHello.ts
Original file line number Diff line number Diff line change
@@ -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))
}
4 changes: 2 additions & 2 deletions packages/greetings/src/run.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import chalk from 'chalk';
import chalk from 'chalk'

console.log(chalk.green('Hello, world!'));
console.log(chalk.green('Hello, world!'))
4 changes: 2 additions & 2 deletions packages/greetings/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export default defineConfig({
outDir: 'dist',
format: 'esm',
splitting: false,
sourcemap: true,
})
sourcemap: true
})
1 change: 0 additions & 1 deletion packages/tsconfig/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@
"forceConsistentCasingInFileNames": true
}
}

71 changes: 71 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit eebae94

Please sign in to comment.