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-ro-ts

v0.1.1

Published

eslint eslintconfig ro-ts eslint-config typescript-eslint

Downloads

4

Readme

eslint 规范

这个是自定义的eslint的规范的typescript版本


使用

npm install --save-dev eslint-config-ro-ts

然后在你自己的eslint的配置文件上引入

"extends": [
    "ro-ts"
]

依赖

"dependencies": {
    "eslint": "^7.2.0",
    "@typescript-eslint/eslint-plugin": "^3.1.0",
    "@typescript-eslint/parser": "^3.1.0"
  }

完整的规则如下

{
    "parser": "@typescript-eslint/parser",
    "extends": [
        "eslint:recommended",
        "plugin:@typescript-eslint/eslint-recommended",
        "plugin:@typescript-eslint/recommended"
    ],
    "plugins": [
      "@typescript-eslint"
    ],
    "parserOptions": {
      "ecmaVersion": 2018,
      "sourceType": "module",
      "ecmaFeatures": {"jsx": true}
    },
    "rules": {
        "@typescript-eslint/ban-types": "off",
        "@typescript-eslint/explicit-function-return-type": "off",
        "@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}],
        "@typescript-eslint/explicit-module-boundary-types": "off",
        "@typescript-eslint/no-empty-function": "off",
        "@typescript-eslint/no-empty-interface": "off",
        "@typescript-eslint/no-explicit-any": "off",
        "@typescript-eslint/no-inferrable-types": "off",
        "@typescript-eslint/no-non-null-assertion": "off",
        "@typescript-eslint/no-unused-vars": "off",
        "@typescript-eslint/no-use-before-define": ["error", "nofunc"],
        "no-console": ["error", {"allow": ["info", "warn", "error"]}],
        "no-useless-computed-key": ["error"],
        "no-useless-rename": ["error"],
        "object-shorthand": "error",
        "prefer-const": ["error"],
        "require-yield": "off",
        "no-prototype-builtins": "off",
        "semi": ["error", "never"],
        "indent": [ "error", 2 ],
        "quotes": ["error", "single"],
        "block-spacing": "error",
        "space-before-blocks": "error",
        "object-curly-spacing": ["error", "always"],
        "no-duplicate-imports": "error",
        "no-var": "error",
        "require-await": "error", // 禁止使用不带 await 表达式的 async 函数
        "computed-property-spacing": "error",
        "lines-between-class-members": "error", // 强制类成员之间出现空 s
        "key-spacing": "error", // 强制在对象字面量的属性中键和值之间使用一致的间距 s
        "no-nested-ternary": "error", // 禁用嵌套的三元表达式
        "no-multiple-empty-lines": ["error", { "max": 1, "maxBOF": 1 }], // 禁止出现多行空行 s max 1行 文件末尾1行 s
        "space-before-function-paren": "error", // 强制在 function的左括号之前使用一致的空格 s
        "arrow-spacing": "error", // 强制箭头函数的箭头前后使用一致的空格 s
        "rest-spread-spacing": "error", // 强制剩余和扩展运算符及其表达式之间有空格 s
        "no-unneeded-ternary": "error", // 禁止可以在有更简单的可替代的表达式时使用三元操作符 s
        "eqeqeq": "error", // 要求使用 === 和 !==
        "space-infix-ops": "error", // 要求操作符周围有空格 s
        "switch-colon-spacing": "error", // 强制在 switch 的冒号左右有空格 s
        "no-multi-spaces": "error", // 禁止使用多个空格 s
        "array-bracket-spacing": "error", // 强制数组方括号中使用一致的空格 s
        "comma-spacing": "error", // 强制在逗号后使用一致的空格 s
        "space-unary-ops": "error", // 强制在一元操作符前后使用一致的空格 s
        "eol-last": "error", // 在文件末尾多一行
        "lines-around-comment": ["error", {"beforeLineComment": true}] // 行注释前面需要空行
    }
  }
  

license

MIT