Closed ckib16 closed 8 years ago
In your package.json
, add $
to your globals array.
{
"name": "Example",
"version": "1.0.0",
"description": "Example package.json",
"standard": {
"globals": [
"$"
]
}
}
@shaungrady is absolutely correct :smiley:
Thanks guys, much appreciated. I will investigate the whole package.json thing. Take care.
Hey all,
Quick follow up question - I'm still getting multiple '$' is undefined
errors even after modifying my ~/.atom/packages/linter-js-standard/package.json
file as described above.
Here is my package.json:
...
"devDependencies": {
"standard": "^5.2.1"
},
"standard": {
"globals": [
"atom",
"$"
]
},
"package-deps": [
"linter"
],
...
The atom
line was already inside the globals
array, so I didn't want to mess with it. I just added in "$"
below it. I also tried:
/* global $ */
to each file. This still works as advertised, but very cumbersome!Any ideas? Syntax error in my package.json file?
You shouldn't be modifying the package.json
of the Atom package. You should adding/modifying rules in the package.json
associated with whatever project you're working on. E.g., ~/My Repositories/my-project/package.json
Ah...
Ok, I'm trying to use it to lint JS inside of a Rails app, so I don't have a package.json. I'll have to experiment to see if there's a way to integrate it into Rails.
Any tips appreciated if someone has done this before. Thanks for the help,
package.json
is for configuring npm
, it doesn't directly relate to ESLint. For your Rails app, simply create a .eslintrc.js
file at the root of your project. See the ESLint docs for more information: http://eslint.org/docs/user-guide/configuring#configuration-file-formats
Wow, thanks @shaungrady . I would never have found that. I'll take it from here, much appreciated!
No problem, happy coding
I'm having the same problem as @ckib16, and I'm not sure what to put into .eslintrc.js
to make it work.
Hey all - noob questions that I couldn't find an answer for.
1) I'm getting multiple
"$" is undefined
errors from the linter when entering standard JQuery code. Do I have to add$
to the "ignored list", or is there better integration with JQuery that I'm missing to avoid these errors?2) I found out how to stop the errors in each file with
/* global $ */
. But how do I find the filepackage.json
to ignore$
permanently? And is permanently ignoring$
a wise move?Thanks, Chris