Skip to content

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

Merged
merged 3 commits into from
Apr 8, 2015
Merged

Add ESLint support #272

merged 3 commits into from
Apr 8, 2015

Conversation

RobLoach
Copy link
Contributor

@RobLoach RobLoach commented Apr 1, 2015

ESLint is an alternative to JSHint. This is just a rough start, feel free to add more.

References: #259

browser: true
node: true
amd: true
jquery: true
Copy link

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.

Copy link
Contributor Author

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?

Copy link
Collaborator

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.

Copy link
Member

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

@hshoff
Copy link
Member

hshoff commented Apr 2, 2015

LGTM after the change to env. Thanks for this @RobLoach!

@nkbt
Copy link

nkbt commented Apr 5, 2015

I've just realized (when pasted to my .eslintrc), that this is some funky non-json format. I would expect it to be something like this instead:

{
  "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,
  }
}

@nkbt
Copy link

nkbt commented Apr 5, 2015

Missing:
"one-var": [2, "never"],

@RobLoach
Copy link
Contributor Author

RobLoach commented Apr 6, 2015

I've just realized (when pasted to my .eslintrc), that this is some funky non-json format. I would expect it to be something like this instead:

ESLint supports either YAML (via js-yaml), or JSON. Both formats produce the same result.

Missing:
"one-var": [2, "never"],

Added one-var in there, thanks for the note 👍 .

@hshoff
Copy link
Member

hshoff commented Apr 8, 2015

👏

hshoff added a commit that referenced this pull request Apr 8, 2015
@hshoff hshoff merged commit b893ce0 into airbnb:master Apr 8, 2015
@RobLoach RobLoach deleted the eslint branch April 22, 2015 14:55
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

Successfully merging this pull request may close these issues.

4 participants