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-plugin-wxs

v1.2.1

Published

ESLint plugin about wxs lint.

Downloads

19

Readme

简介

该 eslint 插件目标是为了在微信小程序环境下开发 WXS 进行语法的错误提示和修复

使用方法

安装

npm install --save-dev eslint eslint-plugin-wxs

::: 版本要求

  • Node.js 8.10.0 或更高.
  • ESLint 4.19.1 或更高. :::

eslint 配置文件示例

module.exports = {
    {
      "files": ["**/*.wxs"], //针对wxs文件
      "extends": ["plugin:wxs/recommended"], //使用推荐配置
      "parserOptions": {
        "ecmaVersion": 2020 //默认js版本
      },
      "env": {
        "es6": true
      },
      "settings": {
        "es": { "aggressive": true } //是否打开类型推断在any情况下依然检测对应方法是否符合对应规则
      },
      "rules": {
        "wxs/no-array-prototype-keys": ["error", { "aggressive": false }],//其中object是自定义类  //如果出现同名自定义方法是否报错 比如object.keys()
        "no-restricted-syntax": [ //屏蔽eslint基础报错
          "off",
          {
            "selector": "*",
            "message": "Do not use built-in ESLint rules on .wxs files."
          }
        ],
        "wxs/restrict-string-wxs": [ // 特殊规则,配置禁止的字符串
          "error",
          {
            "strings": ["所需要禁止的字符串"]
          }
        ]
      }
    },
};

json 格式修改为 js 格式即可

package 说明

所有除 es6+语法之外的特殊配置都在 restrict-to-wxs 中 wxs 特殊语法相关 rule 均在 no-wxs(禁止),restrict(限制)文件夹中

特别说明

项目中参考了大量 eslint-plugin-es 的代码

  • npmUrl:https://www.npmjs.com/package/eslint-plugin-es?activeTab=readme
  • gitHubUrl:https://github.com/mysticatea/eslint-plugin-es