Skip to content
This repository has been archived by the owner on Oct 24, 2021. It is now read-only.

[1.4.0.1] ESLint instructions produce error with latest versions #537

Closed
rhino88 opened this issue Aug 4, 2016 · 4 comments
Closed

[1.4.0.1] ESLint instructions produce error with latest versions #537

rhino88 opened this issue Aug 4, 2016 · 4 comments

Comments

@rhino88
Copy link

rhino88 commented Aug 4, 2016

Following the Code Style documentation for setting up ESLint dependencies/configuration resulted in the following error(s):

/app-name/client/main.js
  1:1  error  'meteor' should be listed in the project's dependencies. Run 'npm i -S meteor' to add it  import/no-extraneous-dependencies
  2:1  error  'meteor' should be listed in the project's dependencies. Run 'npm i -S meteor' to add it  import/no-extraneous-dependencies

/app-name/server/main.js
  1:1  error  'meteor' should be listed in the project's dependencies. Run 'npm i -S meteor' to add it  import/no-extraneous-dependencies

The result of installing the packages recommended by the Guide and copy pasting the ESLint configurations resulted in the following package.json:

{
  "name": "app-name",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "meteor run",
    "lint": "eslint .",
    "pretest": "npm run lint --silent"
  },
  "dependencies": {
    "meteor-node-stubs": "~0.2.0"
  },
  "devDependencies": {
    "babel-eslint": "^6.1.2",
    "eslint": "^3.2.2",
    "eslint-config-airbnb": "^10.0.0",
    "eslint-import-resolver-meteor": "^0.3.1",
    "eslint-plugin-import": "^1.12.0",
    "eslint-plugin-jsx-a11y": "^2.0.1",
    "eslint-plugin-meteor": "^4.0.0",
    "eslint-plugin-react": "^6.0.0"
  },
  "eslintConfig": {
    "parser": "babel-eslint",
    "parserOptions": {
      "allowImportExportEverywhere": true
    },
    "plugins": [
      "meteor"
    ],
    "extends": [
      "airbnb",
      "plugin:meteor/recommended"
    ],
    "settings": {
      "import/resolver": "meteor"
    },
    "rules": {}
  }
}

I'm currently on node v4.4.7 and npm v3.10.5, and Meteor 1.4.0.1. Do I need to override the airbnb configuration to ignore this error?

(The suggested command in the error message does not resolve the problem)

@tmeasday
Copy link
Contributor

Hmm, it seems that the various linting packages involved here have moved forwards and things aren't quite working right. I'm not quite sure what the correct solution is (would amazing if someone could figure it out!)

In the meantime, I'd suggest sticking with the versions we are using in the todos app: https://github.com/meteor/todos/blob/master/package.json#L18-L25

@hwillson
Copy link
Contributor

This issue is being tracked here: clayne11/eslint-import-resolver-meteor/issues/11

For now your best bet is to disable the import/no-extraneous-dependencies rule:

  ...
  "eslintConfig": {
    "rules": {
      ...
      "import/no-extraneous-dependencies": 0
    }
  }

@yvan-sraka
Copy link
Contributor

I encounter the same issue, so I fix it here: #585

@filipenevola
Copy link
Collaborator

I'm closing this issue because it's too old.

We are going to make many updates to the guide in the next weeks and it's better to focus on issues with recent activity. If you think this issue is still relevant please open a new one.

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

No branches or pull requests

5 participants