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

fix: use eslint linter instead of the cli engine #34

Merged
merged 3 commits into from
Apr 24, 2019

Conversation

varl
Copy link
Contributor

@varl varl commented Apr 24, 2019

This has the primary benefit of letting this instance of ESLint run in isolation from the ESLint configuration cascade and hierarchy which can interfere with these standards.

Using only the linter and dealing with the output explicitly allows a project to have a local instance of ESLint for e.g. React 16.8 linting and cli-style for complying with DHIS2 code standards.

This has a secondary benefit of being faster. For maintenance app a full check went from 9.8 sec to 7.2 sec.

@varl varl requested a review from amcgee April 24, 2019 12:26
Copy link
Member

@amcgee amcgee left a comment

Choose a reason for hiding this comment

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

One comment but LGTM!

allowInlineConfig: true,
ignore: false,
reportUnusedDisableDirectives: false,
Copy link
Member

Choose a reason for hiding this comment

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

What's the reason for this change?

Copy link
Contributor Author

@varl varl Apr 24, 2019

Choose a reason for hiding this comment

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

The ignore prop is actually for the configuration object for CLIEngine. The configuration property ignore does not exist for Linter.verifyAndFix as it ignores "external" configuration by default.

If we have reportUnusedDisableDirectives set to true in cli-style, usages of the disable directives which are uneccessary according to the cli-style config will be reported as an error and will not pass validation until it is removed.

That might trigger errors in the project-level ESLint configuration, which would have been the reason to use the disable directives in the first place.

edited for clarity

@varl
Copy link
Contributor Author

varl commented Apr 24, 2019

That self-test you put in the Travis file is a life-saver!

@varl varl merged commit e9e9331 into master Apr 24, 2019
@varl varl deleted the chore/use-eslint-linter branch April 24, 2019 13:05
dhis2-bot pushed a commit that referenced this pull request Apr 24, 2019
## [3.1.1](v3.1.0...v3.1.1) (2019-04-24)

### Bug Fixes

* use eslint linter instead of the cli engine ([#34](#34)) ([e9e9331](e9e9331))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 3.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants