diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 2bdeaa49..dd9a1c24 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -48,24 +48,3 @@ jobs:
- name: VSCE Packge
run: npx vsce package
-
- darwin:
- name: macOS
- runs-on: macos-latest
- timeout-minutes: 30
- steps:
- - uses: actions/checkout@v2
-
- - name: Setup Node.js environment
- uses: actions/setup-node@v2
- with:
- node-version: 14
-
- - name: Install Node.js modules
- run: npm install
-
- - name: Lint
- run: npm run lint
-
- - name: VSCE Packge
- run: npx vsce package
diff --git a/.vscode/settings.json b/.vscode/settings.json
index a2d0a8b1..5e5ca483 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,5 +1,5 @@
{
- "editor.formatOnSave": true,
+ "editor.formatOnSave": false,
"editor.insertSpaces": true,
"editor.tabSize": 4,
"files.insertFinalNewline": true,
@@ -10,5 +10,8 @@
".vscode-test": true
},
"tslint.autoFixOnSave": true,
- "tslint.ignoreDefinitionFiles": true
-}
\ No newline at end of file
+ "tslint.ignoreDefinitionFiles": true,
+ "prettier.tabWidth": 4,
+ "prettier.useTabs": false,
+ "prettier.printWidth": 150
+}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0de174fc..b9d7d46e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,22 @@ All notable changes to the "leetcode" extension will be documented in this file.
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
+## [0.18.4]
+### Added
+- change graphql path
+
+## [0.18.3]
+### Added
+- re-add cookie-based login method [PR#969](https://github.com/LeetCode-OpenSource/vscode-leetcode/pull/969)
+
+## [0.18.2]
+### Fixed
+- fix login issue on VS Code Insiders [PR#968](https://github.com/LeetCode-OpenSource/vscode-leetcode/pull/968)
+
+## [0.18.1]
+### Changed
+- change login way and add tracking logic option [PR#944](https://github.com/LeetCode-OpenSource/vscode-leetcode/pull/944)
+
## [0.18.0]
### Added
- Add `star` command in shortcuts [PR#601](https://github.com/LeetCode-OpenSource/vscode-leetcode/pull/601)
diff --git a/README.md b/README.md
index cfe37701..623e95f2 100644
--- a/README.md
+++ b/README.md
@@ -23,6 +23,7 @@
- English Document | [中文文档](https://github.com/LeetCode-OpenSource/vscode-leetcode/blob/master/docs/README_zh-CN.md)
## ❗️ Attention ❗️- Workaround to login to LeetCode endpoint
+
> Note: If you are using `leetcode.cn`, you can just ignore this section.
Recently we observed that [the extension cannot login to leetcode.com endpoint anymore](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/478). The root cause of this issue is that leetcode.com changed its login mechanism and so far there is no ideal way to fix that issue.
@@ -32,9 +33,10 @@ Thanks for [@yihong0618](https://github.com/yihong0618) provided a workaround wh
> Note: If you want to use third-party login(**Recommended**), please make sure your account has been connected to the third-party. If you want to use `Cookie` login, click [here](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/478#issuecomment-564757098) to see the steps.
## Requirements
+
- [VS Code 1.30.1+](https://code.visualstudio.com/)
- [Node.js 10+](https://nodejs.org)
- > NOTE: Please make sure that `Node` is in your `PATH` environment variable. You can also use the setting `leetcode.nodePath` to specify the location of your `Node.js` executable.
+ > NOTE: Please make sure that `Node` is in your `PATH` environment variable. You can also use the setting `leetcode.nodePath` to specify the location of your `Node.js` executable.
## Quick Start
@@ -43,6 +45,7 @@ Thanks for [@yihong0618](https://github.com/yihong0618) provided a workaround wh
## Features
### Sign In/Out
+
@@ -52,9 +55,11 @@ Thanks for [@yihong0618](https://github.com/yihong0618) provided a workaround wh
- You can also use the following command to sign in/out:
- **LeetCode: Sign in**
- **LeetCode: Sign out**
+
---
### Switch Endpoint
+
@@ -62,6 +67,7 @@ Thanks for [@yihong0618](https://github.com/yihong0618) provided a workaround wh
- By clicking the button  at the **explorer's navigation bar**, you can switch between different endpoints.
- The supported endpoints are:
+
- **leetcode.com**
- **leetcode.cn**
@@ -70,6 +76,7 @@ Thanks for [@yihong0618](https://github.com/yihong0618) provided a workaround wh
---
### Pick a Problem
+
@@ -86,11 +93,13 @@ Thanks for [@yihong0618](https://github.com/yihong0618) provided a workaround wh
---
### Editor Shortcuts
+
- The extension supports 5 editor shortcuts (aka Code Lens):
+
- `Submit`: Submit your answer to LeetCode.
- `Test`: Test your answer with customized test cases.
- `Star/Unstar`: Star or unstar the current problem.
@@ -102,6 +111,7 @@ Thanks for [@yihong0618](https://github.com/yihong0618) provided a workaround wh
---
### Search problems by Keywords
+
@@ -111,19 +121,18 @@ Thanks for [@yihong0618](https://github.com/yihong0618) provided a workaround wh
---
### Manage Session
+
- To manage your LeetCode sessions, just clicking the `LeetCode: ***` at the bottom of the status bar. You can **switch** between sessions or **create**, **delete** a session.
-
## Settings
| Setting Name | Description | Default Value |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
| `leetcode.hideSolved` | Specify to hide the solved problems or not | `false` |
-| `leetcode.showLocked` | Specify to show the locked problems or not. Only Premium users could open the locked problems | `false` |
| `leetcode.defaultLanguage` | Specify the default language used to solve the problem. Supported languages are: `bash`, `c`, `cpp`, `csharp`, `golang`, `java`, `javascript`, `kotlin`, `mysql`, `php`, `python`,`python3`,`ruby`,`rust`, `scala`, `swift`, `typescript` | `N/A` |
| `leetcode.useWsl` | Specify whether to use WSL or not | `false` |
| `leetcode.endpoint` | Specify the active endpoint. Supported endpoints are: `leetcode`, `leetcode-cn` | `leetcode` |
@@ -137,6 +146,7 @@ Thanks for [@yihong0618](https://github.com/yihong0618) provided a workaround wh
| `leetcode.useEndpointTranslation` | Use endpoint's translation (if available) | `true` |
| `leetcode.colorizeProblems` | Add difficulty badge and colorize problems files in explorer tree | `true` |
| `leetcode.problems.sortStrategy` | Specify sorting strategy for problems list | `None` |
+| `leetcode.allowReportData` | Allow LeetCode to report anonymous usage data to improve the product. list | `true` |
## Want Help?
diff --git a/docs/README_zh-CN.md b/docs/README_zh-CN.md
index ad4c9a74..caf110bf 100644
--- a/docs/README_zh-CN.md
+++ b/docs/README_zh-CN.md
@@ -23,19 +23,20 @@
- [English Document](https://github.com/LeetCode-OpenSource/vscode-leetcode#requirements) | 中文文档
## ❗️ 注意 ❗️- 无法登录 LeetCode 节点的临时解决办法
+
> 注意:如果使用的是 `leetcode.cn` 账户,可以跳过此段落。
近期我们发现插件出现了[无法登录 leetcode.com 节点的问题](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/478)。原因是因为近期 leetcode.com 改变了登录机制,目前我们暂时没有找到解决该问题的完美解决方案。
感谢 [@yihong0618](https://github.com/yihong0618) 提供了一个临时解决办法。现在你可以直接点击登录按钮并选择第三方登录或者 `Cookie` 登录。
-
> 注意:如果你希望使用第三方登录(**推荐**),请确保你的账户已经与第三方账户连接。如果你希望通过 `Cookie` 登录,请点击[该连接](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/478#issuecomment-564757098)查看登录步骤。
## 运行条件
+
- [VS Code 1.23.0+](https://code.visualstudio.com/)
- [Node.js 10+](https://nodejs.org)
- > 注意:请确保`Node`在`PATH`环境变量中。您也可以通过设定 `leetcode.nodePath` 选项来指定 `Node.js` 可执行文件的路径。
+ > 注意:请确保`Node`在`PATH`环境变量中。您也可以通过设定 `leetcode.nodePath` 选项来指定 `Node.js` 可执行文件的路径。
## 快速开始
@@ -44,18 +45,21 @@
## 功能
### 登入登出
+
- 点击 `LeetCode Explorer` 中的 `Sign in to LeetCode` 即可登入。
-- 你也可以使用下来命令登入或利用cookie登入或登出:
+- 你也可以使用下来命令登入或利用 cookie 登入或登出:
- **LeetCode: Sign in**
- **LeetCode: Sign out**
+
---
### 切换 LeetCode 版本
+
@@ -63,6 +67,7 @@
- LeetCode 目前有**英文版**和**中文版**两种版本。点击 `LeetCode Explorer` 导航栏中的  按钮可切换版本。
- 目前可切换的版本有:
+
- **leetcode.com**
- **leetcode.cn**
@@ -71,6 +76,7 @@
---
### 选择题目
+
@@ -87,11 +93,13 @@
---
### 编辑器快捷方式
+
- 插件会在编辑区域内支持五种不同的快捷方式(Code Lens):
+
- `Submit`: 提交你的答案至 LeetCode;
- `Test`: 用给定的测试用例测试你的答案;
- `Star`: 收藏或取消收藏该问题;
@@ -103,6 +111,7 @@
---
### 通过关键字搜索题目
+
@@ -112,31 +121,33 @@
---
### 管理存档
+
- 点击位于 VS Code 底部状态栏的 `LeetCode: ***` 管理 `LeetCode 存档`。你可以**切换**存档或者**创建**,**删除**存档。
-
## 插件配置项
-| 配置项名称 | 描述 | 默认值 |
-| ---------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
-| `leetcode.hideSolved` | 指定是否要隐藏已解决的问题 | `false` |
-| `leetcode.showLocked` | 指定是否显示付费题目,只有付费账户才可以打开付费题目 | `false` |
-| `leetcode.defaultLanguage` | 指定答题时使用的默认语言,可选语言有:`bash`, `c`, `cpp`, `csharp`, `golang`, `java`, `javascript`, `kotlin`, `mysql`, `php`, `python`,`python3`,`ruby`, `rust`, `scala`, `swift`, `typescript` | `N/A` |
-| `leetcode.useWsl` | 指定是否启用 WSL | `false` |
-| `leetcode.endpoint` | 指定使用的终端,可用终端有:`leetcode`, `leetcode-cn` | `leetcode` |
-| `leetcode.workspaceFolder` | 指定保存文件的工作区目录 | `""` |
-| `leetcode.filePath` | 指定生成题目文件的相对文件夹路径名和文件名。点击查看[更多详细用法](https://github.com/LeetCode-OpenSource/vscode-leetcode/wiki/%E8%87%AA%E5%AE%9A%E4%B9%89%E9%A2%98%E7%9B%AE%E6%96%87%E4%BB%B6%E7%9A%84%E7%9B%B8%E5%AF%B9%E6%96%87%E4%BB%B6%E5%A4%B9%E8%B7%AF%E5%BE%84%E5%92%8C%E6%96%87%E4%BB%B6%E5%90%8D)。 | |
-| `leetcode.enableStatusBar` | 指定是否在 VS Code 下方显示插件状态栏。 | `true` |
-| `leetcode.editor.shortcuts` | 指定在编辑器内所自定义的快捷方式。可用的快捷方式有: `submit`, `test`, `star`, `solution`, `description`。 | `["submit, test"]` |
-| `leetcode.enableSideMode` | 指定在解决一道题时,是否将`问题预览`、`高票答案`与`提交结果`窗口集中在编辑器的第二栏。 | `true` |
-| `leetcode.nodePath` | 指定 `Node.js` 可执行文件的路径。如:C:\Program Files\nodejs\node.exe | `node` |
-| `leetcode.showCommentDescription` | 指定是否要在注释中显示题干。 | `false` |
-| `leetcode.useEndpointTranslation` | 是否显示翻译版本内容。 | `true` |
+
+| 配置项名称 | 描述 | 默认值 |
+| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
+| `leetcode.hideSolved` | 指定是否要隐藏已解决的问题 | `false` |
+| `leetcode.defaultLanguage` | 指定答题时使用的默认语言,可选语言有:`bash`, `c`, `cpp`, `csharp`, `golang`, `java`, `javascript`, `kotlin`, `mysql`, `php`, `python`,`python3`,`ruby`, `rust`, `scala`, `swift`, `typescript` | `N/A` |
+| `leetcode.useWsl` | 指定是否启用 WSL | `false` |
+| `leetcode.endpoint` | 指定使用的终端,可用终端有:`leetcode`, `leetcode-cn` | `leetcode` |
+| `leetcode.workspaceFolder` | 指定保存文件的工作区目录 | `""` |
+| `leetcode.filePath` | 指定生成题目文件的相对文件夹路径名和文件名。点击查看[更多详细用法](https://github.com/LeetCode-OpenSource/vscode-leetcode/wiki/%E8%87%AA%E5%AE%9A%E4%B9%89%E9%A2%98%E7%9B%AE%E6%96%87%E4%BB%B6%E7%9A%84%E7%9B%B8%E5%AF%B9%E6%96%87%E4%BB%B6%E5%A4%B9%E8%B7%AF%E5%BE%84%E5%92%8C%E6%96%87%E4%BB%B6%E5%90%8D)。 | |
+| `leetcode.enableStatusBar` | 指定是否在 VS Code 下方显示插件状态栏。 | `true` |
+| `leetcode.editor.shortcuts` | 指定在编辑器内所自定义的快捷方式。可用的快捷方式有: `submit`, `test`, `star`, `solution`, `description`。 | `["submit, test"]` |
+| `leetcode.enableSideMode` | 指定在解决一道题时,是否将`问题预览`、`高票答案`与`提交结果`窗口集中在编辑器的第二栏。 | `true` |
+| `leetcode.nodePath` | 指定 `Node.js` 可执行文件的路径。如:C:\Program Files\nodejs\node.exe | `node` |
+| `leetcode.showCommentDescription` | 指定是否要在注释中显示题干。 | `false` |
+| `leetcode.useEndpointTranslation` | 是否显示翻译版本内容。 | `true` |
+| `leetcode.allowReportData` | 为了更好的产品体验允许上报用户埋数据 | `true` |
## 需要帮助?
+
在遇到任何问题时,可以先查看一下[疑难解答](https://github.com/LeetCode-OpenSource/vscode-leetcode/wiki/%E7%96%91%E9%9A%BE%E8%A7%A3%E7%AD%94)以及[常见问题](https://github.com/LeetCode-OpenSource/vscode-leetcode/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98)寻求帮助。
如果您的问题依然没有解决,可以在 [Gitter Channel](https://gitter.im/vscode-leetcode/Lobby) 联系我们,或者您也可以[记录一个新的 issue](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/new/choose)。
diff --git a/package-lock.json b/package-lock.json
index 51c317cb..2ac17cf5 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,6 +9,7 @@
"version": "0.18.1",
"license": "MIT",
"dependencies": {
+ "axios": "^1.6.8",
"fs-extra": "^10.0.0",
"highlight.js": "^10.7.2",
"lodash": "^4.17.21",
@@ -220,6 +221,29 @@
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz",
"integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA=="
},
+ "node_modules/axios": {
+ "version": "1.6.8",
+ "resolved": "https://r.cnpmjs.org/axios/-/axios-1.6.8.tgz",
+ "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==",
+ "dependencies": {
+ "follow-redirects": "^1.15.6",
+ "form-data": "^4.0.0",
+ "proxy-from-env": "^1.1.0"
+ }
+ },
+ "node_modules/axios/node_modules/form-data": {
+ "version": "4.0.0",
+ "resolved": "https://r2.cnpmjs.org/form-data/-/form-data-4.0.0.tgz",
+ "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
+ "dependencies": {
+ "asynckit": "^0.4.0",
+ "combined-stream": "^1.0.8",
+ "mime-types": "^2.1.12"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
@@ -642,6 +666,19 @@
"node": ">=8"
}
},
+ "node_modules/follow-redirects": {
+ "version": "1.15.6",
+ "resolved": "https://r.cnpmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
+ "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==",
+ "engines": {
+ "node": ">=4.0"
+ },
+ "peerDependenciesMeta": {
+ "debug": {
+ "optional": true
+ }
+ }
+ },
"node_modules/forever-agent": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
@@ -816,9 +853,9 @@
}
},
"node_modules/i": {
- "version": "0.3.6",
- "resolved": "https://registry.npmjs.org/i/-/i-0.3.6.tgz",
- "integrity": "sha1-2WyScyB28HJxG2sQ/X1PZa2O4j0=",
+ "version": "0.3.7",
+ "resolved": "https://registry.npmjs.org/i/-/i-0.3.7.tgz",
+ "integrity": "sha512-FYz4wlXgkQwIPqhzC5TdNMLSE5+GS1IIDJZY/1ZiEPCT2S3COUVZeT5OW4BmW4r5LHLQuOosSwsvnroG9GR59Q==",
"engines": {
"node": ">=0.4"
}
@@ -1074,9 +1111,9 @@
}
},
"node_modules/minimist": {
- "version": "1.2.5",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
- "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
+ "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q=="
},
"node_modules/mkdirp": {
"version": "1.0.4",
@@ -1090,9 +1127,9 @@
}
},
"node_modules/moment": {
- "version": "2.29.1",
- "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
- "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==",
+ "version": "2.29.3",
+ "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.3.tgz",
+ "integrity": "sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw==",
"engines": {
"node": "*"
}
@@ -1224,9 +1261,9 @@
}
},
"node_modules/ora/node_modules/ansi-regex": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
- "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz",
+ "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==",
"engines": {
"node": ">=4"
}
@@ -1341,6 +1378,11 @@
"node": ">= 0.6.6"
}
},
+ "node_modules/proxy-from-env": {
+ "version": "1.1.0",
+ "resolved": "https://r2.cnpmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
+ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
+ },
"node_modules/psl": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz",
@@ -2294,6 +2336,28 @@
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz",
"integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA=="
},
+ "axios": {
+ "version": "1.6.8",
+ "resolved": "https://r.cnpmjs.org/axios/-/axios-1.6.8.tgz",
+ "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==",
+ "requires": {
+ "follow-redirects": "^1.15.6",
+ "form-data": "^4.0.0",
+ "proxy-from-env": "^1.1.0"
+ },
+ "dependencies": {
+ "form-data": {
+ "version": "4.0.0",
+ "resolved": "https://r2.cnpmjs.org/form-data/-/form-data-4.0.0.tgz",
+ "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
+ "requires": {
+ "asynckit": "^0.4.0",
+ "combined-stream": "^1.0.8",
+ "mime-types": "^2.1.12"
+ }
+ }
+ }
+ },
"balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
@@ -2635,6 +2699,11 @@
"path-exists": "^4.0.0"
}
},
+ "follow-redirects": {
+ "version": "1.15.6",
+ "resolved": "https://r.cnpmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
+ "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA=="
+ },
"forever-agent": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
@@ -2770,9 +2839,9 @@
}
},
"i": {
- "version": "0.3.6",
- "resolved": "https://registry.npmjs.org/i/-/i-0.3.6.tgz",
- "integrity": "sha1-2WyScyB28HJxG2sQ/X1PZa2O4j0="
+ "version": "0.3.7",
+ "resolved": "https://registry.npmjs.org/i/-/i-0.3.7.tgz",
+ "integrity": "sha512-FYz4wlXgkQwIPqhzC5TdNMLSE5+GS1IIDJZY/1ZiEPCT2S3COUVZeT5OW4BmW4r5LHLQuOosSwsvnroG9GR59Q=="
},
"inflight": {
"version": "1.0.6",
@@ -2984,9 +3053,9 @@
}
},
"minimist": {
- "version": "1.2.5",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
- "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
+ "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q=="
},
"mkdirp": {
"version": "1.0.4",
@@ -2994,9 +3063,9 @@
"integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw=="
},
"moment": {
- "version": "2.29.1",
- "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
- "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ=="
+ "version": "2.29.3",
+ "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.3.tgz",
+ "integrity": "sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw=="
},
"mute-stream": {
"version": "0.0.8",
@@ -3103,9 +3172,9 @@
},
"dependencies": {
"ansi-regex": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
- "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg="
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz",
+ "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw=="
},
"strip-ansi": {
"version": "4.0.0",
@@ -3189,6 +3258,11 @@
"winston": "2.1.x"
}
},
+ "proxy-from-env": {
+ "version": "1.1.0",
+ "resolved": "https://r2.cnpmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
+ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
+ },
"psl": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz",
diff --git a/package.json b/package.json
index db0d475a..53552b74 100644
--- a/package.json
+++ b/package.json
@@ -2,8 +2,8 @@
"name": "vscode-leetcode",
"displayName": "LeetCode",
"description": "Solve LeetCode problems in VS Code",
- "version": "0.18.1",
- "author": "Sheng Chen",
+ "version": "0.18.4",
+ "author": "LeetCode",
"publisher": "LeetCode",
"license": "MIT",
"icon": "resources/LeetCode.png",
@@ -182,15 +182,20 @@
"when": "view == leetCodeExplorer",
"group": "navigation@3"
},
+ {
+ "command": "leetcode.signout",
+ "when": "view == leetCodeExplorer",
+ "group": "overflow@1"
+ },
{
"command": "leetcode.pickOne",
"when": "view == leetCodeExplorer",
- "group": "overflow@0"
+ "group": "overflow@2"
},
{
"command": "leetcode.problems.sort",
"when": "view == leetCodeExplorer",
- "group": "overflow@1"
+ "group": "overflow@3"
}
],
"view/item/context": [
@@ -294,12 +299,6 @@
"scope": "application",
"description": "Hide solved problems."
},
- "leetcode.showLocked": {
- "type": "boolean",
- "default": false,
- "scope": "application",
- "description": "Show locked problems."
- },
"leetcode.defaultLanguage": {
"type": "string",
"enum": [
@@ -700,6 +699,12 @@
"Acceptance Rate (Descending)"
],
"description": "Sorting strategy for problems list."
+ },
+ "leetcode.allowReportData": {
+ "type": "boolean",
+ "default": true,
+ "scope": "application",
+ "description": "Allow LeetCode to report anonymous usage data to improve the product."
}
}
}
@@ -709,7 +714,9 @@
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
- "lint": "tslint --project tsconfig.json -e src/*.d.ts -t verbose"
+ "lint": "tslint --project tsconfig.json -e src/*.d.ts -t verbose",
+ "build": "vsce package",
+ "vs-publish": "vsce publish"
},
"devDependencies": {
"@types/fs-extra": "^9.0.11",
@@ -723,6 +730,7 @@
"typescript": "^4.3.2"
},
"dependencies": {
+ "axios": "^1.6.8",
"fs-extra": "^10.0.0",
"highlight.js": "^10.7.2",
"lodash": "^4.17.21",
diff --git a/src/commands/list.ts b/src/commands/list.ts
index 7e7b36a7..3ebe236a 100644
--- a/src/commands/list.ts
+++ b/src/commands/list.ts
@@ -1,7 +1,6 @@
// Copyright (c) jdneo. All rights reserved.
// Licensed under the MIT license.
-import * as vscode from "vscode";
import { leetCodeExecutor } from "../leetCodeExecutor";
import { leetCodeManager } from "../leetCodeManager";
import { IProblem, ProblemState, UserStatus } from "../shared";
@@ -13,10 +12,9 @@ export async function listProblems(): Promise {
if (leetCodeManager.getStatus() === UserStatus.SignedOut) {
return [];
}
- const leetCodeConfig: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("leetcode");
- const showLocked: boolean = !!leetCodeConfig.get("showLocked");
+
const useEndpointTranslation: boolean = settingUtils.shouldUseEndpointTranslation();
- const result: string = await leetCodeExecutor.listProblems(showLocked, useEndpointTranslation);
+ const result: string = await leetCodeExecutor.listProblems(true, useEndpointTranslation);
const problems: IProblem[] = [];
const lines: string[] = result.split("\n");
const reg: RegExp = /^(.)\s(.{1,2})\s(.)\s\[\s*(\d*)\s*\]\s*(.*)\s*(Easy|Medium|Hard)\s*\((\s*\d+\.\d+ %)\)/;
diff --git a/src/commands/show.ts b/src/commands/show.ts
index 3aebce8f..eccf5571 100644
--- a/src/commands/show.ts
+++ b/src/commands/show.ts
@@ -10,19 +10,30 @@ import { LeetCodeNode } from "../explorer/LeetCodeNode";
import { leetCodeChannel } from "../leetCodeChannel";
import { leetCodeExecutor } from "../leetCodeExecutor";
import { leetCodeManager } from "../leetCodeManager";
-import { IProblem, IQuickItemEx, languages, ProblemState } from "../shared";
+import { Endpoint, IProblem, IQuickItemEx, languages, PREMIUM_URL_CN, PREMIUM_URL_GLOBAL, ProblemState } from "../shared";
import { genFileExt, genFileName, getNodeIdFromFile } from "../utils/problemUtils";
import * as settingUtils from "../utils/settingUtils";
import { IDescriptionConfiguration } from "../utils/settingUtils";
-import { DialogOptions, DialogType, openSettingsEditor, promptForOpenOutputChannel, promptForSignIn, promptHintMessage } from "../utils/uiUtils";
+import {
+ DialogOptions,
+ DialogType,
+ openSettingsEditor,
+ openUrl,
+ promptForOpenOutputChannel,
+ promptForSignIn,
+ promptHintMessage,
+} from "../utils/uiUtils";
import { getActiveFilePath, selectWorkspaceFolder } from "../utils/workspaceUtils";
import * as wsl from "../utils/wslUtils";
import { leetCodePreviewProvider } from "../webview/leetCodePreviewProvider";
import { leetCodeSolutionProvider } from "../webview/leetCodeSolutionProvider";
import * as list from "./list";
+import { getLeetCodeEndpoint } from "./plugin";
+import { globalState } from "../globalState";
export async function previewProblem(input: IProblem | vscode.Uri, isSideMode: boolean = false): Promise {
let node: IProblem;
+
if (input instanceof vscode.Uri) {
const activeFilePath: string = input.fsPath;
const id: string = await getNodeIdFromFile(activeFilePath);
@@ -40,7 +51,14 @@ export async function previewProblem(input: IProblem | vscode.Uri, isSideMode: b
isSideMode = true;
} else {
node = input;
+ const { isPremium } = globalState.getUserStatus() ?? {};
+ if (input.locked && !isPremium) {
+ const url = getLeetCodeEndpoint() === Endpoint.LeetCode ? PREMIUM_URL_GLOBAL : PREMIUM_URL_CN;
+ openUrl(url);
+ return;
+ }
}
+
const needTranslation: boolean = settingUtils.shouldUseEndpointTranslation();
const descString: string = await leetCodeExecutor.getDescription(node.id, needTranslation);
leetCodePreviewProvider.show(descString, node, isSideMode);
@@ -64,13 +82,10 @@ export async function searchProblem(): Promise {
promptForSignIn();
return;
}
- const choice: IQuickItemEx | undefined = await vscode.window.showQuickPick(
- parseProblemsToPicks(list.listProblems()),
- {
- matchOnDetail: true,
- placeHolder: "Select one problem",
- },
- );
+ const choice: IQuickItemEx | undefined = await vscode.window.showQuickPick(parseProblemsToPicks(list.listProblems()), {
+ matchOnDetail: true,
+ placeHolder: "Select one problem",
+ });
if (!choice) {
return;
}
@@ -79,11 +94,14 @@ export async function searchProblem(): Promise {
export async function showSolution(input: LeetCodeNode | vscode.Uri): Promise {
let problemInput: string | undefined;
- if (input instanceof LeetCodeNode) { // Triggerred from explorer
+ if (input instanceof LeetCodeNode) {
+ // Triggerred from explorer
problemInput = input.id;
- } else if (input instanceof vscode.Uri) { // Triggerred from Code Lens/context menu
+ } else if (input instanceof vscode.Uri) {
+ // Triggerred from Code Lens/context menu
problemInput = `"${input.fsPath}"`;
- } else if (!input) { // Triggerred from command
+ } else if (!input) {
+ // Triggerred from command
problemInput = await getActiveFilePath();
}
@@ -112,7 +130,12 @@ async function fetchProblemLanguage(): Promise {
if (defaultLanguage && languages.indexOf(defaultLanguage) < 0) {
defaultLanguage = undefined;
}
- const language: string | undefined = defaultLanguage || await vscode.window.showQuickPick(languages, { placeHolder: "Select the language you want to use", ignoreFocusOut: true });
+ const language: string | undefined =
+ defaultLanguage ||
+ (await vscode.window.showQuickPick(languages, {
+ placeHolder: "Select the language you want to use",
+ ignoreFocusOut: true,
+ }));
// fire-and-forget default language query
(async (): Promise => {
if (language && !defaultLanguage && leetCodeConfig.get("hint.setDefaultLanguage")) {
@@ -120,7 +143,7 @@ async function fetchProblemLanguage(): Promise {
`Would you like to set '${language}' as your default language?`,
DialogOptions.yes,
DialogOptions.no,
- DialogOptions.never,
+ DialogOptions.never
);
if (choice === DialogOptions.yes) {
leetCodeConfig.update("defaultLanguage", language, true /* UserSetting */);
@@ -149,10 +172,7 @@ async function showProblemInternal(node: IProblem): Promise {
.get(`filePath.${language}.folder`, leetCodeConfig.get(`filePath.default.folder`, ""))
.trim();
const fileName: string = leetCodeConfig
- .get(
- `filePath.${language}.filename`,
- leetCodeConfig.get(`filePath.default.filename`) || genFileName(node, language),
- )
+ .get(`filePath.${language}.filename`, leetCodeConfig.get(`filePath.default.filename`) || genFileName(node, language))
.trim();
let finalPath: string = path.join(workspaceFolder, fileFolder, fileName);
@@ -172,12 +192,15 @@ async function showProblemInternal(node: IProblem): Promise {
await leetCodeExecutor.showProblem(node, language, finalPath, descriptionConfig.showInComment, needTranslation);
const promises: any[] = [
- vscode.window.showTextDocument(vscode.Uri.file(finalPath), { preview: false, viewColumn: vscode.ViewColumn.One }),
+ vscode.window.showTextDocument(vscode.Uri.file(finalPath), {
+ preview: false,
+ viewColumn: vscode.ViewColumn.One,
+ }),
promptHintMessage(
"hint.commentDescription",
'You can config how to show the problem description through "leetcode.showDescription".',
"Open settings",
- (): Promise => openSettingsEditor("leetcode.showDescription"),
+ (): Promise => openSettingsEditor("leetcode.showDescription")
),
];
if (descriptionConfig.showInWebview) {
@@ -195,12 +218,17 @@ async function showDescriptionView(node: IProblem): Promise {
}
async function parseProblemsToPicks(p: Promise): Promise>> {
return new Promise(async (resolve: (res: Array>) => void): Promise => {
- const picks: Array> = (await p).map((problem: IProblem) => Object.assign({}, {
- label: `${parseProblemDecorator(problem.state, problem.locked)}${problem.id}.${problem.name}`,
- description: "",
- detail: `AC rate: ${problem.passRate}, Difficulty: ${problem.difficulty}`,
- value: problem,
- }));
+ const picks: Array> = (await p).map((problem: IProblem) =>
+ Object.assign(
+ {},
+ {
+ label: `${parseProblemDecorator(problem.state, problem.locked)}${problem.id}.${problem.name}`,
+ description: "",
+ detail: `AC rate: ${problem.passRate}, Difficulty: ${problem.difficulty}`,
+ value: problem,
+ }
+ )
+ );
resolve(picks);
});
}
@@ -266,14 +294,11 @@ async function resolveTagForProblem(problem: IProblem): Promise {
diff --git a/src/explorer/LeetCodeTreeDataProvider.ts b/src/explorer/LeetCodeTreeDataProvider.ts
index 4764934a..9c298944 100644
--- a/src/explorer/LeetCodeTreeDataProvider.ts
+++ b/src/explorer/LeetCodeTreeDataProvider.ts
@@ -8,12 +8,14 @@ import { leetCodeManager } from "../leetCodeManager";
import { Category, defaultProblem, ProblemState } from "../shared";
import { explorerNodeManager } from "./explorerNodeManager";
import { LeetCodeNode } from "./LeetCodeNode";
+import { globalState } from "../globalState";
export class LeetCodeTreeDataProvider implements vscode.TreeDataProvider {
-
private context: vscode.ExtensionContext;
- private onDidChangeTreeDataEvent: vscode.EventEmitter = new vscode.EventEmitter();
+ private onDidChangeTreeDataEvent: vscode.EventEmitter = new vscode.EventEmitter<
+ LeetCodeNode | undefined | null
+ >();
// tslint:disable-next-line:member-ordering
public readonly onDidChangeTreeData: vscode.Event = this.onDidChangeTreeDataEvent.event;
@@ -46,7 +48,7 @@ export class LeetCodeTreeDataProvider implements vscode.TreeDataProvider {
if (!leetCodeManager.getUser()) {
return [
- new LeetCodeNode(Object.assign({}, defaultProblem, {
- id: "notSignIn",
- name: "Sign in to LeetCode",
- }), false),
+ new LeetCodeNode(
+ Object.assign({}, defaultProblem, {
+ id: "notSignIn",
+ name: "Sign in to LeetCode",
+ }),
+ false
+ ),
];
}
- if (!element) { // Root view
+ if (!element) {
+ // Root view
return explorerNodeManager.getRootNodes();
} else {
- switch (element.id) { // First-level
+ switch (element.id) {
case Category.All:
return explorerNodeManager.getAllNodes();
case Category.Favorite:
@@ -92,13 +98,14 @@ export class LeetCodeTreeDataProvider implements vscode.TreeDataProvider {
try {
- if (!await leetCodeExecutor.meetRequirements(context)) {
+ if (!(await leetCodeExecutor.meetRequirements(context))) {
throw new Error("The environment doesn't meet requirements.");
}
@@ -37,6 +39,7 @@ export async function activate(context: vscode.ExtensionContext): Promise
});
leetCodeTreeDataProvider.initialize(context);
+ globalState.initialize(context);
context.subscriptions.push(
leetCodeStatusBarController,
@@ -55,22 +58,51 @@ export async function activate(context: vscode.ExtensionContext): Promise
vscode.commands.registerCommand("leetcode.signin", () => leetCodeManager.signIn()),
vscode.commands.registerCommand("leetcode.signout", () => leetCodeManager.signOut()),
vscode.commands.registerCommand("leetcode.manageSessions", () => session.manageSessions()),
- vscode.commands.registerCommand("leetcode.previewProblem", (node: LeetCodeNode) => show.previewProblem(node)),
+ vscode.commands.registerCommand("leetcode.previewProblem", (node: LeetCodeNode) => {
+ TrackData.report({
+ event_key: `vscode_open_problem`,
+ type: "click",
+ extra: JSON.stringify({
+ problem_id: node.id,
+ problem_name: node.name,
+ }),
+ });
+ show.previewProblem(node);
+ }),
vscode.commands.registerCommand("leetcode.showProblem", (node: LeetCodeNode) => show.showProblem(node)),
vscode.commands.registerCommand("leetcode.pickOne", () => show.pickOne()),
vscode.commands.registerCommand("leetcode.searchProblem", () => show.searchProblem()),
vscode.commands.registerCommand("leetcode.showSolution", (input: LeetCodeNode | vscode.Uri) => show.showSolution(input)),
vscode.commands.registerCommand("leetcode.refreshExplorer", () => leetCodeTreeDataProvider.refresh()),
- vscode.commands.registerCommand("leetcode.testSolution", (uri?: vscode.Uri) => test.testSolution(uri)),
- vscode.commands.registerCommand("leetcode.submitSolution", (uri?: vscode.Uri) => submit.submitSolution(uri)),
+ vscode.commands.registerCommand("leetcode.testSolution", (uri?: vscode.Uri) => {
+ TrackData.report({
+ event_key: `vscode_runCode`,
+ type: "click",
+ extra: JSON.stringify({
+ path: uri?.path,
+ }),
+ });
+ return test.testSolution(uri);
+ }),
+ vscode.commands.registerCommand("leetcode.submitSolution", (uri?: vscode.Uri) => {
+ TrackData.report({
+ event_key: `vscode_submit`,
+ type: "click",
+ extra: JSON.stringify({
+ path: uri?.path,
+ }),
+ });
+ return submit.submitSolution(uri);
+ }),
vscode.commands.registerCommand("leetcode.switchDefaultLanguage", () => switchDefaultLanguage()),
vscode.commands.registerCommand("leetcode.addFavorite", (node: LeetCodeNode) => star.addFavorite(node)),
vscode.commands.registerCommand("leetcode.removeFavorite", (node: LeetCodeNode) => star.removeFavorite(node)),
- vscode.commands.registerCommand("leetcode.problems.sort", () => plugin.switchSortingStrategy()),
+ vscode.commands.registerCommand("leetcode.problems.sort", () => plugin.switchSortingStrategy())
);
await leetCodeExecutor.switchEndpoint(plugin.getLeetCodeEndpoint());
await leetCodeManager.getLoginStatus();
+ vscode.window.registerUriHandler({ handleUri: leetCodeManager.handleUriSignIn });
} catch (error) {
leetCodeChannel.appendLine(error.toString());
promptForOpenOutputChannel("Extension initialization failed. Please open output channel for details.", DialogType.error);
diff --git a/src/globalState.ts b/src/globalState.ts
new file mode 100644
index 00000000..49d38421
--- /dev/null
+++ b/src/globalState.ts
@@ -0,0 +1,55 @@
+// Copyright (c) leo.zhao. All rights reserved.
+// Licensed under the MIT license.
+
+import * as vscode from "vscode";
+
+const CookieKey = "leetcode-cookie";
+const UserStatusKey = "leetcode-user-status";
+
+export type UserDataType = {
+ isSignedIn: boolean;
+ isPremium: boolean;
+ username: string;
+ avatar: string;
+ isVerified?: boolean;
+};
+
+class GlobalState {
+ private context: vscode.ExtensionContext;
+ private _state: vscode.Memento;
+ private _cookie: string;
+ private _userStatus: UserDataType;
+
+ public initialize(context: vscode.ExtensionContext): void {
+ this.context = context;
+ this._state = this.context.globalState;
+ }
+
+ public setCookie(cookie: string): any {
+ this._cookie = cookie;
+ return this._state.update(CookieKey, this._cookie);
+ }
+ public getCookie(): string | undefined {
+ return this._cookie ?? this._state.get(CookieKey);
+ }
+
+ public setUserStatus(userStatus: UserDataType): any {
+ this._userStatus = userStatus;
+ return this._state.update(UserStatusKey, this._userStatus);
+ }
+
+ public getUserStatus(): UserDataType | undefined {
+ return this._userStatus ?? this._state.get(UserStatusKey);
+ }
+
+ public removeCookie(): void {
+ this._state.update(CookieKey, undefined);
+ }
+
+ public removeAll(): void {
+ this._state.update(CookieKey, undefined);
+ this._state.update(UserStatusKey, undefined);
+ }
+}
+
+export const globalState: GlobalState = new GlobalState();
diff --git a/src/leetCodeManager.ts b/src/leetCodeManager.ts
index 089390d3..16ec3782 100644
--- a/src/leetCodeManager.ts
+++ b/src/leetCodeManager.ts
@@ -6,10 +6,14 @@ import { EventEmitter } from "events";
import * as vscode from "vscode";
import { leetCodeChannel } from "./leetCodeChannel";
import { leetCodeExecutor } from "./leetCodeExecutor";
-import { IQuickItemEx, loginArgsMapping, UserStatus } from "./shared";
+import { Endpoint, IQuickItemEx, loginArgsMapping, urls, urlsCn, UserStatus } from "./shared";
import { createEnvOption } from "./utils/cpUtils";
-import { DialogType, promptForOpenOutputChannel } from "./utils/uiUtils";
+import { DialogType, openUrl, promptForOpenOutputChannel } from "./utils/uiUtils";
import * as wsl from "./utils/wslUtils";
+import { getLeetCodeEndpoint } from "./commands/plugin";
+import { globalState } from "./globalState";
+import { queryUserData } from "./request/query-user-data";
+import { parseQuery } from "./utils/toolUtils";
class LeetCodeManager extends EventEmitter {
private currentUser: string | undefined;
@@ -21,6 +25,7 @@ class LeetCodeManager extends EventEmitter {
super();
this.currentUser = undefined;
this.userStatus = UserStatus.SignedOut;
+ this.handleUriSignIn = this.handleUriSignIn.bind(this);
}
public async getLoginStatus(): Promise {
@@ -31,118 +36,90 @@ class LeetCodeManager extends EventEmitter {
} catch (error) {
this.currentUser = undefined;
this.userStatus = UserStatus.SignedOut;
+ globalState.removeAll();
} finally {
this.emit("statusChanged");
}
}
+ private async updateUserStatusWithCookie(cookie: string): Promise {
+ globalState.setCookie(cookie);
+ const data = await queryUserData();
+ globalState.setUserStatus(data);
+ await this.setCookieToCli(cookie, data.username);
+ if (data.username) {
+ vscode.window.showInformationMessage(`Successfully ${data.username}.`);
+ this.currentUser = data.username;
+ this.userStatus = UserStatus.SignedIn;
+ this.emit("statusChanged");
+ }
+ }
+
+ public async handleUriSignIn(uri: vscode.Uri): Promise {
+ try {
+ await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification }, async (progress: vscode.Progress<{}>) => {
+ progress.report({ message: "Fetching user data..." });
+ const queryParams = parseQuery(uri.query);
+ const cookie = queryParams["cookie"];
+ if (!cookie) {
+ promptForOpenOutputChannel(`Failed to get cookie. Please log in again`, DialogType.error);
+ return;
+ }
+
+ await this.updateUserStatusWithCookie(cookie)
+
+ });
+ } catch (error) {
+ promptForOpenOutputChannel(`Failed to log in. Please open the output channel for details`, DialogType.error);
+ }
+ }
+
+ public async handleInputCookieSignIn(): Promise {
+ const cookie: string | undefined = await vscode.window.showInputBox({
+ prompt: 'Enter LeetCode Cookie',
+ password: true,
+ ignoreFocusOut: true,
+ validateInput: (s: string): string | undefined =>
+ s ? undefined : 'Cookie must not be empty',
+ })
+
+ await this.updateUserStatusWithCookie(cookie || '')
+ }
+
public async signIn(): Promise {
- const picks: Array> = [];
+ const picks: Array> = []
picks.push(
{
- label: "LeetCode Account",
- detail: "Use LeetCode account to login (US endpoint is not supported)",
- value: "LeetCode",
+ label: 'Web Authorization',
+ detail: 'Open browser to authorize login on the website',
+ value: 'WebAuth',
+ description: '[Recommended]'
},
{
- label: "Third-Party: GitHub",
- detail: "Use GitHub account to login",
- value: "GitHub",
- },
- {
- label: "Third-Party: LinkedIn",
- detail: "Use LinkedIn account to login",
- value: "LinkedIn",
- },
- {
- label: "LeetCode Cookie",
- detail: "Use LeetCode cookie copied from browser to login",
- value: "Cookie",
- },
- );
- const choice: IQuickItemEx | undefined = await vscode.window.showQuickPick(picks);
+ label: 'LeetCode Cookie',
+ detail: 'Use LeetCode cookie copied from browser to login',
+ value: 'Cookie',
+ }
+ )
+
+ const choice: IQuickItemEx | undefined = await vscode.window.showQuickPick(picks)
if (!choice) {
- return;
+ return
}
- const loginMethod: string = choice.value;
- const commandArg: string | undefined = loginArgsMapping.get(loginMethod);
- if (!commandArg) {
- throw new Error(`The login method "${loginMethod}" is not supported.`);
+ const loginMethod: string = choice.value
+
+ if (loginMethod === 'WebAuth') {
+ openUrl(this.getAuthLoginUrl())
+ return
}
- const isByCookie: boolean = loginMethod === "Cookie";
- const inMessage: string = isByCookie ? "sign in by cookie" : "sign in";
+
try {
- const userName: string | undefined = await new Promise(async (resolve: (res: string | undefined) => void, reject: (e: Error) => void): Promise => {
-
- const leetCodeBinaryPath: string = await leetCodeExecutor.getLeetCodeBinaryPath();
-
- const childProc: cp.ChildProcess = wsl.useWsl()
- ? cp.spawn("wsl", [leetCodeExecutor.node, leetCodeBinaryPath, "user", commandArg], { shell: true })
- : cp.spawn(leetCodeExecutor.node, [leetCodeBinaryPath, "user", commandArg], {
- shell: true,
- env: createEnvOption(),
- });
-
- childProc.stdout?.on("data", async (data: string | Buffer) => {
- data = data.toString();
- leetCodeChannel.append(data);
- if (data.includes("twoFactorCode")) {
- const twoFactor: string | undefined = await vscode.window.showInputBox({
- prompt: "Enter two-factor code.",
- ignoreFocusOut: true,
- validateInput: (s: string): string | undefined => s && s.trim() ? undefined : "The input must not be empty",
- });
- if (!twoFactor) {
- childProc.kill();
- return resolve(undefined);
- }
- childProc.stdin?.write(`${twoFactor}\n`);
- }
- const successMatch: RegExpMatchArray | null = data.match(this.successRegex);
- if (successMatch && successMatch[1]) {
- childProc.stdin?.end();
- return resolve(successMatch[1]);
- } else if (data.match(this.failRegex)) {
- childProc.stdin?.end();
- return reject(new Error("Faile to login"));
- }
- });
-
- childProc.stderr?.on("data", (data: string | Buffer) => leetCodeChannel.append(data.toString()));
-
- childProc.on("error", reject);
- const name: string | undefined = await vscode.window.showInputBox({
- prompt: "Enter username or E-mail.",
- ignoreFocusOut: true,
- validateInput: (s: string): string | undefined => s && s.trim() ? undefined : "The input must not be empty",
- });
- if (!name) {
- childProc.kill();
- return resolve(undefined);
- }
- childProc.stdin?.write(`${name}\n`);
- const pwd: string | undefined = await vscode.window.showInputBox({
- prompt: isByCookie ? "Enter cookie" : "Enter password.",
- password: true,
- ignoreFocusOut: true,
- validateInput: (s: string): string | undefined => s ? undefined : isByCookie ? "Cookie must not be empty" : "Password must not be empty",
- });
- if (!pwd) {
- childProc.kill();
- return resolve(undefined);
- }
- childProc.stdin?.write(`${pwd}\n`);
+ await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: "Fetching user data..." }, async () => {
+ await this.handleInputCookieSignIn()
});
- if (userName) {
- vscode.window.showInformationMessage(`Successfully ${inMessage}.`);
- this.currentUser = userName;
- this.userStatus = UserStatus.SignedIn;
- this.emit("statusChanged");
- }
} catch (error) {
- promptForOpenOutputChannel(`Failed to ${inMessage}. Please open the output channel for details`, DialogType.error);
+ promptForOpenOutputChannel(`Failed to log in. Please open the output channel for details`, DialogType.error);
}
-
}
public async signOut(): Promise {
@@ -151,6 +128,7 @@ class LeetCodeManager extends EventEmitter {
vscode.window.showInformationMessage("Successfully signed out.");
this.currentUser = undefined;
this.userStatus = UserStatus.SignedOut;
+ globalState.removeAll();
this.emit("statusChanged");
} catch (error) {
// swallow the error when sign out.
@@ -174,6 +152,52 @@ class LeetCodeManager extends EventEmitter {
return "Unknown";
}
+
+ public getAuthLoginUrl(): string {
+ switch (getLeetCodeEndpoint()) {
+ case Endpoint.LeetCodeCN:
+ return urlsCn.authLoginUrl;
+ case Endpoint.LeetCode:
+ default:
+ return urls.authLoginUrl;
+ }
+ }
+
+ public setCookieToCli(cookie: string, name: string): Promise {
+ return new Promise(async (resolve: (res: void) => void, reject: (e: Error) => void) => {
+ const leetCodeBinaryPath: string = await leetCodeExecutor.getLeetCodeBinaryPath();
+
+ const childProc: cp.ChildProcess = wsl.useWsl()
+ ? cp.spawn("wsl", [leetCodeExecutor.node, leetCodeBinaryPath, "user", loginArgsMapping.get("Cookie") ?? ""], {
+ shell: true,
+ })
+ : cp.spawn(leetCodeExecutor.node, [leetCodeBinaryPath, "user", loginArgsMapping.get("Cookie") ?? ""], {
+ shell: true,
+ env: createEnvOption(),
+ });
+
+ childProc.stdout?.on("data", async (data: string | Buffer) => {
+ data = data.toString();
+ leetCodeChannel.append(data);
+ const successMatch: RegExpMatchArray | null = data.match(this.successRegex);
+ if (successMatch && successMatch[1]) {
+ childProc.stdin?.end();
+ return resolve();
+ } else if (data.match(this.failRegex)) {
+ childProc.stdin?.end();
+ return reject(new Error("Faile to login"));
+ } else if (data.match(/login: /)) {
+ childProc.stdin?.write(`${name}\n`);
+ } else if (data.match(/cookie: /)) {
+ childProc.stdin?.write(`${cookie}\n`);
+ }
+ });
+
+ childProc.stderr?.on("data", (data: string | Buffer) => leetCodeChannel.append(data.toString()));
+
+ childProc.on("error", reject);
+ });
+ }
}
export const leetCodeManager: LeetCodeManager = new LeetCodeManager();
diff --git a/src/request/query-user-data.ts b/src/request/query-user-data.ts
new file mode 100644
index 00000000..ffcca1e1
--- /dev/null
+++ b/src/request/query-user-data.ts
@@ -0,0 +1,25 @@
+import { UserDataType } from "../globalState";
+import { getUrl } from "../shared";
+import { LcAxios } from "../utils/httpUtils";
+
+const graphqlStr = `
+ query globalData {
+ userStatus {
+ isPremium
+ isVerified
+ username
+ avatar
+ isSignedIn
+ }
+ }
+`;
+
+export const queryUserData = async (): Promise => {
+ return LcAxios(getUrl("userGraphql"), {
+ method: "POST",
+ data: {
+ query: graphqlStr,
+ variables: {},
+ },
+ }).then((res) => res.data.data.userStatus);
+};
diff --git a/src/shared.ts b/src/shared.ts
index 84b529cc..e8b59d89 100644
--- a/src/shared.ts
+++ b/src/shared.ts
@@ -63,6 +63,7 @@ export enum ProblemState {
AC = 1,
NotAC = 2,
Unknown = 3,
+ Locked = 4,
}
export enum Endpoint {
@@ -102,11 +103,7 @@ export enum Category {
Favorite = "Favorite",
}
-export const supportedPlugins: string[] = [
- "company",
- "solution.discuss",
- "leetcode.cn",
-];
+export const supportedPlugins: string[] = ["company", "solution.discuss", "leetcode.cn"];
export enum DescriptionConfiguration {
InWebView = "In Webview",
@@ -124,3 +121,38 @@ export enum SortingStrategy {
FrequencyAsc = "Frequency (Ascending)",
FrequencyDesc = "Frequency (Descending)",
}
+
+export const PREMIUM_URL_CN = "https://leetcode.cn/premium-payment/?source=vscode";
+export const PREMIUM_URL_GLOBAL = "https://leetcode.com/subscribe/?ref=lp_pl&source=vscode";
+
+const protocol = vscode.env.appName.includes('Insiders') ? "vscode-insiders" : "vscode"
+
+export const urls = {
+ // base urls
+ base: "https://leetcode.com",
+ graphql: "https://leetcode.com/graphql",
+ userGraphql: "https://leetcode.com/graphql",
+ login: "https://leetcode.com/accounts/login/",
+ authLoginUrl: `https://leetcode.com/authorize-login/${protocol}/?path=leetcode.vscode-leetcode`,
+};
+
+export const urlsCn = {
+ // base urls
+ base: "https://leetcode.cn",
+ graphql: "https://leetcode.cn/graphql",
+ userGraphql: "https://leetcode.cn/graphql/",
+ login: "https://leetcode.cn/accounts/login/",
+ authLoginUrl: `https://leetcode.cn/authorize-login/${protocol}/?path=leetcode.vscode-leetcode`,
+};
+
+export const getUrl = (key: string) => {
+ const leetCodeConfig: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("leetcode");
+ const point = leetCodeConfig.get("endpoint", Endpoint.LeetCode);
+ switch (point) {
+ case Endpoint.LeetCodeCN:
+ return urlsCn[key];
+ case Endpoint.LeetCode:
+ default:
+ return urls[key];
+ }
+};
diff --git a/src/utils/httpUtils.ts b/src/utils/httpUtils.ts
new file mode 100644
index 00000000..b7771734
--- /dev/null
+++ b/src/utils/httpUtils.ts
@@ -0,0 +1,28 @@
+import axios, { AxiosRequestConfig, AxiosPromise } from "axios";
+import { omit } from "lodash";
+import { globalState } from "../globalState";
+import { DialogType, promptForOpenOutputChannel } from "./uiUtils";
+
+const referer = "vscode-lc-extension";
+
+export function LcAxios(path: string, settings?: AxiosRequestConfig): AxiosPromise {
+ const cookie = globalState.getCookie();
+ if (!cookie) {
+ promptForOpenOutputChannel(
+ `Failed to obtain the cookie. Please log in again.`,
+ DialogType.error
+ );
+ return Promise.reject("Failed to obtain the cookie.");
+ }
+ return axios(path, {
+ headers: {
+ referer,
+ "content-type": "application/json",
+ cookie,
+ ...(settings && settings.headers),
+ },
+ xsrfCookieName: "csrftoken",
+ xsrfHeaderName: "X-CSRFToken",
+ ...(settings && omit(settings, "headers")),
+ });
+}
diff --git a/src/utils/toolUtils.ts b/src/utils/toolUtils.ts
new file mode 100644
index 00000000..ce37e185
--- /dev/null
+++ b/src/utils/toolUtils.ts
@@ -0,0 +1,26 @@
+export function sleep(ms) {
+ return new Promise((resolve) => setTimeout(resolve, ms));
+}
+
+export function parseQuery(query: string): { [key: string]: string } {
+ const queryObject: { [key: string]: string } = {};
+
+ if (!query) {
+ return queryObject;
+ }
+
+ const keyValuePairs = query.split("&");
+ keyValuePairs.forEach((pair) => {
+ const firstEqualsIndex = pair.indexOf("=");
+ if (firstEqualsIndex !== -1) {
+ const key = pair.substring(0, firstEqualsIndex);
+ const value = pair.substring(firstEqualsIndex + 1);
+ queryObject[decodeURIComponent(key)] = decodeURIComponent(value);
+ } else {
+ // If no equals sign is found, treat the whole string as key with empty value
+ queryObject[decodeURIComponent(pair)] = "";
+ }
+ });
+
+ return queryObject;
+}
diff --git a/src/utils/trackingUtils.ts b/src/utils/trackingUtils.ts
new file mode 100644
index 00000000..56b1a6fb
--- /dev/null
+++ b/src/utils/trackingUtils.ts
@@ -0,0 +1,130 @@
+import * as vscode from "vscode";
+import axios from "axios";
+import { getLeetCodeEndpoint } from "../commands/plugin";
+import { Endpoint } from "../shared";
+import { leetCodeManager } from "../leetCodeManager";
+
+const getTimeZone = (): string => {
+ const endPoint: string = getLeetCodeEndpoint();
+ if (endPoint === Endpoint.LeetCodeCN) {
+ return "Asia/Shanghai";
+ } else {
+ return "UTC";
+ }
+};
+
+interface IReportData {
+ event_key: string;
+ type?: "click" | "expose" | string;
+ anonymous_id?: string;
+ tid?: number;
+ ename?: string; // event name
+ href?: string;
+ referer?: string;
+ extra?: string;
+ target?: string;
+}
+
+interface ITrackData {
+ reportCache: IReportData[];
+ isSubmit: boolean;
+ report: (reportItems: IReportData | IReportData[]) => void;
+ submitReport: (useSendBeason: boolean) => Promise;
+ reportUrl: string;
+}
+
+const testReportUrl = "https://analysis.lingkou.xyz/i/event";
+const prodReportUrl = "https://analysis.leetcode.cn/i/event";
+
+function getReportUrl() {
+ if (process.env.NODE_ENV === "production") {
+ return prodReportUrl;
+ } else {
+ return testReportUrl;
+ }
+}
+
+const _charStr = "abacdefghjklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+=";
+
+function RandomIndex(min: number, max: number, i: number) {
+ let index = Math.floor(Math.random() * (max - min + 1) + min);
+ const numStart = _charStr.length - 10;
+ if (i === 0 && index >= numStart) {
+ index = RandomIndex(min, max, i);
+ }
+ return index;
+}
+
+function getRandomString(len: number) {
+ const min = 0;
+ const max = _charStr.length - 1;
+ let _str = "";
+ len = len || 15;
+ for (let i = 0, index; i < len; i++) {
+ index = RandomIndex(min, max, i);
+ _str += _charStr[index];
+ }
+ return _str;
+}
+
+function getAllowReportDataConfig() {
+ const leetCodeConfig = vscode.workspace.getConfiguration("leetcode");
+ const allowReportData = !!leetCodeConfig.get("allowReportData");
+ return allowReportData;
+}
+
+class TrackData implements ITrackData {
+ public reportCache: IReportData[] = [];
+
+ public isSubmit: boolean = false;
+
+ public reportUrl: string = getReportUrl();
+
+ private sendTimer: NodeJS.Timeout | undefined;
+
+ public report = (reportItems: IReportData | IReportData[]) => {
+ if (!getAllowReportDataConfig()) return;
+
+ this.sendTimer && clearTimeout(this.sendTimer);
+
+ if (!Array.isArray(reportItems)) {
+ reportItems = [reportItems];
+ }
+ const randomId = getRandomString(60);
+ reportItems.forEach((item) => {
+ this.reportCache.push({
+ ...item,
+ referer: "vscode",
+ target: leetCodeManager.getUser() ?? "",
+ anonymous_id: item.anonymous_id ?? (randomId as string),
+ });
+ });
+ this.sendTimer = setTimeout(this.submitReport, 800);
+ };
+
+ public submitReport = async () => {
+ if (!getAllowReportDataConfig()) return;
+ const dataList = JSON.stringify(this.reportCache);
+
+ if (!this.reportCache.length || this.isSubmit) {
+ return;
+ }
+ this.reportCache = [];
+ try {
+ this.isSubmit = true;
+ axios.defaults.withCredentials = true;
+ await axios.post(this.reportUrl, `dataList=${encodeURIComponent(dataList)}`, {
+ headers: {
+ "Content-Type": "application/x-www-form-urlencoded",
+ "x-timezone": getTimeZone(),
+ },
+ });
+ } catch (e) {
+ this.reportCache = this.reportCache.concat(JSON.parse(dataList));
+ } finally {
+ this.isSubmit = false;
+ }
+ };
+}
+
+export default new TrackData();
diff --git a/src/webview/leetCodePreviewProvider.ts b/src/webview/leetCodePreviewProvider.ts
index 78b40991..86060de5 100644
--- a/src/webview/leetCodePreviewProvider.ts
+++ b/src/webview/leetCodePreviewProvider.ts
@@ -8,7 +8,6 @@ import { ILeetCodeWebviewOption, LeetCodeWebview } from "./LeetCodeWebview";
import { markdownEngine } from "./markdownEngine";
class LeetCodePreviewProvider extends LeetCodeWebview {
-
protected readonly viewType: string = "leetcode.preview";
private node: IProblem;
private description: IDescription;
@@ -23,11 +22,6 @@ class LeetCodePreviewProvider extends LeetCodeWebview {
this.node = node;
this.sideMode = isSideMode;
this.showWebviewInternal();
- // Comment out this operation since it sometimes may cause the webview become empty.
- // Waiting for the progress of the VS Code side issue: https://github.com/microsoft/vscode/issues/3742
- // if (this.sideMode) {
- // this.hideSideBar(); // For better view area
- // }
}
protected getWebviewOption(): ILeetCodeWebviewOption {
@@ -46,7 +40,7 @@ class LeetCodePreviewProvider extends LeetCodeWebview {
}
protected getWebviewContent(): string {
- const button: { element: string, script: string, style: string } = {
+ const button: { element: string; script: string; style: string } = {
element: `Code Now `,
script: `const button = document.getElementById('solve');
button.onclick = () => vscode.postMessage({
@@ -73,32 +67,26 @@ class LeetCodePreviewProvider extends LeetCodeWebview {
};
const { title, url, category, difficulty, likes, dislikes, body } = this.description;
const head: string = markdownEngine.render(`# [${title}](${url})`);
- const info: string = markdownEngine.render([
- `| Category | Difficulty | Likes | Dislikes |`,
- `| :------: | :--------: | :---: | :------: |`,
- `| ${category} | ${difficulty} | ${likes} | ${dislikes} |`,
- ].join("\n"));
+ const info: string = markdownEngine.render(
+ [
+ `| Category | Difficulty | Likes | Dislikes |`,
+ `| :------: | :--------: | :---: | :------: |`,
+ `| ${category} | ${difficulty} | ${likes} | ${dislikes} |`,
+ ].join("\n")
+ );
const tags: string = [
``,
`Tags `,
- markdownEngine.render(
- this.description.tags
- .map((t: string) => `[\`${t}\`](https://leetcode.com/tag/${t})`)
- .join(" | "),
- ),
+ markdownEngine.render(this.description.tags.map((t: string) => `[\`${t}\`](${this.getTagLink(t)})`).join(" | ")),
` `,
].join("\n");
const companies: string = [
``,
`Companies `,
- markdownEngine.render(
- this.description.companies
- .map((c: string) => `\`${c}\``)
- .join(" | "),
- ),
+ markdownEngine.render(this.description.companies.map((c: string) => `\`${c}\``).join(" | ")),
` `,
].join("\n");
- const links: string = markdownEngine.render(`[Discussion](${this.getDiscussionLink(url)}) | [Solution](${this.getSolutionLink(url)})`);
+ const links: string = markdownEngine.render(`[Submissions](${this.getSubmissionsLink(url)}) | [Solution](${this.getSolutionsLink(url)})`);
return `
@@ -149,18 +137,23 @@ class LeetCodePreviewProvider extends LeetCodeWebview {
private parseDescription(descString: string, problem: IProblem): IDescription {
const [
- /* title */, ,
- url, ,
- /* tags */, ,
- /* langs */, ,
- category,
+ ,
+ ,
+ /* title */ url,
+ ,
+ ,
+ ,
+ ,
+ ,
+ /* tags */ /* langs */ category,
difficulty,
likes,
dislikes,
- /* accepted */,
- /* submissions */,
- /* testcase */, ,
- ...body
+ ,
+ ,
+ ,
+ ,
+ /* accepted */ /* submissions */ /* testcase */ ...body
] = descString.split("\n");
return {
title: problem.name,
@@ -175,19 +168,22 @@ class LeetCodePreviewProvider extends LeetCodeWebview {
};
}
- private getDiscussionLink(url: string): string {
+ private getTagLink(tag: string): string {
const endPoint: string = getLeetCodeEndpoint();
if (endPoint === Endpoint.LeetCodeCN) {
- return url.replace("/description/", "/comments/");
+ return `https://leetcode.cn/tag/${tag}?source=vscode`;
} else if (endPoint === Endpoint.LeetCode) {
- return url.replace("/description/", "/discuss/?currentPage=1&orderBy=most_votes&query=");
+ return `https://leetcode.com/tag/${tag}?source=vscode`;
}
- return "https://leetcode.com";
+ return "https://leetcode.com?source=vscode";
}
- private getSolutionLink(url: string): string {
- return url.replace("/description/", "/solution/");
+ private getSolutionsLink(url: string): string {
+ return url.replace("/description/", "/solutions/") + "?source=vscode";
+ }
+ private getSubmissionsLink(url: string): string {
+ return url.replace("/description/", "/submissions/") + "?source=vscode";
}
}
diff --git a/tslint.json b/tslint.json
index 34776be7..a686a2c7 100644
--- a/tslint.json
+++ b/tslint.json
@@ -1,36 +1,28 @@
{
"defaultSeverity": "error",
- "extends": [
- "tslint:recommended"
- ],
+ "extends": ["tslint:recommended"],
"jsRules": {},
"rules": {
- "forin": false,
"object-literal-sort-keys": false,
- "indent": [
- true,
- "spaces"
- ],
+ "ordered-imports": [false],
+ "indent": [true, "spaces"],
"no-string-literal": false,
"no-namespace": false,
- "max-line-length": [
- false,
- 120
- ],
- "typedef": [
- true,
- "call-signature",
- "arrow-call-signature",
- "parameter",
- "arrow-parameter",
- "property-declaration",
- "variable-declaration",
- "member-variable-declaration"
- ],
- "variable-name": [
- true,
- "allow-leading-underscore"
- ]
+ "max-line-length": [false, 120],
+ "typedef": false,
+ "no-implicit-dependencies": [true, ["vscode"]],
+ "trailing-comma": false,
+ "no-any": false,
+ "object-literal-key-quotes": [true, "consistent-as-needed"],
+ "prefer-object-spread": false,
+ "no-unnecessary-await": false,
+ "semicolon": [false],
+ "quotemark": [false],
+ "member-ordering": [false],
+ "variable-name": [false],
+ "curly": false,
+ "interface-over-type-literal": [false],
+ "no-unused-expression": false
},
"rulesDirectory": []
}
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy