@kirklin/eslint-config 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +60 -6
  2. package/README.zh-cn.md +114 -0
  3. package/package.json +11 -11
package/README.md CHANGED
@@ -1,23 +1,44 @@
1
1
  # @kirklin/eslint-config
2
+ [![CI][ci-image]][ci-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript_code style][code-style-image]][code-style-url]
2
3
 
3
- [![npm](https://img.shields.io/npm/v/@kirklin/eslint-config?color=a1b858&label=)](https://npmjs.com/package/@kirklin/eslint-config)
4
+ [ci-image]: https://github.com/kirklin/eslint-config/actions/workflows/release.yml/badge.svg?branch=master
5
+ [ci-url]: https://github.com/kirklin/eslint-config/actions/workflows/release.yml
6
+ [npm-image]: https://img.shields.io/npm/v/@kirklin/eslint-config.svg
7
+ [npm-url]: https://npmjs.org/package/@kirklin/eslint-config
8
+ [downloads-image]: https://img.shields.io/npm/dm/@kirklin/eslint-config.svg
9
+ [downloads-url]: https://npmjs.org/package/@kirklin/eslint-config
10
+ [code-style-image]: https://img.shields.io/badge/code__style-%40kirklin%2Feslint--config-brightgreen
11
+ [code-style-url]: https://github.com/kirklin/eslint-config/
4
12
 
5
- - double quotes, must semi
13
+ <div align='left'>
14
+ <b>English</b> | <a href="README.zh-cn.md">简体中文</a>
15
+ <br>
16
+ </div>
17
+
18
+ ## Features
19
+
20
+ - "double quotes", must semi;
6
21
  - Auto fix for formatting (aimed to be used standalone without Prettier)
7
- - TypeScript, Vue, React out-of-box
8
- - Lint also for json, yaml, markdown
22
+ - TypeScript, Vue out-of-box
23
+ - Lint also for JSON、YAML、Markdown
9
24
  - Sorted imports, dangling commas for cleaner commit diff
10
25
  - Reasonable defaults, best practices, only one-line of config
11
26
 
12
27
  ## Usage
13
28
 
29
+ Shareable configs are designed to work with the `extends` feature of `.eslintrc` files.
30
+ You can learn more about
31
+ [Shareable Configs](http://eslint.org/docs/developer-guide/shareable-configs) on the
32
+ official ESLint website.
33
+
34
+ #### run the following command:
35
+
14
36
  ### Install
15
37
 
16
38
  ```bash
17
39
  pnpm add -D eslint @kirklin/eslint-config
18
40
  ```
19
-
20
- ### Config `.eslintrc`
41
+ ### add this to your `.eslintrc` file:
21
42
 
22
43
  ```json
23
44
  {
@@ -47,11 +68,44 @@ Create `.vscode/settings.json`
47
68
  ```json
48
69
  {
49
70
  "prettier.enable": false,
71
+ "editor.formatOnSave": false,
50
72
  "editor.codeActionsOnSave": {
51
73
  "source.fixAll.eslint": true
52
74
  }
53
75
  }
54
76
  ```
77
+ ### Customization rules
78
+ add you like rules to your `.eslintrc` file:
79
+ ```json
80
+ {
81
+ "extends": [
82
+ "@kirklin"
83
+ ],
84
+ "rules": {
85
+ "vue/component-tags-order": ["error", {
86
+ "order": ["template", "script", "style"]
87
+ }]
88
+ }
89
+ }
90
+ ```
91
+
92
+ ## Badge
93
+
94
+ Use this in one of your projects? Include one of these badges in your readme to
95
+ let people know that your code is using the standard style.
96
+
97
+
98
+ [![kirklin-code-style-image](https://img.shields.io/badge/code__style-%40kirklin%2Feslint--config-brightgreen)](https://github.com/kirklin/eslint-config/)
99
+
100
+ ```markdown
101
+ [![kirklin-code-style-image](https://img.shields.io/badge/code__style-%40kirklin%2Feslint--config-brightgreen)](https://github.com/kirklin/eslint-config/)
102
+ ```
103
+
104
+ [code-style-image]: https://img.shields.io/badge/code__style-%40kirklin%2Feslint--config-brightgreen
105
+ [code-style-url]: https://github.com/kirklin/eslint-config/
106
+
107
+ ## Thanks
108
+ This project is based on [@antfu/eslint-config](https://github.com/antfu/eslint-config)
55
109
 
56
110
  ## License
57
111
 
@@ -0,0 +1,114 @@
1
+ # @kirklin/eslint-config
2
+ [![CI][ci-image]][ci-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript_code style][code-style-image]][code-style-url]
3
+
4
+ [ci-image]: https://github.com/kirklin/eslint-config/actions/workflows/release.yml/badge.svg?branch=master
5
+ [ci-url]: https://github.com/kirklin/eslint-config/actions/workflows/release.yml
6
+ [npm-image]: https://img.shields.io/npm/v/@kirklin/eslint-config.svg
7
+ [npm-url]: https://npmjs.org/package/@kirklin/eslint-config
8
+ [downloads-image]: https://img.shields.io/npm/dm/@kirklin/eslint-config.svg
9
+ [downloads-url]: https://npmjs.org/package/@kirklin/eslint-config
10
+ [code-style-image]: https://img.shields.io/badge/code__style-%40kirklin-brightgreen.svg
11
+ [code-style-url]: https://github.com/kirklin/eslint-config/
12
+
13
+ <div align='left'>
14
+ <a href="README.md">English</a> | <b>简体中文</b>
15
+ <br>
16
+ </div>
17
+
18
+ ## 特性
19
+
20
+ - "双引号",必须加分号;
21
+ - 格式化的自动修复(旨在独立使用,不需要Prettier)。
22
+ - TypeScript,Vue开箱即用
23
+ - 对 JSON、YAML、Markdown也支持格式化
24
+ - 导入自动排序,需要尾随逗号,更干净的提交差异
25
+ - 合理的默认值,最佳实践,只有一行的配置
26
+
27
+ ## 如何使用
28
+
29
+ 可共享的配置被设计在`.eslintrc`文件的`extends`。
30
+ 你可以了解更多关于
31
+ [Shareable Configs](http://eslint.org/docs/developer-guide/shareable-configs) 在
32
+ 官方ESLint网站上
33
+
34
+ ### 运行以下命令开始使用:
35
+
36
+ ### 安装
37
+
38
+ ```bash
39
+ pnpm add -D eslint @kirklin/eslint-config
40
+ ```
41
+
42
+ ### 在你的`.eslintrc`文件中加入这个。
43
+
44
+ ```json
45
+ {
46
+ "extends": "@kirklin"
47
+ }
48
+ ```
49
+
50
+ > 你通常不需要`.eslintignore`,因为它已经由预设提供了。
51
+
52
+ ### 为package.json添加脚本配置
53
+
54
+ 例如:
55
+
56
+ ```json
57
+ {
58
+ "scripts": {
59
+ "lint": "eslint .",
60
+ "lint:fix": "eslint . --fix"
61
+ }
62
+ }
63
+ ```
64
+
65
+ ### 在Vscode中 配置自动修复
66
+
67
+ 创建 `.vscode/settings.json`
68
+
69
+ ```json
70
+ {
71
+ "prettier.enable": false,
72
+ "editor.formatOnSave": false,
73
+ "editor.codeActionsOnSave": {
74
+ "source.fixAll.eslint": true
75
+ }
76
+ }
77
+ ```
78
+
79
+ ### 自定义规则
80
+
81
+ 在你的`.eslintrc`文件中添加你喜欢的规则。
82
+
83
+ ```json
84
+ {
85
+ "extends": [
86
+ "@kirklin"
87
+ ],
88
+ "rules": {
89
+ "vue/component-tags-order": ["error", {
90
+ "order": ["template", "script", "style"]
91
+ }]
92
+ }
93
+ }
94
+ ```
95
+
96
+ ## 徽章
97
+ 在你的README中包括一个这样的徽章,以便让人们知道你的代码使用的是哪种ESLint样式。
98
+
99
+ [![kirklin-code-style-image](https://img.shields.io/badge/code__style-%40kirklin%2Feslint--config-brightgreen)](https://github.com/kirklin/eslint-config/)
100
+
101
+ ```markdown
102
+ [![kirklin-code-style-image](https://img.shields.io/badge/code__style-%40kirklin%2Feslint--config-brightgreen)](https://github.com/kirklin/eslint-config/)
103
+ ```
104
+
105
+ [code-style-image]: https://img.shields.io/badge/code__style-%40kirklin%2Feslint--config-brightgreen
106
+ [code-style-url]: https://github.com/kirklin/eslint-config/
107
+
108
+ ## 致谢
109
+ 本项目基于 [@antfu/eslint-config](https://github.com/antfu/eslint-config)
110
+
111
+
112
+ ## 开源协议
113
+
114
+ [MIT](./LICENSE) License &copy; 2019-PRESENT [Kirk Lin](https://github.com/kirklin)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kirklin/eslint-config",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Kirk Lin's ESLint config",
5
5
  "author": "Kirk Lin <linkirk@163.com> (https://github.com/kirklin)",
6
6
  "license": "MIT",
@@ -16,22 +16,22 @@
16
16
  "eslint": ">=7.4.0"
17
17
  },
18
18
  "dependencies": {
19
- "@kirklin/eslint-config-vue": "0.1.8",
20
- "@typescript-eslint/eslint-plugin": "^5.36.1",
21
- "@typescript-eslint/parser": "^5.36.1",
19
+ "@kirklin/eslint-config-vue": "0.1.9",
20
+ "@typescript-eslint/eslint-plugin": "^5.45.0",
21
+ "@typescript-eslint/parser": "^5.45.0",
22
22
  "eslint-plugin-eslint-comments": "^3.2.0",
23
23
  "eslint-plugin-html": "^7.1.0",
24
24
  "eslint-plugin-import": "^2.26.0",
25
- "eslint-plugin-jsonc": "^2.4.0",
26
- "eslint-plugin-n": "^15.2.5",
27
- "eslint-plugin-promise": "^6.0.1",
28
- "eslint-plugin-unicorn": "^43.0.2",
29
- "eslint-plugin-vue": "^9.4.0",
30
- "eslint-plugin-yml": "^1.1.0",
25
+ "eslint-plugin-jsonc": "^2.5.0",
26
+ "eslint-plugin-n": "^15.5.1",
27
+ "eslint-plugin-promise": "^6.1.1",
28
+ "eslint-plugin-unicorn": "^44.0.2",
29
+ "eslint-plugin-vue": "^9.7.0",
30
+ "eslint-plugin-yml": "^1.2.0",
31
31
  "jsonc-eslint-parser": "^2.1.0",
32
32
  "yaml-eslint-parser": "^1.1.0"
33
33
  },
34
34
  "devDependencies": {
35
- "eslint": "^8.23.0"
35
+ "eslint": "^8.27.0"
36
36
  }
37
37
  }