-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
之前的方式添加看了头皮发麻,大家添加的都很随意,也没有按照字母进行排序。 1. 使用 eslint 规则解决排序问题 2. 添加 CLI 方便用户直接命令行添加(开发者不需要处理排序问题 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a command-line interface (CLI) utility for adding packages and scopes. - Enhanced `README.md` with clearer instructions and examples for managing packages via CLI. - **Bug Fixes** - Updated `.gitignore` to exclude `package_draft.json`, preventing unnecessary tracking. - **Refactor** - Replaced the old ESLint configuration with a new setup that improves JSON file linting. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: 静雨·安婵 <[email protected]> Co-authored-by: 云遮夏靥 <[email protected]> Co-authored-by: semantic-release-bot <[email protected]>
- Loading branch information
1 parent
61d6cfa
commit fa5c428
Showing
6 changed files
with
4,530 additions
and
4,339 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 |
---|---|---|
|
@@ -128,3 +128,5 @@ dist | |
.yarn/build-state.yml | ||
.yarn/install-state.gz | ||
.pnp.* | ||
|
||
package_draft.json |
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
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,28 @@ | ||
import pluginJsonc from "eslint-plugin-jsonc"; | ||
import parserJsonc from "jsonc-eslint-parser"; | ||
|
||
export default [ | ||
...pluginJsonc.configs['flat/recommended-with-json'], | ||
{ | ||
files: ["package{_draft,}.json"], | ||
languageOptions: { | ||
parser: parserJsonc, | ||
}, | ||
rules: { | ||
"jsonc/sort-array-values": [ | ||
"error", | ||
{ | ||
pathPattern: 'allowScopes', | ||
order: { type: "asc" }, | ||
}, | ||
], | ||
"jsonc/sort-keys": [ | ||
"error", | ||
{ | ||
pathPattern: 'allowPackages', | ||
order: { type: "asc" }, | ||
} | ||
], | ||
}, | ||
} | ||
]; |
Oops, something went wrong.