Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup xo and react #22

Closed
artivilla opened this issue Dec 27, 2018 · 2 comments
Closed

setup xo and react #22

artivilla opened this issue Dec 27, 2018 · 2 comments

Comments

@artivilla
Copy link

Using the following config but xo doesn't play nicely with react closing syntax:
I'm guessing I don't require an .eslint config to make this work:

{
  "name": "react-starter",
  "version": "1.0.0",
  "description": "Highly opinionated starter web application for react client side projects",
  "main": "index.js",
  "scripts": {
    "start": "parcel index.html -p 4444",
    "build": "parcel build index.html",
    "test": "jest --coverage",
    "report": "npx opn coverage/lcov-report/index.html",
    "test:debug": "node --inspect-brk ./node_modules/jest/bin/jest",
    "lint": "xo src/",
    "format": "prettier \"**/*.+(js|jsx|css|less|scss|md|graphql|mdx)\" --write",
    "validate": "npm run test && npm run flow",
    "flow": "flow src/"
  },
  "xo": {
    "prettier": true,
    "extends": "xo-react"
  },
  "dependencies": {
    "react": "16.7.0-alpha.2",
    "react-dom": "16.7.0-alpha.2",
    "react-test-renderer": "^16.7.0-alpha.2"
  },
  "devDependencies": {
    "@babel/core": "^7.2.2",
    "@babel/plugin-proposal-class-properties": "^7.2.3",
    "@babel/plugin-syntax-dynamic-import": "^7.2.0",
    "@babel/preset-env": "^7.2.3",
    "@babel/preset-flow": "^7.0.0",
    "@babel/preset-react": "^7.0.0",
    "babel-core": "^7.0.0-bridge.0",
    "babel-eslint": "^10.0.1",
    "babel-jest": "^23.6.0",
    "babel-preset-env": "^1.7.0",
    "babel-preset-flow": "^6.23.0",
    "babel-preset-react": "^6.24.1",
    "eslint-config-xo": "^0.25.1",
    "eslint-config-xo-react": "^0.17.0",
    "eslint-plugin-react": "^7.11.1",
    "prettier": "^1.15.3",
    "xo": "^0.23.0"
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged && npm run flow"
    }
  }
}

npx xo src/

  src/index.js:6:26
  ✖  6:26  Parsing error: Unexpected token /

  src/Components/Counter.js:6:9
  ✖  6:9   Parsing error: Unexpected token .

  src/__tests__/Counter.js:6:42
  ✖  6:42  Parsing error: Unexpected token /
@aszecsei
Copy link

I also have this issue.

@sholladay
Copy link

I suspect that you might be encountering this ESLint bug: eslint/eslint#11018

They claim that it's a problem in npm and that the npm team plans to fix it sometime in 2019. It's bizarre. I had to workaround it in my app for now (see the discussion there).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants