-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from chhsiao1981/biome
add biome for formatting / linting
- Loading branch information
Showing
32 changed files
with
5,342 additions
and
18,404 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", | ||
"files": { | ||
"include": [ | ||
"src/**", | ||
"tests/**", | ||
"package.json", | ||
"biome.json", | ||
"*.config.ts", | ||
"vitest.*.ts", | ||
"tsconfig*.json", | ||
"testing/*.mjs" | ||
], | ||
"ignore": ["package-lock.json", "*.d.ts"] | ||
}, | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"formatter": { | ||
"indentWidth": 2, | ||
"indentStyle": "space" | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true, | ||
"style": { | ||
"noNonNullAssertion": "off" | ||
}, | ||
"complexity": { | ||
"useLiteralKeys": "off" | ||
}, | ||
"correctness": { | ||
"useExhaustiveDependencies": "off" | ||
}, | ||
"suspicious": { | ||
"noArrayIndexKey": "off", | ||
"noPrototypeBuiltins": "off" | ||
} | ||
} | ||
}, | ||
"vcs": { | ||
"enabled": true, | ||
"clientKind": "git", | ||
"useIgnoreFile": true, | ||
"defaultBranch": "main" | ||
}, | ||
"javascript": { | ||
"formatter": { | ||
"semicolons": "asNeeded", | ||
"quoteStyle": "single", | ||
"jsxQuoteStyle": "single", | ||
"indentStyle": "space", | ||
"lineWidth": 120 | ||
}, | ||
"globals": ["window"] | ||
}, | ||
"json": { | ||
"parser": { | ||
"allowComments": true | ||
}, | ||
"formatter": { | ||
"indentStyle": "space" | ||
} | ||
}, | ||
"css": { | ||
"formatter": { | ||
"indentStyle": "space" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import eslint from '@eslint/js' | ||
import globals from 'globals' | ||
import reactHooks from 'eslint-plugin-react-hooks' | ||
import tseslint from 'typescript-eslint' | ||
import reactRefresh from 'eslint-plugin-react-refresh' | ||
|
||
export default tseslint.config( | ||
{ ignores: ['dist', '.venv', 'eslint.config.ts', 'coverage', 'vitest.config.ts', '**/*.d.ts'] }, | ||
eslint.configs.recommended, | ||
tseslint.configs.recommendedTypeChecked, | ||
tseslint.configs.stylisticTypeChecked, | ||
{ | ||
languageOptions: { | ||
globals: globals.browser, | ||
parserOptions: { | ||
project: ['./tsconfig.app.json', './tsconfig.node.json', './tsconfig.test.json'], | ||
// @ts-expect-error languageOptions.tsconfigRootDir | ||
tsconfigRootDir: import.meta.dirname, | ||
}, | ||
}, | ||
}, | ||
{ | ||
files: ['src/*.{ts,tsx}'], | ||
plugins: { | ||
'react-hooks': reactHooks, | ||
'react-refresh': reactRefresh, | ||
}, | ||
rules: { | ||
...reactHooks.configs.recommended.rules, | ||
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], | ||
'@typescript-eslint/consistent-indexed-object-style': ['error', 'index-signature'], | ||
'@typescript-eslint/dot-notation': 'off', | ||
'no-prototype-builtins': 'off', | ||
'react-hooks/exhaustive-deps': 'off', | ||
quotes: ['error', 'single'], | ||
'no-unused-vars': 'off', //use tse/no-unused-vars instead. | ||
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_$' }], | ||
'@typescript-eslint/no-explicit-any': 'off', // taken care of by biome. don't know how to specify next-line ignoring on both biome / eslint though. | ||
'@typescript-eslint/no-unsafe-argument': 'off', // taken care of by biome. don't know how to specify next-line ignoring on both biome / eslint though. | ||
}, | ||
}, | ||
{ | ||
files: ['tests/*.{ts,tsx}'], | ||
plugins: { | ||
'react-hooks': reactHooks, | ||
'react-refresh': reactRefresh, | ||
}, | ||
rules: { | ||
...reactHooks.configs.recommended.rules, | ||
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], | ||
'@typescript-eslint/consistent-indexed-object-style': ['error', 'index-signature'], | ||
'@typescript-eslint/dot-notation': 'off', | ||
'no-prototype-builtins': 'off', | ||
'react-hooks/exhaustive-deps': 'off', | ||
quotes: ['error', 'single'], | ||
'@typescript-eslint/no-unsafe-member-access': 'off', | ||
'@typescript-eslint/no-unsafe-call': 'off', | ||
'@typescript-eslint/no-unsafe-assignment': 'off', | ||
'no-unused-vars': 'off', | ||
'@typescript-eslint/no-unused-vars': 'off', | ||
'@typescript-eslint/require-await': 'off', | ||
'@typescript-eslint/no-misused-promises': 'off', | ||
'@typescript-eslint/consistent-type-definitions': 'off', | ||
'@typescript-eslint/no-empty-object-type': 'off', | ||
'@typescript-eslint/ban-ts-comment': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-unsafe-argument': 'off', | ||
}, | ||
}, | ||
) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.