no-exponential-operators.js 846 B

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * @author Toru Nagashima <https://github.com/mysticatea>
  3. * See LICENSE file in root directory for full license.
  4. */
  5. "use strict"
  6. module.exports = {
  7. meta: {
  8. docs: {
  9. description: "disallow exponential operators.",
  10. category: "ES2016",
  11. recommended: false,
  12. url:
  13. "http://mysticatea.github.io/eslint-plugin-es/rules/no-exponential-operators.html",
  14. },
  15. fixable: null,
  16. schema: [],
  17. messages: {
  18. forbidden: "ES2016 exponential operators are forbidden.",
  19. },
  20. },
  21. create(context) {
  22. return {
  23. "AssignmentExpression[operator='**='], BinaryExpression[operator='**']"(
  24. node
  25. ) {
  26. context.report({ node, messageId: "forbidden" })
  27. },
  28. }
  29. },
  30. }