-
Notifications
You must be signed in to change notification settings - Fork 26.8k
Add ESLint support #272
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
Add ESLint support #272
Conversation
browser: true | ||
node: true | ||
amd: true | ||
jquery: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reckon these things trigger errors, when you are trying to do var $ = require('jquery')
(fails because you are trying to re-define global $
). So I usually keep all 3rd party libs as false
even when I actually have them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we just remove the env
key entirely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can leave env with browser and node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave browser
and node
LGTM after the change to |
I've just realized (when pasted to my {
"env": {
"browser": true,
"node": true
},
"rules": {
"no-new-object": 2,
"no-reserved-keys": 2,
"no-array-constructor": 2,
"quotes": [2, "single"],
"indent": [2, 2],
"no-multi-str": 2,
"no-multi-spaces": 2,
"no-shadow-restricted-names": 2,
"dot-notation": 2,
"block-scoped-var": 2,
"vars-on-top": 2,
"no-unused-vars": 2,
"eqeqeq": 2,
"use-isnan": 2,
"no-eq-null": 2,
"brace-style": 2,
"spaced-line-comment": 2,
"valid-jsdoc": 2,
"space-infix-ops": 2,
"eol-last": 2,
"padded-blocks": [2, "never"],
"space-before-blocks": 2,
"comma-dangle": [2, "never"],
"comma-style": 2,
"semi": [2, "always"],
"semi-spacing": 2,
"no-extra-boolean-cast": 2,
"space-before-function-paren": [2, "never"],
"no-spaced-func": 2,
"no-wrap-func": 2,
"camelcase": 2,
"new-cap": 2,
"consistent-this": [1, "_this"],
"func-names": 2,
"key-spacing": 2,
"no-dupe-keys": 2,
"strict": 2,
}
} |
Missing: |
ESLint supports either YAML (via js-yaml), or JSON. Both formats produce the same result.
Added |
👏 |
ESLint is an alternative to JSHint. This is just a rough start, feel free to add more.
References: #259