Skip to content

Commit 18e4738

Browse files
committed
Replace prettier with biome
1 parent 6724873 commit 18e4738

12 files changed

+480
-162
lines changed

.oxlintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock.json

.prettierignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.prettierrc

Lines changed: 0 additions & 7 deletions
This file was deleted.

biome.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3+
"files": {
4+
"ignore": ["**/package.json", "**/package-lock.json"]
5+
},
6+
"formatter": {
7+
"enabled": true,
8+
"attributePosition": "auto",
9+
"bracketSpacing": true,
10+
"formatWithErrors": false,
11+
"indentStyle": "space",
12+
"indentWidth": 2,
13+
"lineEnding": "lf",
14+
"lineWidth": 80,
15+
"useEditorconfig": true
16+
},
17+
"javascript": {
18+
"formatter": {
19+
"arrowParentheses": "asNeeded",
20+
"attributePosition": "auto",
21+
"bracketSameLine": false,
22+
"bracketSpacing": true,
23+
"jsxQuoteStyle": "double",
24+
"quoteProperties": "asNeeded",
25+
"quoteStyle": "single",
26+
"semicolons": "asNeeded",
27+
"trailingCommas": "none"
28+
}
29+
},
30+
"json": {
31+
"formatter": {
32+
"enabled": true,
33+
"trailingCommas": "none"
34+
},
35+
"parser": {
36+
"allowComments": true,
37+
"allowTrailingCommas": true
38+
}
39+
}
40+
}

eslint.config.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,32 @@
22

33
const path = require('node:path')
44

5-
const { includeIgnoreFile } = require('@eslint/compat')
5+
const {
6+
convertIgnorePatternToMinimatch,
7+
includeIgnoreFile
8+
} = require('@eslint/compat')
69
const js = require('@eslint/js')
710
const importXPlugin = require('eslint-plugin-import-x')
811
const nodePlugin = require('eslint-plugin-n')
912
const sortDestructureKeysPlugin = require('eslint-plugin-sort-destructure-keys')
1013
const unicornPlugin = require('eslint-plugin-unicorn')
1114

1215
const constants = require('@socketsecurity/registry/lib/constants')
13-
const { GIT_IGNORE, LATEST, PRETTIER_IGNORE } = constants
16+
const { BIOME_JSON, GIT_IGNORE, LATEST } = constants
1417

1518
const rootPath = __dirname
1619

17-
const gitignorePath = path.resolve(rootPath, GIT_IGNORE)
18-
const prettierignorePath = path.resolve(rootPath, PRETTIER_IGNORE)
20+
const biomeConfigPath = path.join(rootPath, BIOME_JSON)
21+
const gitignorePath = path.join(rootPath, GIT_IGNORE)
22+
23+
const biomeConfig = require(biomeConfigPath)
1924

2025
module.exports = [
2126
includeIgnoreFile(gitignorePath),
22-
includeIgnoreFile(prettierignorePath),
27+
{
28+
name: 'Imported biome.json ignore patterns',
29+
ignores: biomeConfig.files.ignore.map(convertIgnorePatternToMinimatch)
30+
},
2331
{
2432
files: ['**/*.{c,}js'],
2533
...importXPlugin.flatConfigs.recommended,

0 commit comments

Comments
 (0)