Skip to content

Commit

Permalink
refactor: update all
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <[email protected]>
  • Loading branch information
Innei committed Jul 12, 2024
1 parent ae15886 commit 61113d5
Show file tree
Hide file tree
Showing 15 changed files with 3,721 additions and 2,582 deletions.
202 changes: 202 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
{
"$schema": "https://biomejs.dev/schemas/1.6.4/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": false,
"a11y": {
"noBlankTarget": "warn"
},
"complexity": {
"noBannedTypes": "off",
"noExtraBooleanCast": "error",
"noMultipleSpacesInRegularExpressionLiterals": "error",
"noUselessCatch": "error",
"noUselessThisAlias": "error",
"noUselessTypeConstraint": "error",
"noWith": "error",
"useArrowFunction": "off"
},
"correctness": {
"noUnusedImports": "error",
"noChildrenProp": "error",
"noConstAssign": "error",
"noConstantCondition": "error",
"noEmptyCharacterClassInRegex": "error",
"noEmptyPattern": "error",
"noGlobalObjectCalls": "error",
"noInnerDeclarations": "error",
"noInvalidConstructorSuper": "error",
"noNewSymbol": "error",
"noNonoctalDecimalEscape": "error",
"noPrecisionLoss": "error",
"noSelfAssign": "error",
"noSetterReturn": "error",
"noSwitchDeclarations": "error",
"noUndeclaredVariables": "error",
"noUnreachable": "error",
"noUnreachableSuper": "error",
"noUnsafeFinally": "error",
"noUnsafeOptionalChaining": "error",
"noUnusedLabels": "error",
"noUnusedVariables": "warn",
"useExhaustiveDependencies": "warn",
"useHookAtTopLevel": "error",
"useIsNan": "error",
"useValidForDirection": "error",
"useYield": "error"
},
"security": {
"noDangerouslySetInnerHtml": "warn"
},
"style": {
"noArguments": "error",
"noDefaultExport": "off",
"noNamespace": "error",
"useAsConstAssertion": "error",
"useBlockStatements": "off",
"useConst": "error",
"useImportType": "warn",
"useTemplate": "error",
"useSelfClosingElements": "error"
},
"suspicious": {
"noAssignInExpressions": "off",
"noAsyncPromiseExecutor": "error",
"noCatchAssign": "error",
"noClassAssign": "error",
"noCommentText": "error",
"noCompareNegZero": "error",
"noConsoleLog": "error",
"noControlCharactersInRegex": "error",
"noDebugger": "error",
"noDuplicateCase": "error",
"noDuplicateClassMembers": "error",
"noDuplicateJsxProps": "error",
"noDuplicateObjectKeys": "error",
"noDuplicateParameters": "error",
"noEmptyBlockStatements": "warn",
"noExplicitAny": "off",
"noExtraNonNullAssertion": "error",
"noFallthroughSwitchClause": "error",
"noFunctionAssign": "error",
"noGlobalAssign": "error",
"noImportAssign": "error",
"noMisleadingCharacterClass": "error",
"noMisleadingInstantiator": "error",
"noPrototypeBuiltins": "error",
"noRedeclare": "error",
"noShadowRestrictedNames": "error",
"noUnsafeDeclarationMerging": "error",
"noUnsafeNegation": "error",
"useGetterReturn": "error",
"useValidTypeof": "error"
}
},
"ignore": [
"./src/socket/worker-polyfill.ts",
"*.min.*",
"CHANGELOG.md",
"dist",
"LICENSE*",
"output",
"coverage",
"public",
"temp",
"packages-lock.json",
"pnpm-lock.yaml",
"yarn.lock",
"__snapshots__",
"!.github",
"!.vitepress",
"!.vscode"
]
},
"overrides": [
{
"include": [
"*.config.[tj]s",
"pages/**/*.[tj]sx",
"src/pages/**/*.[tj]sx",
"src/views/**/*.[tj]sx",
"views/**/*.[tj]sx",
"src/store/**/*.[tj]s",
"store/**/*.[tj]s"
],
"linter": {
"rules": {
"style": {
"noDefaultExport": "off"
}
}
}
},
{
"include": [
"*.d.ts"
],
"linter": {
"rules": {}
}
},
{
"include": [
"*.js"
],
"linter": {
"rules": {}
}
},
{
"include": [
"*.test.ts",
"*.test.js",
"*.spec.ts",
"*.spec.js"
],
"linter": {
"rules": {}
}
},
{
"include": [
"*.ts",
"*.tsx",
"*.mts",
"*.cts"
],
"linter": {
"rules": {
"correctness": {
"noConstAssign": "off",
"noGlobalObjectCalls": "off",
"noInvalidConstructorSuper": "off",
"noNewSymbol": "off",
"noSetterReturn": "off",
"noUndeclaredVariables": "off",
"noUnreachable": "off",
"noUnreachableSuper": "off"
},
"style": {
"noArguments": "error",
"noVar": "error",
"useConst": "error"
},
"suspicious": {
"noDuplicateClassMembers": "off",
"noDuplicateObjectKeys": "off",
"noDuplicateParameters": "off",
"noFunctionAssign": "off",
"noImportAssign": "off",
"noRedeclare": "off",
"noUnsafeNegation": "off",
"useGetterReturn": "off"
}
}
}
}
]
}
23 changes: 23 additions & 0 deletions cssAsPlugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// https://github.com/tailwindlabs/tailwindcss-intellisense/issues/227#issuecomment-1462034856
// cssAsPlugin.js
const postcss = require('postcss')
const postcssJs = require('postcss-js')
const { readFileSync } = require('fs')

require.extensions['.css'] = function (module, filename) {
module.exports = ({ addBase, addComponents, addUtilities }) => {
const css = readFileSync(filename, 'utf8')
const root = postcss.parse(css)
const jss = postcssJs.objectify(root)

if ('@layer base' in jss) {
addBase(jss['@layer base'])
}
if ('@layer components' in jss) {
addComponents(jss['@layer components'])
}
if ('@layer utilities' in jss) {
addUtilities(jss['@layer utilities'])
}
}
}
66 changes: 36 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,49 @@
"build": "tsc && vite build",
"serve": "vite preview",
"format": "prettier --write \"src/**/*.ts\" ",
"lint": "eslint ./src --fix"
"lint": "biome lint --apply src/**/*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json} --no-errors-on-unmatched"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
"dependencies": {
"react": "18.3.1",
"react-dom": "18.3.1"
},
"simple-git-hooks": {
"pre-commit": "pnpm exec lint-staged"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,css,scss,less}": [
"prettier --ignore-path ./.prettierignore --write "
],
"*.{js,jsx,ts,tsx}": [
"eslint"
"prettier --ignore-path ./.gitignore --write "
],
"*.{js,ts,cjs,mjs,jsx,tsx,json}": [
"biome lint --apply --no-errors-on-unmatched"
]
},
"dependencies": {
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@innei-util/eslint-config-react-ts": "^0.2.1",
"@biomejs/biome": "1.8.3",
"@egoist/tailwindcss-icons": "1.8.1",
"@iconify-json/mingcute": "1.1.18",
"@innei-util/prettier": "^0.8.2",
"@types/node": "18.16.14",
"@types/react": "18.0.15",
"@types/react-dom": "18.0.6",
"@vitejs/plugin-react": "^2",
"autoprefixer": "10.4.7",
"eslint": "8.20.0",
"husky": "8.0.1",
"lint-staged": "13.2.2",
"postcss": "8.4.14",
"postcss-import": "14.1.0",
"prettier": "2.8.8",
"tailwindcss": "3.1.6",
"typescript": "4.7.4",
"vite": "3.0.2",
"vite-plugin-checker": "0.6.0",
"vite-tsconfig-paths": "3.6.0"
"@tailwindcss/container-queries": "0.1.1",
"@tailwindcss/typography": "0.5.13",
"@types/node": "20.14.10",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"autoprefixer": "10.4.19",
"daisyui": "4.12.10",
"lint-staged": "15.2.7",
"postcss": "8.4.39",
"postcss-import": "16.1.0",
"postcss-js": "4.0.1",
"prettier": "3.3.2",
"simple-git-hooks": "2.11.1",
"tailwind-scrollbar": "3.1.0",
"tailwind-variants": "0.2.1",
"tailwindcss": "3.4.4",
"tailwindcss-animated": "1.1.2",
"typescript": "5.5.3",
"vite": "5.3.3",
"vite-plugin-checker": "0.7.1",
"vite-tsconfig-paths": "4.3.2"
}
}
Loading

0 comments on commit 61113d5

Please sign in to comment.