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

Linter and formatter #4

Closed
jesusprubio opened this issue May 13, 2016 · 10 comments
Closed

Linter and formatter #4

jesusprubio opened this issue May 13, 2016 · 10 comments

Comments

@jesusprubio
Copy link
Contributor

jesusprubio commented May 13, 2016

What about using an style guide? I'm starting to use the AirBnb one in all my projects. This are the reasons:

  • One of the most completes.
  • ES6.
  • ESLint setup file available with checks for everything covered in the Style guide.

More options:

I really don't care about which one, but IMHO we need to use one if we keep working in this awesome project. :)

@wraithgar
Copy link

This is the eslint style plugin we use for nsp stuff https://github.com/nodesecurity/eslint-config-nodesecurity

@jesusprubio
Copy link
Contributor Author

Nice, it's almost equal the one I like :). I've changed the style of the code of my PR to respect it (#3).

If you want I can do it in the rest of the code once we merge the PR.

Thanks :)

@pdehaan
Copy link
Contributor

pdehaan commented Jun 3, 2017

I can do this after the 2 existing PRs are merged (to avoid massive collisions).
I'll probably run the current code through prettier and then add a basic ESLint setup to keep things slightly more kosher.

@pdehaan
Copy link
Contributor

pdehaan commented Jun 3, 2017

Briefly looked at this today and it was fairly painless w/ prettier CLI and ESLint's --fix flag. Only needed a bit of manual tweaking...

For my future reference, here's the configs:

{
  "extends": "nodesecurity",

  "root": true,

  "rules": {
    "hapi/hapi-scope-start": "off",

    "brace-style": "off",
    "func-style": "off",
    "no-var": "off",
    "prefer-arrow-callback": "off",
    "prefer-template": "off"
  }
}

and the package.json scripts block:

  "scripts": {
    "cont-int": "npm test && npm run lint",
    "format": "prettier '{rules/,test/,}*.js' --single-quote --write",
    "lint": "eslint .",
    "postformat": "npm run lint",
    "test": "mocha test/**/*"
  }

@pdehaan
Copy link
Contributor

pdehaan commented Jun 13, 2017

PR submitted as #20

@jesusprubio
Copy link
Contributor Author

jesusprubio commented Mar 25, 2022

Due to the recent new of moving this project to ESLint organization #71 (comment), I propose to use the linter+formatter setup used there.

@jesusprubio jesusprubio changed the title Style guide Linter and formatter Mar 25, 2022
@jesusprubio
Copy link
Contributor Author

jesusprubio commented Mar 25, 2022

Summary
This project setup lacks of a formatter. Moreover, IMHO a more common linter setup should help to get new contributions.

Still relevant?
Yes.

Next steps

  • Research about the linter+formatter setup from ESLint organization.
  • Adapt it to this project nature (if needed).
  • Make a PR with the new setup and codebase update to respect it.

@jesusprubio
Copy link
Contributor Author

jesusprubio commented Mar 25, 2022

I can resume the work in this one once we start to fix things.

@MarkKragerup
Copy link
Contributor

@jesusprubio i did this on my fork. Let me suggest a PR that implements prettier and the default eslint recommendations

MarkKragerup added a commit to MarkKragerup/eslint-plugin-security that referenced this issue Mar 28, 2022
@jesusprubio
Copy link
Contributor Author

Closing this one. Problem already solved here: #75

nzakas added a commit that referenced this issue Apr 18, 2022
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 a pull request may close this issue.

4 participants