forked from Dablclub/agentcamp-eliza
-
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.
test: add linter to all packages and enable vitest
- Loading branch information
Showing
47 changed files
with
1,699 additions
and
30 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 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,66 @@ | ||
import eslint from "@eslint/js"; | ||
import tseslint from "@typescript-eslint/eslint-plugin"; | ||
import typescript from "@typescript-eslint/parser"; | ||
import prettier from "eslint-config-prettier"; | ||
import vitest from "eslint-plugin-vitest"; // Add Vitest plugin | ||
|
||
export default [ | ||
// JavaScript and TypeScript files | ||
{ | ||
files: ["src/**/*.js", "src/**/*.cjs", "src/**/*.mjs", "src/**/*.ts"], | ||
languageOptions: { | ||
parser: typescript, | ||
parserOptions: { | ||
ecmaVersion: "latest", | ||
sourceType: "module", | ||
project: "./tsconfig.json", // Make sure your tsconfig includes @types/node | ||
}, | ||
globals: { | ||
// Add Node.js globals | ||
NodeJS: "readonly", | ||
console: "readonly", | ||
process: "readonly", | ||
Buffer: "readonly", | ||
__dirname: "readonly", | ||
__filename: "readonly", | ||
module: "readonly", | ||
require: "readonly", | ||
}, | ||
}, | ||
plugins: { | ||
"@typescript-eslint": tseslint, | ||
}, | ||
rules: { | ||
...eslint.configs.recommended.rules, | ||
...tseslint.configs.recommended.rules, | ||
"prefer-const": "warn", | ||
"no-constant-binary-expression": "error", | ||
|
||
// Disable no-undef as TypeScript handles this better | ||
"no-undef": "off", | ||
"@typescript-eslint/no-unsafe-function-type": "off", | ||
// Customize TypeScript rules | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ | ||
argsIgnorePattern: "^_", | ||
varsIgnorePattern: "^_", | ||
ignoreRestSiblings: true, | ||
}, | ||
], | ||
}, | ||
}, | ||
// Vitest configuration | ||
{ | ||
files: ["src/**/*.test.js", "src/**/*.test.ts", "src/**/*.spec.js", "src/**/*.spec.ts"], | ||
plugins: { | ||
vitest, // Register Vitest plugin | ||
}, | ||
rules: { | ||
...vitest.configs.recommended.rules, | ||
}, | ||
}, | ||
// Add prettier as the last config to override other formatting rules | ||
prettier, | ||
]; |
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,66 @@ | ||
import eslint from "@eslint/js"; | ||
import tseslint from "@typescript-eslint/eslint-plugin"; | ||
import typescript from "@typescript-eslint/parser"; | ||
import prettier from "eslint-config-prettier"; | ||
import vitest from "eslint-plugin-vitest"; // Add Vitest plugin | ||
|
||
export default [ | ||
// JavaScript and TypeScript files | ||
{ | ||
files: ["src/**/*.js", "src/**/*.cjs", "src/**/*.mjs", "src/**/*.ts"], | ||
languageOptions: { | ||
parser: typescript, | ||
parserOptions: { | ||
ecmaVersion: "latest", | ||
sourceType: "module", | ||
project: "./tsconfig.json", // Make sure your tsconfig includes @types/node | ||
}, | ||
globals: { | ||
// Add Node.js globals | ||
NodeJS: "readonly", | ||
console: "readonly", | ||
process: "readonly", | ||
Buffer: "readonly", | ||
__dirname: "readonly", | ||
__filename: "readonly", | ||
module: "readonly", | ||
require: "readonly", | ||
}, | ||
}, | ||
plugins: { | ||
"@typescript-eslint": tseslint, | ||
}, | ||
rules: { | ||
...eslint.configs.recommended.rules, | ||
...tseslint.configs.recommended.rules, | ||
"prefer-const": "warn", | ||
"no-constant-binary-expression": "error", | ||
|
||
// Disable no-undef as TypeScript handles this better | ||
"no-undef": "off", | ||
"@typescript-eslint/no-unsafe-function-type": "off", | ||
// Customize TypeScript rules | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ | ||
argsIgnorePattern: "^_", | ||
varsIgnorePattern: "^_", | ||
ignoreRestSiblings: true, | ||
}, | ||
], | ||
}, | ||
}, | ||
// Vitest configuration | ||
{ | ||
files: ["src/**/*.test.js", "src/**/*.test.ts", "src/**/*.spec.js", "src/**/*.spec.ts"], | ||
plugins: { | ||
vitest, // Register Vitest plugin | ||
}, | ||
rules: { | ||
...vitest.configs.recommended.rules, | ||
}, | ||
}, | ||
// Add prettier as the last config to override other formatting rules | ||
prettier, | ||
]; |
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 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,66 @@ | ||
import eslint from "@eslint/js"; | ||
import tseslint from "@typescript-eslint/eslint-plugin"; | ||
import typescript from "@typescript-eslint/parser"; | ||
import prettier from "eslint-config-prettier"; | ||
import vitest from "eslint-plugin-vitest"; // Add Vitest plugin | ||
|
||
export default [ | ||
// JavaScript and TypeScript files | ||
{ | ||
files: ["src/**/*.js", "src/**/*.cjs", "src/**/*.mjs", "src/**/*.ts"], | ||
languageOptions: { | ||
parser: typescript, | ||
parserOptions: { | ||
ecmaVersion: "latest", | ||
sourceType: "module", | ||
project: "./tsconfig.json", // Make sure your tsconfig includes @types/node | ||
}, | ||
globals: { | ||
// Add Node.js globals | ||
NodeJS: "readonly", | ||
console: "readonly", | ||
process: "readonly", | ||
Buffer: "readonly", | ||
__dirname: "readonly", | ||
__filename: "readonly", | ||
module: "readonly", | ||
require: "readonly", | ||
}, | ||
}, | ||
plugins: { | ||
"@typescript-eslint": tseslint, | ||
}, | ||
rules: { | ||
...eslint.configs.recommended.rules, | ||
...tseslint.configs.recommended.rules, | ||
"prefer-const": "warn", | ||
"no-constant-binary-expression": "error", | ||
|
||
// Disable no-undef as TypeScript handles this better | ||
"no-undef": "off", | ||
"@typescript-eslint/no-unsafe-function-type": "off", | ||
// Customize TypeScript rules | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ | ||
argsIgnorePattern: "^_", | ||
varsIgnorePattern: "^_", | ||
ignoreRestSiblings: true, | ||
}, | ||
], | ||
}, | ||
}, | ||
// Vitest configuration | ||
{ | ||
files: ["src/**/*.test.js", "src/**/*.test.ts", "src/**/*.spec.js", "src/**/*.spec.ts"], | ||
plugins: { | ||
vitest, // Register Vitest plugin | ||
}, | ||
rules: { | ||
...vitest.configs.recommended.rules, | ||
}, | ||
}, | ||
// Add prettier as the last config to override other formatting rules | ||
prettier, | ||
]; |
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 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,66 @@ | ||
import eslint from "@eslint/js"; | ||
import tseslint from "@typescript-eslint/eslint-plugin"; | ||
import typescript from "@typescript-eslint/parser"; | ||
import prettier from "eslint-config-prettier"; | ||
import vitest from "eslint-plugin-vitest"; // Add Vitest plugin | ||
|
||
export default [ | ||
// JavaScript and TypeScript files | ||
{ | ||
files: ["src/**/*.js", "src/**/*.cjs", "src/**/*.mjs", "src/**/*.ts"], | ||
languageOptions: { | ||
parser: typescript, | ||
parserOptions: { | ||
ecmaVersion: "latest", | ||
sourceType: "module", | ||
project: "./tsconfig.json", // Make sure your tsconfig includes @types/node | ||
}, | ||
globals: { | ||
// Add Node.js globals | ||
NodeJS: "readonly", | ||
console: "readonly", | ||
process: "readonly", | ||
Buffer: "readonly", | ||
__dirname: "readonly", | ||
__filename: "readonly", | ||
module: "readonly", | ||
require: "readonly", | ||
}, | ||
}, | ||
plugins: { | ||
"@typescript-eslint": tseslint, | ||
}, | ||
rules: { | ||
...eslint.configs.recommended.rules, | ||
...tseslint.configs.recommended.rules, | ||
"prefer-const": "warn", | ||
"no-constant-binary-expression": "error", | ||
|
||
// Disable no-undef as TypeScript handles this better | ||
"no-undef": "off", | ||
"@typescript-eslint/no-unsafe-function-type": "off", | ||
// Customize TypeScript rules | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ | ||
argsIgnorePattern: "^_", | ||
varsIgnorePattern: "^_", | ||
ignoreRestSiblings: true, | ||
}, | ||
], | ||
}, | ||
}, | ||
// Vitest configuration | ||
{ | ||
files: ["src/**/*.test.js", "src/**/*.test.ts", "src/**/*.spec.js", "src/**/*.spec.ts"], | ||
plugins: { | ||
vitest, // Register Vitest plugin | ||
}, | ||
rules: { | ||
...vitest.configs.recommended.rules, | ||
}, | ||
}, | ||
// Add prettier as the last config to override other formatting rules | ||
prettier, | ||
]; |
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.