-
Notifications
You must be signed in to change notification settings - Fork 6
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 #137 from autonomys/feat/af-lint
Feat/af lint
- Loading branch information
Showing
4 changed files
with
7,485 additions
and
4,180 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 |
---|---|---|
|
@@ -7,4 +7,3 @@ config/ | |
dsn-kol-schemas.json | ||
memories/ | ||
!src/config/ | ||
|
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,113 @@ | ||
import globals from "globals"; | ||
import pluginJs from "@eslint/js"; | ||
import tseslint from "typescript-eslint"; | ||
import prettier from "eslint-plugin-prettier"; | ||
import eslintConfigPrettier from "eslint-config-prettier"; | ||
|
||
/** @type {import('eslint').Linter.Config[]} */ | ||
export default [ | ||
// TypeScript files configuration | ||
{ | ||
files: ["**/*.ts"], | ||
languageOptions: { | ||
ecmaVersion: 2022, | ||
sourceType: "module", | ||
globals: { | ||
...globals.node, | ||
...globals.browser | ||
}, | ||
parser: tseslint.parser, | ||
parserOptions: { | ||
project: "./tsconfig.json", | ||
sourceType: "module" | ||
} | ||
}, | ||
plugins: { | ||
"@typescript-eslint": tseslint.plugin, | ||
prettier: prettier | ||
}, | ||
rules: { | ||
// TypeScript specific rules | ||
"@typescript-eslint/explicit-function-return-type": "off", | ||
"@typescript-eslint/no-explicit-any": "warn", | ||
"@typescript-eslint/no-unused-vars": ["warn", { | ||
"argsIgnorePattern": "^_", | ||
"varsIgnorePattern": "^_" | ||
}], | ||
"@typescript-eslint/no-non-null-assertion": "warn", | ||
|
||
// General rules | ||
"no-console": ["warn", { allow: ["warn", "error", "info"] }], | ||
"prettier/prettier": "error", | ||
|
||
// Character file specific rules | ||
"no-template-curly-in-string": "error", | ||
"no-multi-str": "error", | ||
"prefer-template": "error", | ||
"quotes": ["error", "single", { "avoidEscape": true }], | ||
|
||
// Import rules | ||
"sort-imports": ["error", { | ||
"ignoreCase": true, | ||
"ignoreDeclarationSort": true | ||
}] | ||
} | ||
}, | ||
|
||
// JavaScript files configuration | ||
{ | ||
files: ["**/*.{js,mjs,cjs}"], | ||
languageOptions: { | ||
ecmaVersion: 2022, | ||
sourceType: "module", | ||
globals: { | ||
...globals.node, | ||
...globals.browser | ||
} | ||
}, | ||
plugins: { | ||
prettier: prettier | ||
}, | ||
rules: { | ||
// General rules | ||
"no-console": ["warn", { allow: ["warn", "error", "info"] }], | ||
"prettier/prettier": "error", | ||
|
||
// Character file specific rules | ||
"no-template-curly-in-string": "error", | ||
"no-multi-str": "error", | ||
"prefer-template": "error", | ||
"quotes": ["error", "single", { "avoidEscape": true }], | ||
|
||
// Import rules | ||
"sort-imports": ["error", { | ||
"ignoreCase": true, | ||
"ignoreDeclarationSort": true | ||
}] | ||
} | ||
}, | ||
|
||
// Prettier configuration | ||
eslintConfigPrettier, | ||
|
||
// Additional configurations for specific file patterns | ||
{ | ||
files: ["src/agents/workflows/kol/characters/*.ts"], | ||
rules: { | ||
// Character file specific validations | ||
"@typescript-eslint/naming-convention": [ | ||
"error", | ||
{ | ||
"selector": "variable", | ||
"format": ["camelCase"], | ||
"filter": { | ||
"regex": "^(name|username|description|personality|expertise|rules|trendFocus|contentFocus|replyStyle|wordsToAvoid|engagementCriteria|walletAddress)$", | ||
"match": true | ||
} | ||
} | ||
], | ||
"no-multi-str": "error", | ||
"no-template-curly-in-string": "error" | ||
} | ||
} | ||
]; |
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.