npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ianchoi/eslint-config-vue

v0.0.3

Published

ESLint Vue configuration based on ESLint 9 Flat Config

Readme

@ianchoi/eslint-config-vue

ESLint Vue 配置包,基于 ESLint 9 Flat Config 格式。

特性

  • ✅ 基于 ESLint 9 Flat Config 格式
  • ✅ 支持 Vue 3 单文件组件
  • ✅ 继承 eslint-plugin-vue 推荐配置
  • ✅ 强制组件标签顺序(script → template → style)
  • ✅ 属性和事件命名规范
  • ✅ 属性排序规则

安装

从 npm 安装(发布后)

npm install --save-dev @ianchoi/eslint-config-vue
# 或
pnpm add -D @ianchoi/eslint-config-vue
# 或
yarn add -D @ianchoi/eslint-config-vue

使用方法

ESLint 9+ (Flat Config)

在你的 eslint.config.jseslint.config.mjs 文件中:

import vueConfig from '@ianchoi/eslint-config-vue'

export default [
  ...vueConfig,
  // 你的其他配置
]

结合 standard 配置使用

import standardConfig from '@ianchoi/eslint-config-standard'
import vueConfig from '@ianchoi/eslint-config-vue'

export default [
  ...standardConfig,
  ...vueConfig,
  // 你的其他配置
]

依赖要求

  • ESLint >= 9.0.0
  • Vue 3.x(推荐)

规则说明

Props 相关

| 规则 | 配置 | 说明 | |------|------|------| | vue/require-prop-types | error | 要求 props 必须定义类型 | | vue/prop-name-casing | off | 关闭 prop 命名检查 |

组件命名

| 规则 | 配置 | 说明 | |------|------|------| | vue/multi-word-component-names | error | 要求组件名称为多单词(忽略 Index, Home, About) | | vue/component-name-in-template-casing | error, PascalCase | 模板中组件使用 PascalCase |

属性格式

| 规则 | 配置 | 说明 | |------|------|------| | vue/attribute-hyphenation | error, never | 禁止属性使用连字符 | | vue/v-on-event-hyphenation | error, never | 禁止事件使用连字符(自动修复) |

组件结构

| 规则 | 配置 | 说明 | |------|------|------| | vue/block-order | error | 标签顺序:script → template → style |

属性排序

vue/attributes-order 规则强制属性按以下顺序排列:

  1. DEFINITION - is, v-is
  2. LIST_RENDERING - v-for
  3. CONDITIONALS - v-if, v-else-if, v-else, v-show, v-cloak
  4. RENDER_MODIFIERS - v-pre, v-once
  5. GLOBAL - id
  6. UNIQUE/SLOT - ref, key, v-slot, slot
  7. TWO_WAY_BINDING - v-model
  8. OTHER_DIRECTIVES - 其他自定义指令
  9. OTHER_ATTR - 其他属性(class, style 等)
  10. EVENTS - v-on, @
  11. CONTENT - v-html, v-text

同一分组内按字母顺序排列。

示例

✅ 正确的 Vue 组件

<script setup>
defineProps({
  userName: {
    type: String,
    required: true
  },
  isActive: {
    type: Boolean,
    default: false
  }
})

const emit = defineEmits(['userClick'])

const handleClick = () => {
  emit('userClick')
}
</script>
<template>
  <div
    v-if="isActive"
    class="user-profile"
    @click="handleClick"
  >
    {{ userName }}
  </div>
</template>
<style scoped>
.user-profile {
  padding: 16px;
}
</style>

❌ 错误的写法

<!-- 错误:template 在 script 之前 -->
<template>
  <div>Hello</div>
</template>
<script setup>
// 错误:props 没有类型定义
defineProps(['badProp'])
</script>

许可证

ISC