Skip to content

Commit b69ccd7

Browse files
committed
1.8.3
1 parent b8009d6 commit b69ccd7

File tree

9 files changed

+30
-28
lines changed

9 files changed

+30
-28
lines changed

.husky/post-checkout

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

.husky/post-merge

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

.husky/pre-commit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
41
bun pre-commit

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 1.8.3
4+
5+
- Fix issue with ESLint's Flat Config
6+
37
## 1.7.3
48

59
- Updated Biome to 1.7.3; added the following disables:

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* These are ESLint rules that have corresponding and recommended Biome rules.
55
*/
66
module.exports = {
7-
extends: ["./eslint-config-prettier.js"],
87
rules: {
8+
...require("./eslint-config-prettier.js").rules,
99
"constructor-super": "off",
1010
"default-case-last": "off",
1111
"default-param-last": "off",

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "eslint-config-biome",
3-
"version": "1.7.3",
3+
"version": "1.8.3",
44
"description": "Disables ESLint rules that have a recommended and equivalent Biome rule",
55
"main": "index.js",
66
"scripts": {
77
"format": "biome check --apply-unsafe . && eslint --fix . package.json",
88
"format:check": "biome check . && eslint . package.json",
99
"pre-commit": "bun format && bun typecheck && bun test && git add -A",
10-
"prepare": "husky install",
11-
"start": "bun run scripts/index.ts",
10+
"prepare": "husky",
11+
"start": "bun i && bun run scripts/index.ts",
1212
"test:watch": "bun test --watch",
1313
"tsw": "tsc --watch --noEmit",
1414
"typecheck": "tsc --noEmit",
@@ -33,13 +33,13 @@
3333
],
3434
"repository": "SrBrahma/eslint-config-biome",
3535
"devDependencies": {
36-
"@biomejs/biome": "^1.7.3",
37-
"@sindresorhus/tsconfig": "^5.0.0",
38-
"@types/bun": "^1.1.3",
39-
"@types/jsdom": "^21.1.6",
36+
"@biomejs/biome": "^1.8.3",
37+
"@sindresorhus/tsconfig": "^5.1.1",
38+
"@types/bun": "^1.1.8",
39+
"@types/jsdom": "^21.1.7",
4040
"eslint-config-gev": "4.5.1",
41-
"husky": "^9.0.11",
42-
"jsdom": "^24.1.0",
43-
"typescript": "^5.4.5"
41+
"husky": "^9.1.5",
42+
"jsdom": "^24.1.3",
43+
"typescript": "^5.5.4"
4444
}
4545
}

scripts/index.test.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@ import { spawnSync } from "bun"
88
const rootPath = path.resolve(__dirname, "..")
99
const indexPath = path.resolve(rootPath, "index.js")
1010
const prettierPath = path.resolve(rootPath, "eslint-config-prettier.js")
11-
const indexContent = fs.readFileSync(indexPath, "utf-8")
1211
const disabledRules = Object.keys(
1312
(require(indexPath) as { rules: Record<string, string> }).rules,
1413
)
1514
const prettierContent = fs.readFileSync(prettierPath, "utf-8")
1615

16+
// @ts-expect-error
17+
import prettierJs from "../eslint-config-prettier.js"
18+
// @ts-expect-error
19+
import indexJs from "../eslint-config-prettier.js"
20+
1721
test("index.js is a valid file and can be used by eslint", () => {
1822
// In the root there is a .eslintrc that uses the index.js in the extends.
1923
expect(
@@ -47,8 +51,13 @@ test("TS extensions should be added to index.js", () => {
4751
})
4852

4953
test("eslint-config-prettier is used and is valid", () => {
50-
expect(indexContent).toContain('extends: ["./eslint-config-prettier.js"],')
5154
expect(prettierContent).toContain('"react/jsx-indent": "off"')
55+
expect((prettierJs as { rules: Record<string, unknown> }).rules).toContainKey(
56+
"react/jsx-indent",
57+
)
58+
expect((indexJs as { rules: Record<string, unknown> }).rules).toContainKey(
59+
"react/jsx-indent",
60+
)
5261
})
5362

5463
test("doesnt include clippy rules", () => {

scripts/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { getEquivalentRulesFromDocs } from "./fetchFromDocs"
55
import { getEslintEquivalentRulesFromGithub } from "./fetchFromGithub.js"
66
import { createPrettierFile } from "./prettier"
77
import { getJsBaseRules, getTsExtensionsForRules } from "./tsExtensions"
8-
import { sortRules, writeFile } from "./utils"
8+
import { sortRules, writeMainFile } from "./utils"
99

1010
const main = async () => {
1111
const rules = [
@@ -22,7 +22,7 @@ const main = async () => {
2222

2323
const rulesNoDuplicates = [...new Set(rulesWithTsExtends)]
2424

25-
writeFile(sortRules(rulesNoDuplicates))
25+
writeMainFile(sortRules(rulesNoDuplicates))
2626
await createPrettierFile()
2727

2828
console.log(`Generated ${filenames.index} & ${filenames.prettier}!`)

scripts/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const sortRules = (rules: Array<string>) =>
3131
return a.localeCompare(b)
3232
})
3333

34-
export const writeFile = (rules: Array<string>) => {
34+
export const writeMainFile = (rules: Array<string>) => {
3535
fs.writeFileSync(
3636
filenames.index,
3737
`/**
@@ -40,8 +40,8 @@ export const writeFile = (rules: Array<string>) => {
4040
* These are ESLint rules that have corresponding and recommended Biome rules.
4141
*/
4242
module.exports = {
43-
extends: ["./${filenames.prettier}"],
4443
rules: {
44+
...require("./eslint-config-prettier.js").rules,
4545
${rules.map((rule) => ` "${rule}": "off",`).join("\n")}
4646
}
4747
}

0 commit comments

Comments
 (0)