Skip to content

Commit

Permalink
1.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ftzi committed Oct 9, 2024
1 parent 8ddc7ea commit 0b22a87
Show file tree
Hide file tree
Showing 10 changed files with 210 additions and 182 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 1.9.3

- Added a few minor ESLint rules to be disabled.
- Now using Biome's JSON Metadata to generate this package's rules to be disabled. Many thanks, [ematipico](https://github.com/ematipico)!

## 1.8.3

- Fix issue with ESLint's Flat Config ([#7](https://github.com/SrBrahma/eslint-config-biome/issues/7)).
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ npm install -D eslint-config-biome # or your preferred package manager ;)
- Since v1.4.0, this package includes [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier), so formatting rules are also disabled as Biome is equivalent to Prettier. [Attribution](ATTRIBUTION.md).
- This package had its origin [in this discussion](https://github.com/biomejs/biome/discussions/3#discussioncomment-7876363). Thanks [DaniGuardiola
](https://github.com/DaniGuardiola) for [your *related initial crawler code*](https://github.com/biomejs/biome/discussions/3#discussioncomment-7910787)!
- This package had its origin [in this discussion](https://github.com/biomejs/biome/discussions/3#discussioncomment-7876363).
## 📰 [Changelog](CHANGELOG.md)
11 changes: 9 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module.exports = {
"no-delete-var": "off",
"no-dupe-args": "off",
"no-dupe-class-members": "off",
"no-dupe-else-if": "off",
"no-dupe-keys": "off",
"no-duplicate-case": "off",
"no-else-return": "off",
Expand Down Expand Up @@ -60,7 +61,7 @@ module.exports = {
"no-sequences": "off",
"no-setter-return": "off",
"no-shadow-restricted-names": "off",
"no-sparse-array": "off",
"no-sparse-arrays": "off",
"no-this-before-super": "off",
"no-unneeded-ternary": "off",
"no-unreachable": "off",
Expand All @@ -72,6 +73,7 @@ module.exports = {
"no-useless-catch": "off",
"no-useless-computed-key": "off",
"no-useless-constructor": "off",
"no-useless-escape": "off",
"no-useless-rename": "off",
"no-var": "off",
"no-with": "off",
Expand All @@ -86,12 +88,13 @@ module.exports = {
"require-yield": "off",
"use-isnan": "off",
"valid-typeof": "off",
"@mysticatea/eslint-plugin/no-this-in-static": "off",
"@eslint-community/eslint-plugin-mysticatea/no-this-in-static": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/consistent-type-exports": "off",
"@typescript-eslint/consistent-type-imports": "off",
"@typescript-eslint/default-param-last": "off",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/no-dupe-class-members": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
Expand All @@ -118,6 +121,7 @@ module.exports = {
"@typescript-eslint/prefer-literal-enum-member": "off",
"@typescript-eslint/prefer-namespace-keyword": "off",
"@typescript-eslint/prefer-optional-chain": "off",
"eslint-plugin-mysticatea/no-this-in-static": "off",
"jest/max-nested-describe": "off",
"jest/no-duplicate-hooks": "off",
"jest/no-export": "off",
Expand Down Expand Up @@ -148,7 +152,9 @@ module.exports = {
"jsx-a11y/no-noninteractive-element-to-interactive-role": "off",
"jsx-a11y/no-noninteractive-tabindex": "off",
"jsx-a11y/no-redundant-roles": "off",
"jsx-a11y/prefer-tag-over-role": "off",
"jsx-a11y/role-has-required-aria-props": "off",
"jsx-a11y/role-supports-aria-props": "off",
"jsx-a11y/scope": "off",
"jsx-a11y/tabindex-no-positive": "off",
"react/button-has-type": "off",
Expand All @@ -164,6 +170,7 @@ module.exports = {
"react/void-dom-elements-no-children": "off",
"react-hooks/exhaustive-deps": "off",
"simple-import-sort/imports": "off",
"sonarjs/prefer-while": "off",
"stylistic/jsx-self-closing-comp": "off",
"unicorn/new-for-builtins": "off",
"unicorn/no-array-for-each": "off",
Expand Down
16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "eslint-config-biome",
"version": "1.8.4",
"version": "1.9.3",
"description": "Disables ESLint rules that have a recommended and equivalent Biome rule",
"main": "index.js",
"scripts": {
"dev": "bun --watch run scripts/index.ts",
"format": "biome check --apply-unsafe . && eslint --fix . package.json",
"format:check": "biome check . && eslint . package.json",
"pre-commit": "bun format && bun typecheck && bun test && git add -A",
"prepare": "husky",
"start": "bun i && bun run scripts/index.ts",
"test:watch": "bun test --watch",
"tsw": "tsc --watch --noEmit",
"typecheck": "tsc --noEmit",
"watch": "bun --watch run scripts/index.ts"
"typecheck": "tsc --noEmit"
},
"files": [
"index.js",
Expand All @@ -33,13 +33,11 @@
],
"repository": "SrBrahma/eslint-config-biome",
"devDependencies": {
"@biomejs/biome": "^1.8.3",
"@biomejs/biome": "^1.9.3",
"@sindresorhus/tsconfig": "^5.1.1",
"@types/bun": "^1.1.8",
"@types/jsdom": "^21.1.7",
"@types/bun": "^1.1.11",
"eslint-config-gev": "4.5.1",
"husky": "^9.1.5",
"jsdom": "^24.1.3",
"typescript": "^5.5.4"
"husky": "^9.1.6",
"typescript": "^5.6.3"
}
}
12 changes: 11 additions & 1 deletion scripts/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ export const filenames = {
}
export const rootPath = path.resolve(__dirname, "..")

/**
* Some ESLint rules are already taken care by Biome but it's not specified from the used sources of information that they do.
* So we manually disable them here.
*/
export const extraRulesToDisable = [
"simple-import-sort/imports",
// Not being added for some reason, TODO check it and fix it
Expand All @@ -14,6 +18,12 @@ export const extraRulesToDisable = [
"no-delete-var",
"no-return-assign",
"no-useless-computed-key",
"unicorn/no-static-only-class",
"unicorn/no-typeof-undefined",
"@typescript-eslint/no-useless-template-literals",
// There are two packages for mysticatea. One is already handled by the code, this handles the other package.
"eslint-plugin-mysticatea/no-this-in-static",
// https://biomejs.dev/linter/rules/use-import-type/
"@typescript-eslint/no-import-type-side-effects",
// https://biomejs.dev/linter/rules/no-useless-type-constraint/
"@typescript-eslint/no-unnecessary-type-arguments",
]
97 changes: 0 additions & 97 deletions scripts/fetchFromDocs.ts

This file was deleted.

59 changes: 0 additions & 59 deletions scripts/fetchFromGithub.ts

This file was deleted.

12 changes: 4 additions & 8 deletions scripts/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
/** Attribution for eslint-config-prettier is available at the ATTRIBUTION.md and in the eslint-config-prettier.js. */

import { extraRulesToDisable, filenames } from "./consts"
import { getEquivalentRulesFromDocs } from "./fetchFromDocs"
import { getEslintEquivalentRulesFromGithub } from "./fetchFromGithub.js"
import { getRulesFromJsonMetadata } from "./metadata.js"
import { createPrettierFile } from "./prettier"
import { getJsBaseRules, getTsExtensionsForRules } from "./tsExtensions"
import { sortRules, writeMainFile } from "./utils"

const main = async () => {
const rules = [
...(await getEquivalentRulesFromDocs()),
...extraRulesToDisable,
...(await getEslintEquivalentRulesFromGithub()),
]
const rules = [...(await getRulesFromJsonMetadata()), ...extraRulesToDisable]

const rulesWithTsExtends = [
...rules,
Expand All @@ -21,8 +16,9 @@ const main = async () => {
]

const rulesNoDuplicates = [...new Set(rulesWithTsExtends)]
const sortedRules = sortRules(rulesNoDuplicates)

writeMainFile(sortRules(rulesNoDuplicates))
writeMainFile(sortedRules)
await createPrettierFile()

console.log(`Generated ${filenames.index} & ${filenames.prettier}!`)
Expand Down
Loading

0 comments on commit 0b22a87

Please sign in to comment.