Skip to content

long-woo/eslint-config-typescript-prettier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

use

  1. Install dependencies
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
  1. Configure ESLint
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'],
  },
];
  1. Open the package.json file and add the eslint command in the scripts configuration.
{
   "scripts": {
     "lint": "eslint . --fix"
   }
}