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

@provincial-platform/eslint-config-js

v0.1.7

Published

Provincial platform eslint config for javascript

Downloads

2

Readme

@provincial-platform/eslint-config-js

eslint

使用

安装

# yarn
yarn add eslint @provincial-platform/eslint-config-js -D
# npm/cnpm
npm install eslint @provincial-platform/eslint-config-js --save-dev

配置

.eslintrc.js

  • 完整引入所有规则
module.exports = {
  ...,
  extends: [
    '@provincial-platform/eslint-config-js'
  ]
}
  • 按需引入规则
module.exports = {
  ...,
  extends: [
    '@provincial-platform/eslint-config-js/rules/possible-errors',
    '@provincial-platform/eslint-config-js/rules/best-practices',
    '@provincial-platform/eslint-config-js/rules/strict',
    '@provincial-platform/eslint-config-js/rules/variables',
    '@provincial-platform/eslint-config-js/rules/node',
    '@provincial-platform/eslint-config-js/rules/style',
    '@provincial-platform/eslint-config-js/rules/es6',
  ]
}

说明

@provincial-platform/eslint-config-js几乎包含了Eslint的所有规范。其主要分为以下几个包:

rules/possible-errors.js

该包下的规则与JavaScript代码中可能的错误或逻辑错误有关。例如禁止出现空语句块、禁止不必要的分号等规则。

rules/best-practices.js

该包下的规则与一些最佳实践有关。如禁用alertconfirmprompteval(),禁止多个空格等规则。

rules/strict.js

该包下只有一条规则:禁用严格模式指令。

rules/variables.js

该包下规则与变量声明相关。例如禁止出现未使用过的变量。

rules/node.js

该包下的规则是针对Node.js和浏览器中的CommonJS。例如要求require()必须出现在顶层模块作用域。

rules/style.js

该包下规则与代码风格相关。例如末尾逗号、数组之间换行、一致的缩进等等。

rules/es6.js

该包下规则只与es6相关。例如箭头函数的参数必须使用圆括号、禁止new Symbol