Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xsf0105/eslint-plugin-syntax-ban
An eslint plugin for ban some JS syntax.(一个可以禁用一些 JS 语法的 eslint 插件。支持继续拓展~)
https://github.com/xsf0105/eslint-plugin-syntax-ban
eslint eslint-plugin
Last synced: 22 days ago
JSON representation
An eslint plugin for ban some JS syntax.(一个可以禁用一些 JS 语法的 eslint 插件。支持继续拓展~)
- Host: GitHub
- URL: https://github.com/xsf0105/eslint-plugin-syntax-ban
- Owner: xsf0105
- Created: 2019-09-30T07:23:42.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-06-19T06:41:38.000Z (over 1 year ago)
- Last Synced: 2024-10-05T02:31:38.085Z (about 1 month ago)
- Topics: eslint, eslint-plugin
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/eslint-plugin-syntax-ban
- Size: 36.1 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# eslint-plugin-syntax-ban
* 本文用于讲解如何禁用 JS 语法的 eslint plugin 的实现,以及使用。[详细讲解](https://juejin.im/post/5d91be23f265da5ba532a07e)
## Example
在前端工程中禁用 `console.time()` 和 `Object.value()` 方法。支持开发者继续拓展~## How to use
```bash
yan add eslint-pulgin-syntax-banor
npm install eslint-plugin-syntax-ban -D
```## How to config
`.eslintrc.js`
使用插件所有规则:
```diff
module.exports = {
extends: [
+ 'plugin:eslint-plugin-syntax-ban/recommended'
],
+ plugins: [
+ 'syntax-ban' // 可省略 `eslint-plugin-` 前缀
+ ],
};
```或单独使用插件中的条规则:
```diff
module.exports = {
+ plugins: [
+ 'syntax-ban' // 可省略 `eslint-plugin-` 前缀
+ ],
+ rules: {
+ "syntax-ban/no-object-values": "error",
+ }
};
```