Created
          June 14, 2018 17:45 
        
      - 
      
- 
        Save remy/17a9779a8ff2a3dd67a8f24e162de14a to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | module.exports = { | |
| env: { browser: true, es6: true, commonjs: true }, | |
| extends: ['eslint:recommended', 'plugin:compat/recommended'], | |
| parser: 'babel-eslint', | |
| parserOptions: { | |
| ecmaFeatures: { experimentalObjectRestSpread: true, jsx: true }, | |
| sourceType: 'module', | |
| }, | |
| plugins: ['react'], | |
| rules: { | |
| 'react/prop-types': 0, | |
| 'react/jsx-uses-vars': [2], | |
| }, | |
| }; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | export default string => { | |
| if (!string.startsWith('http')) { | |
| // expecting error - but none | |
| return false; | |
| } | |
| const url = new URL(string); | |
| return Array.from(url.searchParams.entries()).reduce((acc, [key, value]) => { | |
| acc[key] = value; | |
| return acc; | |
| }, {}); | |
| }; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | { | |
| "name": "compat-test", | |
| "version": "1.0.0", | |
| "description": "", | |
| "main": "index.js", | |
| "scripts": { | |
| "test": "echo \"Error: no test specified\" && exit 1" | |
| }, | |
| "keywords": [], | |
| "author": "", | |
| "license": "ISC", | |
| "devDependencies": { | |
| "babel-eslint": "^8.2.3", | |
| "eslint": "^4.19.1", | |
| "eslint-plugin-compat": "^2.4.0", | |
| "eslint-plugin-react": "^7.9.1" | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment