Skip to content

Commit 51e358e

Browse files
committed
fix: 修复不工作问题
1 parent 6180c6c commit 51e358e

File tree

2 files changed

+26
-18
lines changed

2 files changed

+26
-18
lines changed

README.md

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,44 @@
11
# eslint-config-typescript-prettier
22

3-
🔧 一个 TypeScript 的 ESLint 配置,使用 Prettier 格式化代码。
3+
🔧 ESLint configuration for TypeScript, using Prettier to format code.
44

5-
> 如果需要对 Vue 的代码进行格式化,可以使用 [@longwoo/eslint-config-vue](https://github.com/long-woo/eslint-config-vue)
5+
> If you need to format Vue code, you can use [@loongwoo/eslint-config-vue](https://github.com/long-woo/eslint-config-vue).
66
7-
## 使用
7+
## use
88

9-
1.安装依赖
9+
1. Install dependencies
1010

1111
```sh
12-
pnpm add -D @longwoo/eslint-config-typescript-prettier
12+
pnpm add -D @loongwoo/eslint-config-typescript-prettier
1313

14-
# or
15-
yarn add -D @longwoo/eslint-config-typescript-prettier
14+
#or
15+
yarn add -D @loongwoo/eslint-config-typescript-prettier
1616

1717
# or
18-
npm install --save-dev @longwoo/eslint-config-typescript-prettier
18+
npm install --save-dev @loongwoo/eslint-config-typescript-prettier
1919
```
2020

21-
2.配置 ESLint
21+
2. Configure ESLint
2222

23-
```json
24-
{
25-
"extends": "@longwoo/typescript-prettier"
26-
}
23+
```js
24+
import tsPrettier from '@loongwoo/eslint-config-typescript-prettier';
25+
26+
/** @type {import('@typescript-eslint/utils').TSESLint.FlatConfig.ConfigFile} */
27+
export default [
28+
...tsPrettier,
29+
{
30+
files: ['*.ts', '*.tsx'],
31+
ignores: ['src/vite-env.d.ts'],
32+
},
33+
];
2734
```
2835

29-
3.打开 `package.json` 文件,在 `scripts` 配置中添加 `eslint` 命令,运行 ESLint 校验代码。
36+
3. Open the `package.json` file and add the `eslint` command in the `scripts` configuration.
3037

3138
```json
3239
{
33-
"scripts": {
34-
"eslint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
35-
}
40+
"scripts": {
41+
"lint": "eslint . --fix"
42+
}
3643
}
3744
```

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"name": "@loongwoo/eslint-config-typescript-prettier",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"description": "ESLint configuration for TypeScript, using Prettier to format code.",
55
"main": "index.js",
6+
"type": "module",
67
"keywords": [
78
"eslint",
89
"typescript",

0 commit comments

Comments
 (0)