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

Add ESLint to project #367

Merged
merged 7 commits into from
Nov 12, 2020
Merged

Add ESLint to project #367

merged 7 commits into from
Nov 12, 2020

Conversation

gnikonorov
Copy link
Member

Add ESLint for JS linting.

This better sets us up to tackle #350, and should be added in as a best practice regardless.

The .eslintrc.json file was auto-generated by ESLint.

@gnikonorov gnikonorov added skip-changelog Can be missed from the changelog. Infrastructure Changes related to project infrastructure ( CI/CD, deploy mechanism, etc. ) labels Nov 11, 2020
@gnikonorov gnikonorov self-assigned this Nov 11, 2020
@gnikonorov
Copy link
Member Author

Note the grunt task is not actually run anymore. It's only showing because I didn't rename the action in my initial PR. It's an issue with GitHub actions and not the change

Copy link
Member

@ssbarnea ssbarnea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You missed the most important bit: adding eslint to .pre-commit-config.yaml so it runs during linting.

If you do this you do not need to alter any github actions.

Copy link
Contributor

@BeyondEvil BeyondEvil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost every var can be changed to const.

Add this rule: https://eslint.org/docs/rules/prefer-const

And it should help you out.

pytest_html/resources/main.js Outdated Show resolved Hide resolved
pytest_html/resources/main.js Outdated Show resolved Hide resolved
@gnikonorov
Copy link
Member Author

Almost every var can be changed to const.

Add this rule: https://eslint.org/docs/rules/prefer-const

And it should help you out.

Let me take some time today and read over the rule list to see what else we may want to add

@gnikonorov
Copy link
Member Author

You missed the most important bit: adding eslint to .pre-commit-config.yaml so it runs during linting.

If you do this you do not need to alter any github actions.

Good point @ssbarnea, thank you for pointing this out. I've updated the PR accordingly

@gnikonorov
Copy link
Member Author

@BeyondEvil @ssbarnea I've gone through the rule list and added every rule I thought made sense that didn't involve sweeping changes ( I'd feel safer adding those in a follow up PR to avoid breaking things ) except for the following sections:

From the rest of the rule list, I intentionally skipped the following rules since they involved making a refactor, which I want to address in a follow up PR to decrease the size of this one:

If we are happy with this PR, I'd like to raise the above as separate issues after this merges so we don't forget about them and add them in time permitting.

Copy link
Contributor

@BeyondEvil BeyondEvil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🎉

But let's wait for @ssbarnea before merging.

@ssbarnea ssbarnea added test This PR relates to tests, QA, CI. and removed Infrastructure Changes related to project infrastructure ( CI/CD, deploy mechanism, etc. ) skip-changelog Can be missed from the changelog. labels Nov 12, 2020
@ssbarnea ssbarnea merged commit 0e2c045 into pytest-dev:master Nov 12, 2020
@gnikonorov gnikonorov mentioned this pull request Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test This PR relates to tests, QA, CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants