forked from elizaOS/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: fix linter errors and add linter to pre-commit hook
- Loading branch information
Showing
68 changed files
with
269 additions
and
1,496 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
pnpm run prettier-check | ||
pnpm run lint |
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 @@ | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,3 @@ | ||
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 | ||
import eslintGlobalConfig from "../../eslint.global.mjs"; | ||
|
||
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, | ||
]; | ||
export default [...eslintGlobalConfig]; |
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,71 +1,3 @@ | ||
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 | ||
import eslintGlobalConfig from "../../eslint.global.mjs"; | ||
|
||
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, | ||
]; | ||
export default [...eslintGlobalConfig]; |
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,71 +1,3 @@ | ||
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 | ||
import eslintGlobalConfig from "../../eslint.global.mjs"; | ||
|
||
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, | ||
]; | ||
export default [...eslintGlobalConfig]; |
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 |
---|---|---|
@@ -1,71 +1,3 @@ | ||
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 | ||
import eslintGlobalConfig from "../../eslint.global.mjs"; | ||
|
||
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, | ||
]; | ||
export default [...eslintGlobalConfig]; |
Oops, something went wrong.