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

eslint-config-benson

v1.0.16

Published

   

Downloads

58

Readme

LionGroup-Config

   

eslint 引用方法

  1. 安裝 vscode 插件

ESLint Vscode Extension

 

  1. 安裝 npm 套件
npm i -D eslint-config-alloy eslint-plugin-react eslint-plugin-react-hooks

 

  1. 建立設定檔

在根目錄下的建立一個 .eslintrc(.json) 檔案 並加入以下擴充

module.expoorts = {
    extends: ["benson"],
    rules: {
        /* 你的自訂規則 */
    },
};

 

TypeScript 規則

  • Enum, Type, Interface 須以 E_ , T_ , I_ 開頭,
  • Enum 只接受大寫和 _

 

  正確的寫法

enum E_NUMBERS {
    One,
    Two,
}

type T_Names = {
    first: string;
};

interface I_Eamil {
    first: string;
}

 

  錯誤的寫法

// 名稱含小寫
enum E_Numbers {
    One,
    Two,
}

// 沒有以 T_ 開頭
type Names = {
    first: string;
};

// 沒有以 I_ 開頭
interface Email {
    first: string;
}

 

Prettier

  1. 安裝 vscode 插件

Prettier Vscode Extension

 

  1. 建立設定檔

.prettierrc.js

module.exports = {
    ...require("eslint-config-benson/prettier-config"),
    /**
     * 以下為你的自訂規則
     */
    semi: false,
};

 

Stylelint

  1. 安裝 vscode 插件

Stylelint Vscode Extension

 

  1. 下載 npm 套件
npm i -D stylelint

 

  1. 建立設定檔

.stylelintrc(.json)

{
    "extends": "eslint-config-benson/stylelint.config"
}

 

搭配 Styled-Components

請下載

npm i -D stylelint-processor-styled-components
  • stylelint-processor-styled-components:將樣式從 styled-components 抽出

 

並在 .stylelintrc.json 加入

{
    "processors": ["stylelint-processor-styled-components"],
    "extends": ["eslint-config-benson/stylelint.config"],
    "rules": [
        /* 你的自訂規則 */
    ]
}

 

參考資源

eslint

  • https://medium.com/onedegree-tech-blog/%E5%BB%BA%E7%AB%8B%E5%85%AC%E5%8F%B8%E5%85%A7%E9%83%A8%E4%BD%BF%E7%94%A8%E7%9A%84-eslint-config-package-4b76c089848
  • https://github.com/AlloyTeam/eslint-config-alloy/blob/master/README.zh-CN.md
  • https://github.com/yannickcr/eslint-plugin-react

 

prettier

  • https://prettier.io/docs/en/configuration.html

 

stylelint

  • https://stylelint.io/user-guide/configure/#plugins
  • https://styled-components.com/docs/tooling