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 🙏

© 2024 – Pkg Stats / Ryan Hefner

aus-eslint-config

v2.1.1

Published

eslint9+的一键扁平化配置库

Downloads

339

Readme

aus-eslint-config

  • Eslint9+的配置库 简化配置流程 傻瓜式操作 预置了一些常用的eslint规则
  • 从2.0.0版本开始,代码样式使用prettier进行格式化(无需安装) 导入方式改变

安装

pnpm install aus-eslint-config -D

使用

eslinteslint.config.mjs

// 项目根目录创建eslint.config.mjs
import { eslintConfig } from 'aus-eslint-config'

export default eslintConfig({
  vue: true,
  ts: {
    'vue/no-unused-vars': 'off'
  },
  ...
})

/**
 * AusConfig接口,用于配置代码检查规则, 可以通过对应属性覆盖默认配置
 *
 * @property {Linter.RulesRecord?} baseRules 基础规则,用于定义通用的js代码检查规则
 * @property {Linter.RulesRecord | boolean?} ts TypeScript规则,用于定义TypeScript代码的检查规则;如果为boolean类型,表示是否启用TypeScript检查
 * @property {Linter.RulesRecord | boolean?} vue Vue规则,用于定义Vue代码的检查规则;如果为boolean类型,表示是否启用Vue检查
 * @property {Linter.RulesRecord | boolean?} unocss Unocss规则,用于定义Unocss相关的检查规则;如果为boolean类型,表示是否启用Unocss检查
 * @property {string[]} ignores 忽略列表,用于指定哪些文件或目录在检查时应该被忽略
 * @property {Linter.RulesRecord?} rules 自定义规则,允许用户定义额外的代码检查规则
 */
 
interface AusConfig {
  baseRules?: Linter.RulesRecord;
  ts?: Linter.RulesRecord | boolean;
  vue?: Linter.RulesRecord | boolean;
  unocss?: Linter.RulesRecord | boolean;
  ignores?: string[];
  rules?: Linter.RulesRecord;
}

prettierprettier.config.mjs

// 如果需要使用prettier格式化代码,需要在根目录创建prettier.config.mjs 
// 可以使用导出的配置 也可按照prettier的配置进行自定义

import { prettierConfig } from 'aus-eslint-config'

export default prettierConfig({
  printWidth: 100,
  tabWidth: 2,
  ...
})
默认ignore目录及文件
      '**/dist',
      '**/docs',
      '**/node_modules',
      '**/package-lock.json',
      '**/yarn.lock',
      '**/pnpm-lock.yaml',
      '**/*.woff',
      '**/*.woff2',
      '**/.idea',
      '**/.vscode',
      '**/.git',
      '**/Dockerfile',
      '**/.*'