Skip to content

Commit

Permalink
eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
platypii committed Jun 6, 2024
1 parent 4d46051 commit 7a21d3d
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"env": {
"browser": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"plugins": ["import", "jsdoc"],
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "warn",
"arrow-spacing": "error",
"camelcase": "off",
"comma-spacing": "error",
"comma-dangle": ["error", "always-multiline"],
"eol-last": "error",
"eqeqeq": "error",
"func-style": ["error", "declaration"],
"import/order": [
"error",
{
"alphabetize": {
"caseInsensitive": true,
"order": "asc"
},
"groups": [["builtin", "external"], "internal", "parent", "sibling", "index"]
}
],
"indent": ["error", 2],
"jsdoc/check-param-names": "error",
"jsdoc/check-property-names": "error",
"jsdoc/check-tag-names": "error",
"jsdoc/require-param": "error",
"jsdoc/require-param-type": "error",
"jsdoc/require-returns": "error",
"jsdoc/require-returns-type": "error",
"jsdoc/sort-tags": "error",
"no-constant-condition": "off",
"no-extra-parens": "error",
"no-multi-spaces": "error",
"no-trailing-spaces": "error",
"no-useless-concat": "error",
"no-useless-rename": "error",
"no-useless-return": "error",
"no-var": "error",
"object-curly-spacing": ["error", "always"],
"prefer-const": "error",
"prefer-destructuring": ["warn", {"object": true, "array": false}],
"prefer-promise-reject-errors": "error",
"quotes": ["error", "single"],
"require-await": "warn",
"semi": ["error", "never"],
"sort-imports": ["error", {
"ignoreDeclarationSort": true,
"ignoreMemberSort": false,
"memberSyntaxSortOrder": ["none", "all", "multiple", "single"]
}],
"space-infix-ops": "error"
}
}
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ on:
push:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm i
- run: npm run lint

typecheck:
runs-on: ubuntu-latest
steps:
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@
"hyperparam": "./src/cli.js"
},
"scripts": {
"lint": "eslint .",
"test": "vitest run"
},
"devDependencies": {
"@types/node": "20.14.2",
"@typescript-eslint/eslint-plugin": "7.11.0",
"eslint": "8.57.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jsdoc": "48.2.7",
"typescript": "5.4.5",
"vitest": "1.6.0"
}
Expand Down
1 change: 1 addition & 0 deletions src/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const messages = [{ role: 'system', content: systemPrompt }]

/**
* @param {Object} chatInput
* @returns {Promise<string>}
*/
function sendToServer(chatInput) {
return new Promise((resolve, reject) => {
Expand Down

0 comments on commit 7a21d3d

Please sign in to comment.