3.4.1 • Published 8 days ago
@ithinkdt/eslint-config v3.4.1
@ithinkdt/eslint-config
安装 npm i -D @ithinkdt/eslint-config
- 集成
Type Aware Rules 类型感知规则
,检查 ts、vue 文件的类型错误; - 检测是否使用
unocss
,并自动添加@unocss/eslint-config
; - 支持
StyleLint、Prettier
配置。
因为启用了类型感知规则(vue2未启用),原则上 typescript 会在整个项目上执行,推测
lint-staged
效果不佳。
ESLint
安装 npm i -D eslint @types/eslint @rushstack/eslint-patch
// .eslintrc.cjs
require('@rushstack/eslint-patch/modern-module-resolution')
/**
* @type {import("eslint").Linter.Config}
*/
module.exports = {
root: true,
extends: ['@ithinkdt'], // vue2使用 @ithinkdt/eslint-config/vue2,
// 可选 @stylistic/eslint-plugin, https://eslint.style/guide/why
// plugins: ['@stylistic'],
parserOptions: {
project: __dirname + '/tsconfig.json',
},
ignorePatterns: ['node_modules/', 'public/', 'dist/'],
overrides: [
// 覆盖配置
],
}
StyleLint
安装 npm i -D stylelint
// .stylelintrc.cjs
/**
* @type {import('stylelint').Config}
*/
module.exports = {
extends: ['@ithinkdt/eslint-config/stylelint'],
rules: {
// 覆盖配置
},
}
Prettier
安装 npm i -D prettier
// .prettierrc.cjs
/**
* @type {import('prettier').Config}
*/
module.exports = {
...require('@ithinkdt/eslint-config/prettier'),
// 覆盖配置
}
3.4.1
8 days ago
3.4.0
15 days ago
3.3.12
1 month ago
3.3.11
2 months ago
3.3.10
2 months ago
3.3.9
2 months ago
3.3.8
3 months ago
3.3.7
3 months ago
3.3.6
4 months ago
3.3.5
5 months ago
3.3.1
5 months ago
3.2.2
6 months ago
3.1.0-0
10 months ago
3.3.0
6 months ago
3.2.1
6 months ago
3.2.0
6 months ago
3.1.0
10 months ago
3.3.4
5 months ago
3.3.3
5 months ago
3.3.2
5 months ago
3.1.0-1
10 months ago
3.0.0
11 months ago