-
Notifications
You must be signed in to change notification settings - Fork 3
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
Update JS testing with ESLint #32
base: master
Are you sure you want to change the base?
Conversation
|
||
## jshint | ||
We integrate `ESLint` into our workflow as a step in continuous integration—typically, when any commit is pushed to a feature branch. This means that we catch syntax errors early, but are not stymied during local development as we introduce new code and troubleshoot. For an example of what this looks like, see the Gatsby app cookiecutter template. Notable files: |
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 don't think I've ever set up ESLint in a Django project. Which is not great! Have you, @hancush? It would be good to link to a Django setup here as well.
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 have not! Sounds like a good addition to our Django project template. Opened datamade/how-to#115.
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.
Although it was never fully adopted, I liked that our fork of the Node style guide included discussion of why we preferred certain syntax. https://github.com/datamade/node-style-guide
Is there a similar document or discussion of the ESLint rules we're applying? It's not something I require to bring in these changes, but it would be good to include, if it exists!
|
||
## jshint | ||
We integrate `ESLint` into our workflow as a step in continuous integration—typically, when any commit is pushed to a feature branch. This means that we catch syntax errors early, but are not stymied during local development as we introduce new code and troubleshoot. For an example of what this looks like, see the Gatsby app cookiecutter template. Notable files: |
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 have not! Sounds like a good addition to our Django project template. Opened datamade/how-to#115.
|
||
## jshint | ||
We integrate `ESLint` into our workflow as a step in continuous integration—typically, when any commit is pushed to a feature branch. This means that we catch syntax errors early, but are not stymied during local development as we introduce new code and troubleshoot. For an example of what this looks like, see the Gatsby app cookiecutter template. Notable files: |
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.
How about a link to the template here?
An impeccable style guide, however, does not prevent human error. Every coder has at least one horror story about an hours-long hunt for a missing semicolon that caused the (sometimes silent) crash of an entire program. | ||
- `package.json`: This setup requires installation of the package `eslint-config-react-app`. This is also where you can define the `yarn test` command used in `test.yml` | ||
- `.eslintrc.js`: This file defines the syntax rules ESLint will follow. It's based on the `react-app` defaults, with minor modifications. | ||
- `.github/workflows/test.yml`: This Âworkflow instructs Github to run the ESLint tests on every push. |
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.
- `.github/workflows/test.yml`: This Âworkflow instructs Github to run the ESLint tests on every push. | |
- `.github/workflows/test.yml`: This workflow instructs Github to run the ESLint tests on every push. |
|
||
An impeccable style guide, however, does not prevent human error. Every coder has at least one horror story about an hours-long hunt for a missing semicolon that caused the (sometimes silent) crash of an entire program. | ||
- `package.json`: This setup requires installation of the package `eslint-config-react-app`. This is also where you can define the `yarn test` command used in `test.yml` | ||
- `.eslintrc.js`: This file defines the syntax rules ESLint will follow. It's based on the `react-app` defaults, with minor modifications. |
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.
What modifications?
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.
If this differs from our style guide here https://github.com/datamade/node-style-guide, we ought to deprecate it, as well. (Never really got team buy in, so I think we can either delete or archive our fork.)
P.s., this looks awesome, @beamalsky! Thank you for helping to keep this documentation inline with our R&D. ❤️ Let me know if there's anything I can do to pitch in. |
This updates our JS linter instructions to match the new Gatsby template currently in progress here: datamade/how-to#85
This PR needs updated links to the
how-to
repo before it can be merged.