@waiting/eslint-config
v15.2.2
Published
ESLint Shareable Configuration for Typescript
Downloads
9,133
Maintainers
Readme
eslint-config
严格的针对TypeScript 项目的TypeScript ESLint 共享规则,用于替代 TSlint
功能
@waiting/eslint-config/recommended
扩展并定制于以下规则eslint:recommended
typescript-eslint/recommended
typescript-eslint/stylisticTypeChecked
@stylistic/eslint-plugin/recommended-flat
eslint-plugin-import
eslint-plugin-unicorn
@waiting/eslint-config
扩展于@waiting/eslint-config/strict
并开启更多限制规则
安装
npm i -D @waiting/eslint-config eslint
用途
添加以下内容到你的 eslint.config.mjs
文件:
import tseslint from 'typescript-eslint'
import recommended from './src/recommended.mjs'
const rules = {
// 'import/no-extraneous-dependencies': 0,
}
export default tseslint.config({
extends: [
...recommended,
],
languageOptions: {
parserOptions: {
project: 'tsconfig.eslint.json',
},
},
rules,
})
检查
npx eslint --fix src/**/*.ts
npx eslint src/**/*.{ts,js}