eslint-plugin-botland
Advanced tools
Comparing version 2.1.0 to 3.0.0
@@ -88,2 +88,4 @@ "use strict"; | ||
"botland/no-args-in-entry-point": "error", | ||
"botland/no-terminator-expression": "error", | ||
"botland/no-call-entry": "error", | ||
"botland/no-terminator-in-init": "warn", | ||
@@ -90,0 +92,0 @@ "botland/prefer-function": "warn", |
@@ -18,3 +18,5 @@ "use strict"; | ||
"no-unsupported-syntax": require("./rules/no-unsupported-syntax"), | ||
"entry-point": require("./rules/entry-point") | ||
"entry-point": require("./rules/entry-point"), | ||
"no-terminator-expression": require("./rules/no-terminator-expression"), | ||
"no-call-entry": require("./rules/no-call-entry") | ||
}, | ||
@@ -21,0 +23,0 @@ configs: { |
{ | ||
"name": "eslint-plugin-botland", | ||
"version": "2.1.0", | ||
"version": "3.0.0", | ||
"description": "Lint your botland JS scripts", | ||
@@ -8,3 +8,4 @@ "main": "index.js", | ||
"lint": "eslint index.js package.json rules/ test/ configs/ --ext js,json", | ||
"test": "nyc ava", | ||
"test:js": "nyc ava", | ||
"test": "npm run lint && npm run test:js", | ||
"coverage": "nyc report && codecov" | ||
@@ -23,10 +24,10 @@ }, | ||
"devDependencies": { | ||
"@freaktechnik/eslint-config-node": "^6.4.4", | ||
"@freaktechnik/eslint-config-test": "^6.4.4", | ||
"ava": "^0.25.0", | ||
"codecov": "^3.0.4", | ||
"eslint": "^5.4.0", | ||
"eslint-ava-rule-tester": "^2.0.2", | ||
"eslint-plugin-eslint-plugin": "^1.4.0", | ||
"nyc": "^12.0.2" | ||
"@freaktechnik/eslint-config-node": "^6.5.4", | ||
"@freaktechnik/eslint-config-test": "^6.6.0", | ||
"ava": "^1.2.1", | ||
"codecov": "^3.2.0", | ||
"eslint": "^5.14.0", | ||
"eslint-ava-rule-tester": "^3.0.0", | ||
"eslint-plugin-eslint-plugin": "^2.0.1", | ||
"nyc": "^13.3.0" | ||
}, | ||
@@ -33,0 +34,0 @@ "peerDependencies": { |
# eslint-plugin-botland | ||
[![Build Status](https://travis-ci.com/freaktechnik/eslint-plugin-botland.svg?branch=master)](https://travis-ci.com/freaktechnik/eslint-plugin-botland) | ||
[![Build Status](https://travis-ci.com/freaktechnik/eslint-plugin-botland.svg?branch=master)](https://travis-ci.com/freaktechnik/eslint-plugin-botland) [![Greenkeeper badge](https://badges.greenkeeper.io/freaktechnik/eslint-plugin-botland.svg)](https://greenkeeper.io/) | ||
@@ -8,2 +8,3 @@ Lint your [Bot Land](https://bot.land) bot scripts using eslint. | ||
## Rules | ||
- `code-length` | ||
@@ -27,2 +28,6 @@ Bot Land scripts can at most have 15000 characters | ||
Check for unsupported JS syntax features. | ||
- `no-terminator-expression` | ||
Terminators must always be a statement on their own line. | ||
- `no-call-entry` | ||
Don't manually invoke entry points. | ||
- `only-global-function-declaration` | ||
@@ -36,2 +41,3 @@ Top level code must be function declarations and function declarations must be on the top level. | ||
### Future rules to add | ||
- `arg-types` Check argument count and types for methods. Should at the very least | ||
@@ -44,2 +50,3 @@ be able to check number of args, type of literals and direction literals. | ||
## Configs | ||
- `recommended` | ||
@@ -59,4 +66,6 @@ Adds all the global functions and variables of Bot Land so eslint doesn't complain | ||
| `no-unreachable-code` | error | | ||
| `no-terminator-expression` | error | | ||
| `no-call-entry` | error | | ||
| `no-terminator-in-init` | warning | | ||
| `prefer-function` | warning | | ||
| `no-code-after-terminator` | warning | |
@@ -28,4 +28,5 @@ "use strict"; | ||
}, | ||
schema: [] | ||
schema: [], | ||
type: "problem" | ||
} | ||
}; |
@@ -45,4 +45,5 @@ "use strict"; | ||
}, | ||
schema: [] | ||
schema: [], | ||
type: "problem" | ||
} | ||
}; |
@@ -31,4 +31,5 @@ "use strict"; | ||
}, | ||
schema: [] | ||
schema: [], | ||
type: "problem" | ||
} | ||
}; |
@@ -25,4 +25,5 @@ "use strict"; | ||
arraySize: "Can only assign items to indexes between 0 and 99" | ||
} | ||
}, | ||
type: "problem" | ||
} | ||
}; |
@@ -30,4 +30,5 @@ "use strict"; | ||
unreachableCode: "Code can not be reached when terminator executes" | ||
} | ||
}, | ||
type: "suggestion" | ||
} | ||
}; |
@@ -56,4 +56,5 @@ "use strict"; | ||
}, | ||
schema: [] | ||
schema: [], | ||
type: "suggestion" | ||
} | ||
}; |
"use strict"; | ||
const api = require("../api.json"), | ||
scopeHasVariable = (scope, varname) => scope.set.has(varname) || (scope.upper && scopeHasVariable(scope.upper, varname)), | ||
walkFunction = (name, functions, calledFunctions) => { | ||
@@ -59,5 +58,6 @@ calledFunctions.add(name); | ||
meta: { | ||
description: "Check if all variables are set before usage", | ||
schema: [] | ||
description: "Check that all code is reachable", | ||
schema: [], | ||
type: "suggestion" | ||
} | ||
}; |
@@ -110,4 +110,5 @@ "use strict"; | ||
description: "Check if all variables are set before usage", | ||
schema: [] | ||
schema: [], | ||
type: "suggestion" | ||
} | ||
}; |
@@ -80,3 +80,4 @@ "use strict"; | ||
"EmptyStatement": reject, | ||
'UnaryExpression[operator="delete"]': reject | ||
'UnaryExpression[operator="delete"]': reject, | ||
"AssignmentExpression > UpdateExpression.right": reject | ||
}; | ||
@@ -89,4 +90,5 @@ }, | ||
}, | ||
schema: [] | ||
schema: [], | ||
type: "problem" | ||
} | ||
}; |
@@ -55,4 +55,5 @@ "use strict"; | ||
overwriteFunction: "Can not assign value to variable that has already been assigned a function" | ||
} | ||
}, | ||
type: "problem" | ||
} | ||
}; |
@@ -65,4 +65,5 @@ "use strict"; | ||
additionalProperties: false | ||
} ] | ||
} ], | ||
type: "suggestion" | ||
} | ||
}; |
@@ -46,4 +46,5 @@ "use strict"; | ||
arrayAccessorNumber: "Property accessor must be a number literal or variable" | ||
} | ||
}, | ||
type: "problem" | ||
} | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44632
20
1315
67