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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@winner-fed/plugin-check-syntax

v1.0.1

Published

WinJS plugin for checking ECMAScript syntax compatibility

Downloads

14

Readme

@winner-fed/plugin-check-syntax

WinJS plugin for checking ECMAScript syntax compatibility using @winner-fed/unplugin-check-syntax.

功能特性

  • 🔍 检查 ECMAScript 语法兼容性
  • 🎯 支持自定义目标浏览器范围
  • 📦 支持 Vite、Webpack、Rspack 构建工具
  • ⚙️ 灵活的配置选项
  • 🚫 支持排除特定文件

安装

npm add @winner-fed/plugin-check-syntax -D

使用方法

.winrc.ts 配置文件中添加插件:

// .winrc.ts
export default {
  plugins: ['@winner-fed/plugin-check-syntax'],
  // 启用语法检查
  checkSyntax: {
    // 目标浏览器范围
    targets: ['> 1%', 'last 2 versions'],
    
    // 排除文件
    exclude: ['node_modules', '\\.min\\.js$'],
    
    // ECMAScript 版本
    ecmaVersion: 2018
  }
};

配置选项

targets

指定项目的目标浏览器范围,值为标准的 browserslist 数组。

  • 类型: string[]
  • 默认值: undefined
  • 示例:
export default {
  plugins: ['@winner-fed/plugin-check-syntax'],
  checkSyntax: {
    targets: ['> 1%', 'last 2 versions', 'not ie <= 8']
  }
};

exclude

用于在检测期间排除部分源文件。可以传入一个或多个正则表达式来匹配源文件的路径。

  • 类型: string | string[]
  • 默认值: undefined
  • 示例:
export default {
  plugins: ['@winner-fed/plugin-check-syntax'],
  checkSyntax: {
    exclude: [
      'node_modules',
      '\\.min\\.js$',
      'vendor/'
    ]
  }
};

ecmaVersion

指定构建产物中可以使用的最低 ECMAScript 语法版本。ecmaVersion 的优先级高于 targets

  • 类型: 3 | 5 | 6 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 'latest'
  • 默认值: undefined
  • 示例:
export default {
  plugins: ['@winner-fed/plugin-check-syntax'],
  checkSyntax: {
    ecmaVersion: 2018
  }
};

简单配置

如果你只想启用默认的语法检查,可以直接设置为 true

export default {
  plugins: ['@winner-fed/plugin-check-syntax'],
  checkSyntax: true
};

支持的构建工具

  • ✅ Vite
  • ✅ Webpack
  • ✅ Rspack

License

MIT.