Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript

Ari Misha
Ari Misha
19,274 Points

Issues with jshint, babel and react-router

Hiya there! So im working on this project with React and Redux. And im finished like 70% with this project. And now all of sudden, my console throwing these errors saying import and module.exports is only available in esversion6. Also, my console keeps saying IndexRoute, Link, Router, browserHistory etc. modules arent present in react-router. Can someone help me with this issue. Thank you! (:

....../src/index.js

import React from "react";
import { render } from "react-dom";
import { Provider } from "react-redux";
import { Router, browserHistory } from "react-router";
import routes from "./routes";


import configureStore from "./store/configureStore";

const store = configureStore ();

render (
    <Provider store={ store }>
        <Router routes={routes} history={browserHistory} />
    </Provider>,
    document.getElementById ("root")
);

This is my package.json file:

{
  "name": "book-store-app",
  "version": "1.0.0",
  "description": "A simple about a Book Store and a cart",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "webpack -p",
    "serve": "./node_modules/.bin/webpack-dev-server --inline --port 3000 --content-base ./public"
  },
  "keywords": [
    "react",
    "redux",
    "webpack",
    "book-store"
  ],
  "author": "Ari Misha",
  "license": "ISC",
  "devDependencies": {
    "babel-core": "^6.26.0",
    "babel-loader": "^7.1.2",
    "babel-preset-es2017": "^6.24.1",
    "babel-preset-react": "^6.24.1",
    "bootstrap": "^3.3.7",
    "eslint": "^4.8.0",
    "eslint-config-airbnb": "^16.0.0",
    "eslint-loader": "^1.9.0",
    "eslint-plugin-import": "^2.7.0",
    "eslint-plugin-jsx-a11y": "^6.0.2",
    "eslint-plugin-react": "^7.4.0",
    "webpack": "^3.7.1",
    "webpack-dev-server": "^2.9.1"
  },
  "dependencies": {
    "prop-types": "^15.6.0",
    "react": "^16.0.0",
    "react-dom": "^16.0.0",
    "react-redux": "^5.0.6",
    "react-router": "^4.2.0",
    "redux": "^3.7.2"
  }
}

And this is my .eslintrc.json file:

{
    "parserOptions": {
        "ecmaversion": 7,
        "sourceType": "module",
        "ecmaFeatures": {
            "jsx": true
        }
    },
    "env": {
        "browser": true,
        "node": true
    }, 
    "rules": {
        "eqeqeq": 0,
        "curly": 2,
        "quotes": [2, "double"]
    }
}