@slcy/eslint-config
Version:
ESLint config for @slcy
51 lines (50 loc) • 2.11 kB
TypeScript
/**
* @description: config 参数
* @property {Record<string, any>} rules - 规则集合
*/
interface IConfig {
rules: Record<string, any>;
[key: string]: any;
}
/**
* @description 插件配置结构定义,用于定义自定义 ESLint 插件中的配置对象
* @property {Record<string, any>} meta 插件元信息,例如版本、文档链接等
* @property {Record<string, any>} rules 插件提供的全部规则集合,键名为规则名,值为规则实现
* @property {Object} configs 插件预设的配置集合,可按不同使用场景选择使用
* @property {IConfig} configs.recommended 推荐规则集,启用插件中最常用、推荐开启的规则
* @property {IConfig} configs.import 导入相关规则配置(如 import 排序、路径别名等)
* @property {IConfig} configs.base 基础规则集,通用于代码风格规则
* @property {IConfig} configs.js 适用于纯 JavaScript 项目的规则集
* @property {IConfig} configs.ts 适用于 TypeScript 项目的规则集,通常依赖 @typescript-eslint
* @property {IConfig} configs.vue 适用于 Vue 项目的规则集,结合 eslint-plugin-vue 使用
* @property {any} processors 处理器定义,可用于处理自定义文件类型或特殊结构(如 Markdown 中的代码块)
* @property {any} [key: string] 其他自定义扩展字段,允许附加自定义属性
*/
interface IPluginConfig {
meta: Record<string, any>;
rules: Record<string, any>;
/** 插件预设的配置集合 */
configs: {
/** 全部规则 */
recommended: IConfig;
/** 导入规则 */
import: IConfig;
/** 基础规则 */
base: IConfig;
/** js 规则 */
js: IConfig;
/** ts 规则 */
ts: IConfig;
/** vue 规则 */
vue: {
/** 默认规则 */
rules: Record<string, any>;
/** 自动导入规则 */
autoImport: Record<string, any>;
};
};
processors: any;
[key: string]: any;
}
declare const plugin: IPluginConfig;
export default plugin;