Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/long-woo/eslint-config-typescript-prettier
🔧 一个 TypeScript 的 ESLint 配置,使用 Prettier 格式化代码。Typescript prettier
https://github.com/long-woo/eslint-config-typescript-prettier
eslint eslint-prettier eslint-typescript
Last synced: 7 days ago
JSON representation
🔧 一个 TypeScript 的 ESLint 配置,使用 Prettier 格式化代码。Typescript prettier
- Host: GitHub
- URL: https://github.com/long-woo/eslint-config-typescript-prettier
- Owner: long-woo
- Created: 2022-06-17T02:11:44.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-11-01T21:13:41.000Z (17 days ago)
- Last Synced: 2024-11-01T22:19:12.882Z (17 days ago)
- Topics: eslint, eslint-prettier, eslint-typescript
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@loongwoo/eslint-config-typescript-prettier
- Size: 160 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# eslint-config-typescript-prettier
🔧 ESLint configuration for TypeScript, using Prettier to format code.
> If you need to format Vue code, you can use [@loongwoo/eslint-config-vue](https://github.com/long-woo/eslint-config-vue).
## use
1. Install dependencies
```sh
pnpm add -D @loongwoo/eslint-config-typescript-prettier#or
yarn add -D @loongwoo/eslint-config-typescript-prettier# or
npm install --save-dev @loongwoo/eslint-config-typescript-prettier
```2. Configure ESLint
```js
import tsPrettier from '@loongwoo/eslint-config-typescript-prettier';/** @type {import('@typescript-eslint/utils').TSESLint.FlatConfig.ConfigFile} */
export default [
...tsPrettier,
{
files: ['*.ts', '*.tsx'],
ignores: ['src/vite-env.d.ts'],
},
];
```3. Open the `package.json` file and add the `eslint` command in the `scripts` configuration.
```json
{
"scripts": {
"lint": "eslint . --fix"
}
}
```