@lsby/eslint-plugin 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -2,5 +2,6 @@ module.exports = {
2
2
  rules: {
3
3
  'no-broken-link': require('./lib/rules/no-broken-link'),
4
4
  'prefer-let': require('./lib/rules/prefer-let'),
5
+ 'no-negation': require('./lib/rules/no-negation'),
5
6
  },
6
7
  }
@@ -0,0 +1,14 @@
1
+ module.exports = {
2
+ create(context) {
3
+ return {
4
+ UnaryExpression(node) {
5
+ if (node.operator === '!') {
6
+ context.report({
7
+ node,
8
+ message: "禁止使用 '!' 运算符, 写出更明确的判断条件会减少可能的问题, 如果存在重用逻辑就封装函数.",
9
+ })
10
+ }
11
+ },
12
+ }
13
+ },
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lsby/eslint-plugin",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "pub:public": "bumpp && npm publish --access public",