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

cannot use with @neutrino/react #1

Closed
sep2 opened this issue Nov 30, 2019 · 4 comments
Closed

cannot use with @neutrino/react #1

sep2 opened this issue Nov 30, 2019 · 4 comments

Comments

@sep2
Copy link

sep2 commented Nov 30, 2019

I followed the setup with a react project with the latest v9 and neutrino complained that @babel/plugin-proposal-class-properties is duplicated.

const standard = require('@neutrinojs/standardjs');
const react = require('@neutrinojs/react');
const jest = require('@neutrinojs/jest');
const typescript = require('neutrino-typescript');
const typescriptLint = require('neutrino-typescript-eslint');

module.exports = {
  options: {
    root: __dirname,
  },
  use: [
    typescript(),
    typescriptLint(),
    standard(),
    react({
      html: {
        title: 'test'
      }
    }),
    jest(),
  ],
};
{
  "name": "test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "jest",
    "start": "webpack-dev-server --mode development --open",
    "build": "webpack --mode production",
    "lint": "eslint --cache --format codeframe --ext mjs,jsx,js,ts,tsx src test && tsc",
    "lint:fix": "yarn lint --fix"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "prop-types": "^15.7.2",
    "react": "^16.12.0",
    "react-dom": "^16.12.0",
    "react-hot-loader": "^4.12.18"
  },
  "devDependencies": {
    "@neutrinojs/eslint": "^8.3.0",
    "@neutrinojs/jest": "^9.0.0-rc.5",
    "@neutrinojs/react": "^9.0.0-rc.5",
    "@neutrinojs/standardjs": "^9.0.0-rc.5",
    "@types/react": "^16.9.13",
    "@types/react-dom": "^16.9.4",
    "eslint": "^6.7.1",
    "jest": "^24.9.0",
    "neutrino": "^9.0.0-rc.5",
    "neutrino-typescript": "git+https://github.com/davidje13/neutrino-typescript#semver:^1.0.8",
    "neutrino-typescript-eslint": "git+https://github.com/davidje13/neutrino-typescript-eslint#semver:^1.0.3",
    "typescript": "^3.7.2",
    "webpack": "^4.41.2",
    "webpack-cli": "^3.3.10",
    "webpack-dev-server": "^3.9.0"
  }
}
@davidje13
Copy link
Owner

Hmm, it's supposed to guard against exactly this problem, so I'm not sure what's going on here. I'm using it with the react preset myself in one of my projects without any issues.

I'll make a minimum reproduction from the code you posted and see what I can find. Thanks for reporting!

@davidje13
Copy link
Owner

Ah; one thing I notice: you're using @neutrinojs/eslint@8.3.0, but everything else is 9.0.0-rc.5. I think this project will work with 8 and 9 (although only tested on 9), but mixing the two is likely to cause problems. Can you try using consistent versions and see if it fixes your problem?

@davidje13
Copy link
Owner

I have created an example project which shows how to use this with React in a simple application with tests and linting: https://github.com/davidje13/neutrino-typescript-react-example

It seems to be fine, so I'm guessing your issue is due to the version mismatch I mentioned before. Can you confirm?

@sep2
Copy link
Author

sep2 commented Dec 3, 2019

Thanks very much for the sample project, it works! I was just using the command

npx @neutrinojs/create-project@next test

to scaffold the project, and did not notice that @neutrinojs/eslint was not the latest version.

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

2 participants