@lntvow/eslint-config 9.2.5 → 9.2.6

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.en.md +39 -0
  2. package/README.md +17 -7
  3. package/package.json +1 -1
package/README.en.md ADDED
@@ -0,0 +1,39 @@
1
+ # @lntvow/eslint-config
2
+
3
+ [中文](README.md) | [English](README.en.md)
4
+
5
+ ## Usage
6
+
7
+ install @lntvow/eslint-config
8
+
9
+ ```bash
10
+ pnpm install -D @lntvow/eslint-config
11
+ ```
12
+
13
+ create `eslint.config.mjs` in your project root
14
+
15
+ ```js
16
+ // eslint.config.mjs
17
+ import lntvow from '@lntvow/eslint-config'
18
+
19
+ export default lntvow()
20
+ ```
21
+
22
+ ## Plugins
23
+
24
+ Since flat config requires us to explicitly provide the plugin names (instead of the mandatory convention from npm package name), we renamed some plugins to make the overall scope more consistent and easier to write.
25
+
26
+ | New Prefix | Original Prefix | Source Plugin |
27
+ | -------------- | ---------------------- | ------------------------------------------------------------------------------------------ |
28
+ | `typescript/*` | `@typescript-eslint/*` | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint) |
29
+ | `vue/*` | `@vue/*` | [eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue) |
30
+ | `import/*` | `import-x/*` | [eslint-plugin-import-x](https://github.com/un-es/eslint-plugin-import-x) |
31
+ | `style/*` | `@stylistic/*` | [@stylistic/eslint-plugin](https://github.com/eslint-stylistic/eslint-stylistic) |
32
+
33
+ ## Kind Reminder
34
+
35
+ - If the project is installed via `npm` or `yarn`, you can skip this reminder.
36
+ - If you do not want to manually install `eslint` and other dependencies, and choose to use `pnpm` for installation, please note the following points:
37
+ - Due to the symbolic link feature of `pnpm` conflicting with the functionality of `eslint`, some packages must be hoisted to the root of `node_modules`.
38
+ - Create a `.npmrc` file in the root directory of the project and write `shamefully-hoist=true`. This command is used to hoist dependencies to the root of `node_modules`, then you can reinstall the dependencies.
39
+ - Alternatively, you can also choose to manually install `eslint` and other dependencies to the root of `node_modules`.
package/README.md CHANGED
@@ -1,29 +1,39 @@
1
1
  # @lntvow/eslint-config
2
2
 
3
- ## Usage
3
+ [English](README.en.md) | [中文](README.md)
4
4
 
5
- install @lntvow/eslint-config
5
+ ## 使用
6
+
7
+ 安装 @lntvow/eslint-config
6
8
 
7
9
  ```bash
8
10
  pnpm install -D @lntvow/eslint-config
9
11
  ```
10
12
 
11
- create `eslint.config.mjs` in your project root
13
+ 创建项目根目录下的 `eslint.config.js`
12
14
 
13
15
  ```js
14
- // eslint.config.mjs
16
+ // eslint.config.js
15
17
  import lntvow from '@lntvow/eslint-config'
16
18
 
17
19
  export default lntvow()
18
20
  ```
19
21
 
20
- ## Plugins
22
+ ## 插件
21
23
 
22
- Since flat config requires us to explicitly provide the plugin names (instead of the mandatory convention from npm package name), we renamed some plugins to make the overall scope more consistent and easier to write.
24
+ 由于平面配置要求我们显式提供插件名称(而不是 npm 包名称的强制约定),因此我们重命名了一些插件,以使整体范围更加一致且更易于编写。
23
25
 
24
- | New Prefix | Original Prefix | Source Plugin |
26
+ | 新前缀 | 旧前缀 | 插件厂库 |
25
27
  | -------------- | ---------------------- | ------------------------------------------------------------------------------------------ |
26
28
  | `typescript/*` | `@typescript-eslint/*` | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint) |
27
29
  | `vue/*` | `@vue/*` | [eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue) |
28
30
  | `import/*` | `import-x/*` | [eslint-plugin-import-x](https://github.com/un-es/eslint-plugin-import-x) |
29
31
  | `style/*` | `@stylistic/*` | [@stylistic/eslint-plugin](https://github.com/eslint-stylistic/eslint-stylistic) |
32
+
33
+ ## 温馨提示
34
+
35
+ - 如果项目是通过 `npm` 或者 `yarn` 安装的,可以跳过本提示。
36
+ - 如果你不想手动安装 `eslint` 及其他依赖包,选择使用 `pnpm` 进行安装需要注意以下几点:
37
+ - 由于 `pnpm` 的软链和 `eslint` 的功能存在冲突,所以部分包必须平铺在 `node_modules` 的根目录下。
38
+ - 在项目的根目录下新建 `.npmrc` 文件,并写入 `shamefully-hoist=true`。这个指令的作用是将依赖平铺到 `node_modules` 的根目录,然后重新安装依赖即可。
39
+ - 另外,你也可以选择手动安装 `eslint` 及其他依赖包至 `node_modules` 的根目录。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lntvow/eslint-config",
3
- "version": "9.2.5",
3
+ "version": "9.2.6",
4
4
  "author": "lntvow",
5
5
  "description": "eslint-config",
6
6
  "type": "module",