title: eslint rule forces exponentiation operator vs Math.pow causing ALL Jest test suites to fail with SyntaxError: Unexpected token *
body: <p>I have an eslint rule rule cropping up in my code dissuading me from using Math.pow in favor of the <a href="http://2ality.com/2016/02/exponentiation-operator.html" rel="nofollow noreferrer">ES6 alternative exponentiation operator</a>. In react native I am trying to calculate the distance between touch gestures by calculating the x/y using the pythagorean theorem. The calculation requires I square the x/y of the touches in order to get the distance between the users two fingers. I first used this way:</p>
  
  <pre><code>this.pinch = Math.sqrt((Math.pow((px1 - px2), 2)) + (Math.pow((py1 - py2), 2)));
  </code></pre>
  
  <p>And I receive the eslint rule:</p>
  
  <pre><code>Math.pow is restricted from being used. Use the exponentiation operator (**) instead. (no-restricted-properties)
  </code></pre>
  
  <p>I changed the code to the following:</p>
  
  <pre><code>this.pinch = Math.sqrt(((px1 - px2) ** 2) + ((py1 - py2) ** 2));
  </code></pre>
  
  <p>and now every Jest test suite is failing with this error:</p>
  
  <pre><code>  ● Test suite failed to run
  
      /Users/egrosskurth/Documents/apps/cv-react-native/src/components/lists/dataTable/CvDataTableGrid.js:234
      _this3.pinchStart=Math.sqrt((px1-px2)**2+(py1-py2)**2);
                                            ^
      SyntaxError: Unexpected token *
  </code></pre>
  
  <p>I need to know how to transform these characters so they do not break my tests. Here is the current Jest setup I have implemented in my package,json:</p>
  
  <pre><code>"devDependencies": {
      "babel-eslint": "8.2.1",
      "babel-jest": "22.0.4",
      "babel-plugin-transform-decorators-legacy": "1.3.4",
      "babel-preset-env": "1.7.0",
      "babel-preset-react-native": "4.0.0",
      "eslint": "4.15.0",
      "eslint-config-airbnb": "16.1.0",
      "eslint-plugin-filenames": "1.2.0",
      "eslint-plugin-import": "2.8.0",
      "eslint-plugin-jsx-a11y": "6.0.3",
      "eslint-plugin-react": "7.5.1",
      "husky": "0.14.3",
      "jest": "22.0.5",
      "jest-transform-stub": "1.0.0",
      "license-checker": "20.1.0",
      "lint-staged": "6.1.0",
      "react-test-renderer": "16.3.0-alpha.2",
      "reactotron-react-native": "2.0.0",
      "rimraf": "2.6.2"
    },
    "jest": {
      "collectCoverageFrom": [
        "&lt;rootDir&gt;/src/pages/**/*.{js,jsx}",
        "!&lt;rootDir&gt;/src/pages/**/*.styles.{js,jsx}",
        "!&lt;rootDir&gt;/src/pages/sda/**",
        "&lt;rootDir&gt;/src/components/**/*.{js,jsx}",
        "!&lt;rootDir&gt;/src/**/*.styles.{js,jsx}",
        "!**/node_modules/**",
        "!**/android/**",
        "!**/ios/**"
      ],
      "transform": {
        ".+\\.(css|styl|less|sass|scss|png|jpg|gif|GIF|ttf|woff|woff2)$": "jest-transform-stub",
        "^.+\\.jsx$": "babel-jest",
        "^.+\\.js$": "babel-jest"
      },
      "preset": "react-native",
      "setupFiles": [
        "./__tests__/__mocks__/node-modules/react-native-localization_mock.js",
        "./__tests__/setupJest.js"
      ],
      "testMatch": [
        "&lt;rootDir&gt;/src/**/*.test.js",
        "&lt;rootDir&gt;/__tests__/**/*.test.js"
      ],
      "transformIgnorePatterns": [
        "node_modules/(?!mobx-react/native|react-native-view-shot)/"
      ]
    },
    "lint-staged": {
      "src/**/*.{js,json}": [
        "lint",
        "test:check",
        "git add"
      ]
    }
  </code></pre>
  
  <p>I have disabled the lint rule on that line for now as the only solution online I have found, is to install a dev dependency just for this. If someone could guide the way I would be very thankful.</p>