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

@astralweb/eslint-config

v2.1.0

Published

Comprehensive ESLint, Stylelint, and lint-staged configuration for Nova packages with TypeScript, Vue 3, and Tailwind CSS support (Internal Use Only)

Downloads

532

Readme

@nova-packages/eslint-config

⚠️ 內部使用套件 - 此套件僅供 Astral Web 內部使用,未經授權不得用於其他用途。

Nova Packages 的 ESLint 和 Stylelint 配置包,提供統一的代碼規範。

特點

  • 🔧 模組化設計:核心規則、TypeScript、Vue、Tailwind CSS 等模組化配置
  • 🚀 多專案支援:支援 Nuxt、獨立專案和純 TypeScript 專案
  • 🎨 整合 Stylelint:完整的 CSS/SCSS 代碼規範
  • Lint-staged:Git 提交前自動代碼檢查
  • 🛠 架構優化:移除重複規則,提升性能

安裝

pnpm add -D @astralweb/eslint-config eslint typescript

📦 所有必要的依賴(ESLint、Stylelint、plugins 等)都會自動安裝,無需手動安裝額外套件。

使用方法

ESLint 配置

1. Nuxt 專案(與 withNuxt 組合使用)

// eslint.config.js
import { eslintConfigNuxt } from '@astralweb/eslint-config/eslint';
import withNuxt from './.nuxt/eslint.config.mjs';

export default withNuxt([...eslintConfigNuxt]);

⚠️ 注意eslintConfigNuxt 設計用於與 withNuxt() 組合使用。

2. 獨立 Vue 專案(套件開發)

// eslint.config.js
import { eslintConfigStandalone } from '@astralweb/eslint-config/eslint';

export default eslintConfigStandalone;

3. 純 TypeScript 專案

// eslint.config.js
import { eslintConfigTypeScript } from '@astralweb/eslint-config/eslint';

export default eslintConfigTypeScript;

單獨使用特定規則

// eslint.config.js
import {
  baseRules,
  typeScriptRules,
  vueRules,
  tailwindRules,
} from "@nova-packages/eslint-config/eslint";

export default [
  baseRules,
  typeScriptRules,
  vueRules,
  // 可選:只在需要時加入 Tailwind CSS 規則
  tailwindRules,
];

Stylelint 配置

// stylelint.config.js
import stylelintConfig from "@nova-packages/eslint-config/stylelint";

export default stylelintConfig;

Lint-staged 配置

// lint-staged.config.js
import lintStagedConfig from "@nova-packages/eslint-config/lint-staged";

export default lintStagedConfig;

Package.json 腳本

{
  "scripts": {
    "lint": "eslint . && stylelint \"**/*.{css,scss,vue}\"",
    "lint:fix": "eslint --fix . && stylelint --fix \"**/*.{css,scss,vue}\"",
    "format": "eslint --fix ."
  }
}

配置說明

eslintConfigNuxt

適用場景:Nuxt 專案(與 withNuxt() 組合使用)

包含

  • 基礎代碼品質規則
  • TypeScript 規則(純 .ts/.tsx 文件)
  • Vue 3 組件規則(不含 TypeScript plugin,由 withNuxt 提供)
  • Tailwind CSS 類名檢查

特點

  • ✅ 避免與 withNuxt() 的 plugin 實例衝突
  • ✅ Vue 文件的 TypeScript 檢查由 Nuxt 內部處理

eslintConfigStandalone

適用場景:獨立的 Vue 專案或套件開發(非 Nuxt 環境)

包含

  • 基礎 JavaScript 推薦規則
  • TypeScript 嚴格檢查
  • Vue 3 組件規則
  • Import 插件規則
  • Tailwind CSS 類名檢查

特點

  • ✅ 開箱即用,無需額外配置
  • ✅ 適合 monorepo 中的 Vue 套件

eslintConfigTypeScript

適用場景:純 TypeScript 專案(工具庫、後端服務)

包含

  • 基礎 JavaScript 推薦規則
  • TypeScript 嚴格檢查
  • Import 插件規則
  • Node.js 環境支援

特點

  • ✅ 不包含 Vue 相關規則
  • ✅ 專注於 TypeScript 代碼品質

架構優化

相比原始配置,此版本進行了以下優化:

  1. 模組化重構:將配置拆分為獨立的功能模組
  2. 移除重複規則:清理了重複和衝突的規則定義
  3. 性能優化:優化了屬性排序和規則匹配
  4. 更好的可維護性:清晰的模組邊界和職責劃分

依賴要求

環境要求

  • Node.js >= 20.0.0
  • pnpm >= 10.0.0

Peer Dependencies

  • ESLint >= 9.0.0 (必需)
  • Stylelint >= 16.0.0 (使用 Stylelint 時需要)
  • TypeScript >= 5.0.0 (使用 TypeScript 時需要)

所有其他依賴(如 stylelint-config-standardeslint-plugin-vue 等)都已包含在套件中,會自動安裝。

授權聲明

此套件僅供 Astral Web 內部使用,未經授權不得用於其他用途。