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

inline configuration not working for exported variables #23

Closed
ghost opened this issue Sep 10, 2015 · 4 comments
Closed

inline configuration not working for exported variables #23

ghost opened this issue Sep 10, 2015 · 4 comments

Comments

@ghost
Copy link

ghost commented Sep 10, 2015

In jshint and eslint you can configure exported variables with inline comments. in the XO linter the exported configuration that is described here: http://eslint.org/docs/rules/no-unused-vars.html doesnt seem to work. the /* globals */ configuration works fine however so it doesnt seem to be an issue of inline configurations in general.

/* exported Model */
var Model = 13;

linting it from the terminal with xo file.js thorws the error:
3:5 error "Model" is defined but never used no-unused-vars

i tried to lint the same file with the current eslint linter. that one worked fine. it threw an error without the /* exported Model */, and worked when i plugged it back in.

@sindresorhus
Copy link
Member

Seems related to eslint/eslint#3916.

@sindresorhus
Copy link
Member

Per eslint/eslint@6c04d51, this has no effect when the env is node/commonjs and when modules: true, of which, both are the case in XO. You can override this yourself, though.

@tcarlsen
Copy link

I know this issue is closed, but I can't seem to override sourceType to script I tried with parserOptions inside the xo property in package.json and in the eslintConfig. But nothing seems to work?

"xo": {
    "parserOptions": {
      "ecmaVersion": 7,
      "sourceType": "script"
    },
    "esnext": true,
    "envs": [
      "browser",
      "es6"
    ],
    "space": 2
  }

@sindresorhus
Copy link
Member

@tcarlsen Probably related: babel/babel-eslint@991ec90

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