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

eslint-config-shulidata

v2.3.5

Published

ESLint shareable config for the Shuli JavaScript Style Guide.

Downloads

5

Readme

eslint-config-shulidata Build Status npm package npm downloads

ESLint shareable config for the 数立信息 JavaScript style guide

安装

$ npm install --save-dev eslint eslint-config-shulidata

配置

安装好 eslinteslint-config-shulidata 之后,在项目根目录添加eslint的配置文件,比如 .eslintrc 或者 .eslintrc.js

JavaScript

对于只检测js代码的项目,只需要在配置文件中的 extends 部分指定继承 shulidata 或者 shulidata/javascript 即可。

对于其他配置项比如 globalenvrules 均可以按照项目作定制化设置。

{
  "extends": "shulidata",
  "env": {
    "jQuery",
    "es6"
  },
  "global":{
    "Utils": true
  }
  "rules": {
    // Additional, overwrite some custom rules
    "no-console": "error",
    "no-undef": "off"
  }
}

Vue

对于 .vue 单文件组件,其中既有 template 部分,又有 script 部分。这时只需要指定 extends 为 shulidata/vue ,便能够进行对模板和js代码的检测。

{
  "extends": "shulidata/vue",
  "global":{
    "Vue": false
  }
  "rules": {
    // Additional, overwrite some vue rules
    "vue/require-v-for-key": "off",
    "vue/name-property-casing": ["error","camelCase"]
  }
}

此时可以覆写 eslint 的常规 rule,也可以覆写 vue 相关的 rule,两者的区别在于是否带 vue/ 前缀。

如果对于既需要校验JavaScript文件,又需要对vue单文件进行校验的场景,只需要在配置文件中指定继承 shulidata/vue 即可。

Rules

说明

编码风格没有完全的好坏之分,这里的强制校验只不过是为了团队协作效率所作出的经验总结而已。但我们尽量保持通用化,避免让开发人员在适应这份规则时感到十分的不爽。

如果你有意向使用这套经过全部覆写定制化后的校验规则,但是又有部分规则需要定制化,那么直接继承此份规则后重新覆写需要定制化的规则即可。

License

MIT © Shulidata