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

@baiducloud/eslint-config-react

v1.0.0-alpha.4

Published

eslint config for react project

Downloads

6

Readme

@baiducloud/eslint-config-react

Console 控制台前端业务使用的 ESlint 配置,基于v8.21.0引入的新版配置实现,后续的 v9 版本中.eslintrc*将不再支持。

✔ 基于@ecomfe/eslint-config/react扩展

开发

添加 Plugin

如果需要添加一个插件,那么这个插件应该被指定为 peerDependency,这是因为插件将在最终用户的项目中被加载,所以最终用户需要自己安装他们需要的插件。之后,在项目的rules目录下创建demo-rule.js规则文件,将需要实现的规则加入到文件中,例如:

// demo-rule.js
export default {
  quotes: [2, 'double']
};

然后在index.js中扩展:

import DemoPlugin from 'eslint-plugin-demo';
import DemoRule from './rules/demo-rule';

{
  plugins: {
    "demo-plugin": DemoPlugin
  }
  rules: {
    ...DemoRule
  }
}

添加 Shared Config

如果需要添加一个外部的可共享配置,则需要在package.json中将这些包指定为依赖项,然后在index.js的数组中添加一个FlatConfig

调试

在当前项目中执行npm link,然后在目标项目中执行npm link @baiducloud/eslint-config-react,这样就可以在目标项目中调试当前项目。

安装

npm i -D @baiducloud/eslint-config-react

如果使用的 npm 版本小于 7.0,需要手动安装 peerDependencynpm i -D eslint

使用

建议使用新版的 flat config system,即:eslint.config.js是唯一的配置文件名称,.eslintrc*等格式的名称,以及 json、yaml 格式的配置文件都将不再支持。

ESLint 配置扩展:

export default [
  {
    rules: {
      'semi': 'error',
      'prefer-const': 'error'
    }
  }
];