-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(cli): migrate unit test on vitest
- Loading branch information
Showing
181 changed files
with
3,986 additions
and
6,007 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx lint-staged $1 | ||
#npx lint-staged $1 |
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,76 @@ | ||
import typescriptEslint from "@typescript-eslint/eslint-plugin"; | ||
import typescriptParser from "@typescript-eslint/parser"; | ||
import pluginPrettierRecommended from "eslint-plugin-prettier/recommended"; | ||
import pluginSimpleImportSort from "eslint-plugin-simple-import-sort"; | ||
import vitest from "eslint-plugin-vitest"; | ||
import pluginWorkspaces from "eslint-plugin-workspaces"; | ||
import globals from "globals"; | ||
|
||
export default [ | ||
{ | ||
ignores: ["coverage", "dist", "processes.config.js"] | ||
}, | ||
{ | ||
files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"], | ||
languageOptions: { | ||
ecmaVersion: "latest", | ||
sourceType: "module", | ||
parser: typescriptParser, | ||
parserOptions: { | ||
ecmaVersion: "latest", | ||
sourceType: "module" | ||
}, | ||
globals: { | ||
...globals.node | ||
} | ||
}, | ||
plugins: { | ||
"@typescript-eslint": typescriptEslint | ||
}, | ||
rules: { | ||
// "@typescript-eslint/lines-between-class-members": [ | ||
// "error", | ||
// "always", | ||
// { exceptAfterOverload: true } | ||
// ], | ||
"@typescript-eslint/ban-ts-comment": 0, | ||
"@typescript-eslint/camelcase": 0, | ||
"@typescript-eslint/no-inferrable-types": 0, | ||
"@typescript-eslint/explicit-function-return-type": 0, | ||
"@typescript-eslint/explicit-module-boundary-types": 0, | ||
"@typescript-eslint/no-unused-vars": 0, | ||
"@typescript-eslint/no-explicit-any": 0, | ||
"@typescript-eslint/no-non-null-assertion": 0 | ||
} | ||
}, | ||
{ | ||
files: ["**/*.spec.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"], // or any other pattern | ||
plugins: { | ||
vitest | ||
}, | ||
rules: { | ||
...vitest.configs.recommended.rules, // you can also use vitest.configs.all.rules to enable all rules | ||
"vitest/consistent-test-it": [ | ||
"error", | ||
{ fn: "it", withinDescribe: "it" } | ||
], | ||
"vitest/no-alias-methods": "error" | ||
} | ||
}, | ||
{ | ||
files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"], | ||
languageOptions: { | ||
parserOptions: {} | ||
}, | ||
plugins: { | ||
"simple-import-sort": pluginSimpleImportSort, | ||
workspaces: pluginWorkspaces | ||
}, | ||
rules: { | ||
"simple-import-sort/imports": "error", | ||
"simple-import-sort/exports": "error", | ||
"workspaces/no-absolute-imports": "error" | ||
} | ||
}, | ||
pluginPrettierRecommended | ||
]; |
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 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
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 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 |
---|---|---|
@@ -1,4 +1,8 @@ | ||
src | ||
test | ||
tsconfig.compile.json | ||
coverage | ||
tsconfig.json | ||
tsconfig.*.json | ||
__mock__ | ||
*.spec.js | ||
*.tsbuildinfo |
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
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,28 @@ | ||
{ | ||
"extends": "@tsed/typescript/tsconfig.node.json", | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"module": "commonjs", | ||
"moduleResolution": "Node16", | ||
"rootDir": "src", | ||
"outDir": "./lib/cjs", | ||
"declaration": true, | ||
"declarationDir": "./lib/types", | ||
"composite": true, | ||
"noEmit": false | ||
}, | ||
"include": ["src", "src/**/*.json"], | ||
"exclude": [ | ||
"node_modules", | ||
"test", | ||
"lib", | ||
"benchmark", | ||
"coverage", | ||
"spec", | ||
"**/*.benchmark.ts", | ||
"**/*.spec.ts", | ||
"keys", | ||
"**/__mock__/**", | ||
"webpack.config.js" | ||
] | ||
} |
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
Oops, something went wrong.