Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add lint and prettier check in workflow #955

Merged
merged 39 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ba8a2fc
ran prettier on the code base
plxity Dec 5, 2024
2c000e5
added github action to verify linting and formatting
plxity Dec 5, 2024
1d3fe0e
fixed config
plxity Dec 5, 2024
21d3f78
fixed eslint error
plxity Dec 5, 2024
91668f2
fixed folder directory
plxity Dec 5, 2024
b016720
fixed script
plxity Dec 5, 2024
5c9135d
updated warning limit
plxity Dec 5, 2024
6345851
fixed script
plxity Dec 5, 2024
5c21131
fixed script
plxity Dec 5, 2024
ab41179
fixed script
plxity Dec 5, 2024
cf14c9c
fixed script
plxity Dec 5, 2024
4bcfbf7
fixed script
plxity Dec 5, 2024
363f093
fixed script
plxity Dec 5, 2024
7e5cbec
fixed script
plxity Dec 5, 2024
571ff28
updated warning limit
plxity Dec 5, 2024
e1a47c0
fixed script
plxity Dec 5, 2024
3729079
added prettier
plxity Dec 5, 2024
ea16312
fixed script
plxity Dec 5, 2024
41c60c7
fixed script
plxity Dec 5, 2024
a328121
Merge branch 'master' into ENG-2785
plxity Dec 6, 2024
a274541
Merge branch 'master' into ENG-2785
plxity Dec 9, 2024
dc7f18f
feat: staged changes
himanshu-dixit Dec 9, 2024
615d834
feat: remove package lock and add eslint
himanshu-dixit Dec 9, 2024
d895ee4
Merge branch 'master' of github.com:ComposioHQ/composio into ft-ENG-2…
himanshu-dixit Dec 9, 2024
bfcff89
feat: pnpm lock
himanshu-dixit Dec 9, 2024
63a74a1
feat: changes
himanshu-dixit Dec 9, 2024
177cd45
feat: package change
himanshu-dixit Dec 9, 2024
929d7dc
feat: change to push
himanshu-dixit Dec 9, 2024
aa0db07
feat: revert lint
himanshu-dixit Dec 9, 2024
7629399
feat: disable no console in cli
himanshu-dixit Dec 9, 2024
3bf800c
feat: remove any
himanshu-dixit Dec 9, 2024
d9a0855
feat: add setup cli
himanshu-dixit Dec 9, 2024
bfabe4e
feat: rollup
himanshu-dixit Dec 9, 2024
70fba4b
fix: add support for main
himanshu-dixit Dec 9, 2024
633f47f
run prettier on changed file
plxity Dec 9, 2024
06f7888
feat: connectedAccount fix
himanshu-dixit Dec 9, 2024
e3a0908
feat: logger
himanshu-dixit Dec 9, 2024
d7e7e0f
fix: eslint issues
himanshu-dixit Dec 9, 2024
1ac2fd1
feat: prettier
himanshu-dixit Dec 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/lint_js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Check Linting and Formatting (JS)

on:
push:
paths:
- '**/*.js'
- '**/*.ts'
pull_request:
paths:
- '**/*.js'
- '**/*.ts'

jobs:
lint-and-prettify:
runs-on: ubuntu-latest

defaults:
run:
working-directory: js

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install pnpm
run: npm install -g pnpm

- name: Install packages in js folder
run: pnpm install --frozen-lockfile

- name: Run ESLint
run: pnpm run eslint
continue-on-error: false

- name: Run Prettier
run: pnpm run prettier:check
continue-on-error: false
24 changes: 24 additions & 0 deletions js/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

{
"arrowParens": "always",
"bracketSpacing": true,
"endOfLine": "lf",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"singleAttributePerLine": false,
"bracketSameLine": false,
"jsxBracketSameLine": false,
"jsxSingleQuote": false,
"printWidth": 80,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false,
"embeddedLanguageFormatting": "auto",
"vueIndentScriptAndStyle": false,
"experimentalTernaries": false
}
21 changes: 12 additions & 9 deletions js/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';


/** @type {import('eslint').Linter.Config[]} */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider specifying a parser in the ESLint configuration, such as @typescript-eslint/parser, to ensure proper linting of TypeScript files.

export default [
{languageOptions: { globals: globals.node },},
pluginJs.configs.recommended,
// eslintPluginPrettierRecommended,
{files: ["src/**/*.{ts,js}"]},
{languageOptions: { globals: globals.browser }},
...tseslint.configs.recommended,
{
rules: {
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-require-imports": "warn",
"@typescript-eslint/no-unsafe-function-type": "off",
"no-prototype-builtins": "off",
"@typescript-eslint/ban-types": "error",
"max-lines-per-function": ["error", 250],
"no-unused-vars": "off",
"@typescript-eslint/ban-ts-comment": "off",
"no-constant-condition": "off",
"no-ex-assign": "off",
"no-constant-binary-expression": "off",
"@typescript-eslint/no-empty-object-type": "warn",
"@typescript-eslint/no-non-null-asserted-optional-chain": "off",
"no-unsafe-optional-chaining": "off",
"no-extra-boolean-cast": "off",
"no-console": "error",
"no-var": "warn",
"prefer-const": "warn",
"no-console": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": [
"warn", // or "error"
"warn",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
Expand All @@ -34,4 +38,3 @@ export default [
},
},
];

65 changes: 35 additions & 30 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "composio-core",
"version": "0.3.2",
"description": "",
"main": "dist/src/index.js",
"main": "dist/index.js",
"scripts": {
"test": "jest --testMatch=\"**/*.spec.ts\"",
"test:watch": "jest --testMatch=\"**/*.spec.ts\" --watch",
Expand All @@ -11,14 +11,16 @@
"openapispec:generate": "npx @hey-api/openapi-ts",
"run:cli": "ts-node src/cli/index.ts",
"run:sample": "ts-node sample.ts",
"build": "rollup -c rollup.config.mjs",
"eslint": "eslint 'src/**/*.{ts,js}' --max-warnings=281",
"prettier": "prettier --write 'src/**/*.{ts,js,cjs}'",
"prettier:check": "prettier --check 'src/**/*.{ts,js,mjs,cjs}'",
"build": "rollup -c rollup.config.mjs && ./setup_cli.sh",
"lint": "eslint 'src/**/*.ts'",
"prettier": "prettier --write 'src/**/*.ts'",
"format": "pnpm lint && pnpm prettier"
},
"bin": {
"composio-js": "./dist/src/cli/index",
"composio": "./dist/src/cli/index"
"composio-js": "./dist/cli/index",
"composio": "./dist/cli/index"
},
"lint-staged": {
"src/**/*.{js,jsx,ts,tsx}": "eslint --fix"
Expand All @@ -27,11 +29,22 @@
"author": "Utkarsh Dixit <utkarsh@composio.dev>",
"license": "ISC",
"devDependencies": {
"@ai-sdk/openai": "^0.0.36",
"@cloudflare/workers-types": "^4.20240718.0",
"@e2b/code-interpreter": "^0.0.8",
"@e2b/sdk": "^0.16.1",
"@eslint/js": "^9.16.0",
"@faker-js/faker": "^8.4.1",
"@hey-api/client-axios": "^0.2.3",
"@hey-api/openapi-ts": "^0.52.4",
"@hono/node-server": "^1.12.0",
"@jest/globals": "^29.7.0",
"@rollup/plugin-commonjs": "^25.0.7",
"@langchain/core": "^0.2.18",
"@langchain/openai": "^0.2.5",
"@rollup/plugin-commonjs": "^25.0.8",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^6.0.1",
"@rollup/plugin-typescript": "^11.1.6",
"@swc/core": "^1.7.10",
"@swc/helpers": "^0.5.12",
Expand All @@ -42,53 +55,45 @@
"@types/node": "^20.14.2",
"@types/uuid": "^10.0.0",
"@types/winston": "^2.4.4",
"axios-mock-adapter": "^2.1.0",
"jest": "^29.7.0",
"jest-html-reporters": "^3.1.7",
"regenerator-runtime": "^0.14.1",
"rollup": "^4.9.1",
"rollup-plugin-dts": "^6.1.0",
"ts-jest": "^29.1.2",
"ts-loader": "^9.5.1",
"tslib": "^2.6.2",
"typedoc": "^0.25.13",
"typescript": "^5.4.5",
"wrangler": "^3.63.1",
"@ai-sdk/openai": "^0.0.36",
"@e2b/code-interpreter": "^0.0.8",
"@e2b/sdk": "^0.16.1",
"@faker-js/faker": "^8.4.1",
"@hey-api/client-axios": "^0.2.3",
"@hono/node-server": "^1.12.0",
"@langchain/core": "^0.2.18",
"@langchain/openai": "^0.2.5",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-replace": "^6.0.1",
"ai": "^3.2.22",
"axios": "^1.7.2",
"axios-mock-adapter": "^2.1.0",
"chalk": "^4",
"cli-progress": "^3.12.0",
"colors": "^1.4.0",
"commander": "^12.1.0",
"dockerode": "^4.0.2",
"e2b": "^0.16.1",
"enumify": "^2.0.0",
"eslint": "^9.16.0",
"globals": "^15.13.0",
"hono": "^4.4.11",
"inquirer": "^10.2.2",
"jest": "^29.7.0",
"jest-html-reporters": "^3.1.7",
"langchain": "^0.2.11",
"open": "^8.4.0",
"openai": "^4.50.0",
"prettier": "^3.4.2",
"pusher-js": "8.4.0-rc2",
"regenerator-runtime": "^0.14.1",
"resolve-package-path": "^4.0.3",
"rollup": "^4.9.1",
"rollup-plugin-dts": "^6.1.0",
"rollup-plugin-terser": "^7.0.2",
"ts-jest": "^29.1.2",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"tslib": "^2.6.2",
"typedoc": "^0.25.13",
"typescript": "^5.4.5",
"typescript-eslint": "^8.17.0",
"uuid": "^10.0.0",
"winston": "^3.13.1",
"wrangler": "^3.63.1",
"zod": "^3.23.8",
"zod-to-json-schema": "^3.23.2"
},
"dependencies": {
},
"publishConfig": {
"access": "public"
}
Expand Down
Loading
Loading