From d4168ede774ec75d8ca9264c194d6f852ce22fcb Mon Sep 17 00:00:00 2001 From: tomasz-io Date: Mon, 21 Oct 2024 22:39:10 +0700 Subject: [PATCH] improv: linting --- .eslintrc.shared.json | 36 ++++++++++++++++++++++++++++++++ core/.eslintrc.json | 13 ++---------- core/package.json | 2 -- extensions/vscode/.eslintrc.json | 16 ++++---------- extensions/vscode/package.json | 3 +-- package.json | 4 +++- 6 files changed, 46 insertions(+), 28 deletions(-) create mode 100644 .eslintrc.shared.json diff --git a/.eslintrc.shared.json b/.eslintrc.shared.json new file mode 100644 index 000000000..f4b9c4c78 --- /dev/null +++ b/.eslintrc.shared.json @@ -0,0 +1,36 @@ +{ + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module" + }, + "plugins": ["@typescript-eslint", "import"], + "rules": { + "@typescript-eslint/semi": "warn", + "curly": "warn", + "eqeqeq": "warn", + "no-throw-literal": "warn", + "semi": "off", + "import/order": [ + "warn", + { + "groups": [ + "builtin", + "external", + "internal", + "parent", + "sibling", + "index", + "object", + "type" + ], + "alphabetize": { + "order": "asc", + "caseInsensitive": true + }, + "newlines-between": "always" + } + ] + }, + "ignorePatterns": ["out", "dist", "**/*.d.ts"] +} diff --git a/core/.eslintrc.json b/core/.eslintrc.json index 04097f4db..ce1bc2575 100644 --- a/core/.eslintrc.json +++ b/core/.eslintrc.json @@ -1,21 +1,12 @@ { "root": true, - "parser": "@typescript-eslint/parser", + "extends": ["../.eslintrc.shared.json"], "parserOptions": { - "ecmaVersion": 6, - "sourceType": "module", "project": "./tsconfig.json" }, - "plugins": ["@typescript-eslint", "import"], "rules": { "quotes": ["warn", "double", {}], "@typescript-eslint/naming-convention": "off", - "@typescript-eslint/semi": "warn", - "curly": "warn", - "eqeqeq": "warn", - "no-throw-literal": "warn", - "semi": "off", "@typescript-eslint/no-floating-promises": "warn" - }, - "ignorePatterns": ["out", "dist", "**/*.d.ts"] + } } diff --git a/core/package.json b/core/package.json index bdda48184..ed489d1f2 100644 --- a/core/package.json +++ b/core/package.json @@ -32,7 +32,6 @@ "cross-env": "^7.0.3", "esbuild": "0.17.19", "eslint": "^8", - "eslint-plugin-import": "^2.29.1", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", "myers-diff": "^2.1.0", @@ -49,7 +48,6 @@ "@mozilla/readability": "^0.5.0", "@octokit/rest": "^20.0.2", "@typescript-eslint/eslint-plugin": "^7.8.0", - "@typescript-eslint/parser": "^7.8.0", "@xenova/transformers": "2.14.0", "adf-to-md": "^1.1.0", "async-mutex": "^0.5.0", diff --git a/extensions/vscode/.eslintrc.json b/extensions/vscode/.eslintrc.json index 5dfecab7e..c25ccff20 100644 --- a/extensions/vscode/.eslintrc.json +++ b/extensions/vscode/.eslintrc.json @@ -1,18 +1,10 @@ { "root": true, - "parser": "@typescript-eslint/parser", "parserOptions": { - "ecmaVersion": 6, - "sourceType": "module" + "project": "./tsconfig.json" }, - "plugins": ["@typescript-eslint"], + "extends": ["../../.eslintrc.shared.json"], "rules": { - "@typescript-eslint/naming-convention": "warn", - "@typescript-eslint/semi": "warn", - "curly": "warn", - "eqeqeq": "warn", - "no-throw-literal": "warn", - "semi": "off" - }, - "ignorePatterns": ["out", "dist", "**/*.d.ts"] + "@typescript-eslint/naming-convention": "warn" + } } diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index 28a70181a..49b687fe3 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -2,7 +2,7 @@ "name": "continue", "icon": "media/icon.png", "author": "Continue Dev, Inc", - "version": "0.9.220", + "version": "0.9.222", "repository": { "type": "git", "url": "https://github.com/continuedev/continue" @@ -539,7 +539,6 @@ "@types/vscode": "1.70", "@types/ws": "^8.5.4", "@typescript-eslint/eslint-plugin": "^5.45.0", - "@typescript-eslint/parser": "^5.45.0", "@vscode/vsce": "^2.22.0", "cargo-cp-artifact": "^0.1", "esbuild": "0.17.19", diff --git a/package.json b/package.json index 88e26a707..6d93be403 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,8 @@ { "devDependencies": { "prettier": "^3.3.3", - "prettier-plugin-tailwindcss": "^0.6.8" + "prettier-plugin-tailwindcss": "^0.6.8", + "@typescript-eslint/parser": "^7.8.0", + "eslint-plugin-import": "^2.29.1" } }