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-tdym

v0.1.0

Published

eslint-config-tdym for Vue CLI.

Downloads

3

Readme

eslint-config-tdym

背景

我们的目标是:帮助团队在协作开发时保持代码规范与代码风格的一致性。通过配置化、工具化,更方便的共享经验,新加入的成员不用死背规范,更易于上手。经过多个项目的实践,我们结合社区方案与自身需求,针对 Vue 开发中的一些经验进行了归纳总结,并创建了此项目。

版本依赖

  • eslint ^5.16.0 || ^6.1.0
  • prettier >= 1.13.0

用法

安装依赖包以及上述版本依赖

yarn add eslint-config-tdym -D
# or
npm install eslint-config-tdym -D

添加 prettier 配置项

在项目根目录中,添加 .prettierrc 文件,配置如下:

{
  "singleQuote": true,
  "semi": false,
  "trailingComma": "all",
  "arrowParens": "always",
  "htmlWhitespaceSensitivity": "ignore"
}
  • singleQuote: 在 js 中使用单引号风格、html 或 vue 模板中使用双引号;两者混用时不易产生混淆。
  • semi: 做一个无分号党
  • trailingComma: 对 git diff 友好,编码体验友好。
  • arrowParens: 总是带括号,方便增减参数、或解构。
  • htmlWhitespaceSensitivity: 参考issue#6061

添加 git 配置项

在项目中根目录中,添加 .gitattributes 文件,配置如下:

* text=auto eol=lf

配置说明

实现初衷是希望最大程度的使用社区稳定的方案,减少维护和沟通成本,如下:

推荐配置

const isProduction = process.env.NODE_ENV === 'production'

module.exports = {
  root: true,
  extends: ['eslint-config-tdym'],
  rules: {
    'no-console': isProduction ? 'warn' : 'off',
    'no-debugger': isProduction ? 'warn' : 'off',
  },
}