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

[eslint] merge custom rules into a single plugin #33733

Merged
merged 5 commits into from
Mar 23, 2019

Conversation

spalger
Copy link
Contributor

@spalger spalger commented Mar 22, 2019

I'd like to add another custom eslint rule, but there isn't a very good place to do that right now. We have the eslint-plugin-kibana-custom package, which is super simple but isn't in the @kbn namespace and isn't included in the root eslint config, and @kbn/eslint-plugin-license-header is too specific, so I've merged those two packages into @kbn/eslint-plugin-eslint, which is a little redundant but allows is to refer to the rules within it as @kbn/eslint/{rule}, which feels nice.

Thoughts?

NOTE: merging the eslint rules from the two packages means enabling prettier for the code from @kbn/eslint-plugin-license-header, all those changes are made in 42c7da6. View the changes without the prettier updates

@spalger spalger requested a review from a team as a code owner March 22, 2019 20:07
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations

@elasticmachine

This comment has been minimized.

@@ -21,5 +21,6 @@ module.exports = {
rules: {
'require-license-header': require('./rules/require_license_header'),
'disallow-license-headers': require('./rules/disallow_license_headers'),
'no-default-export': require('./rules/no_default_export'),
Copy link
Contributor

@mshustov mshustov Mar 22, 2019

Choose a reason for hiding this comment

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

overall +1 from me for the PR, because today I spent some time trying to add another custom rule while porting #33562

just curious - why we use custom no_default_export rule instead of https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-default-export.md ?
our doesn't handle export { foo as default }; for example

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably because it didn't exist at the time, but I'm not sure. I'd love to review a PR that moves to the rule from eslint-plugin-import!

Copy link
Contributor

Choose a reason for hiding this comment

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

ok 👍

spalger pushed a commit to spalger/kibana that referenced this pull request Mar 22, 2019
…3739)

The fixtures used by reporting's `extract()` tests have tripped me and others up several times because from the outside they look and behave like source files, but require updating archive fixtures whenever the source is touched. The source of this file is irrelevant though, since the tests are just making sure that the extraction is accurate.

This PR updates the fixture to a markdown file with Lorem Ipsum in it, so it won't look relevant to people making broad strokes changes to files like elastic#33733
spalger pushed a commit that referenced this pull request Mar 22, 2019
The fixtures used by reporting's `extract()` tests have tripped me and others up several times because from the outside they look and behave like source files, but require updating archive fixtures whenever the source is touched. The source of this file is irrelevant though, since the tests are just making sure that the extraction is accurate.

This PR updates the fixture to a markdown file with Lorem Ipsum in it, so it won't look relevant to people making broad strokes changes to files like #33733
spalger pushed a commit to spalger/kibana that referenced this pull request Mar 22, 2019
…3739)

The fixtures used by reporting's `extract()` tests have tripped me and others up several times because from the outside they look and behave like source files, but require updating archive fixtures whenever the source is touched. The source of this file is irrelevant though, since the tests are just making sure that the extraction is accurate.

This PR updates the fixture to a markdown file with Lorem Ipsum in it, so it won't look relevant to people making broad strokes changes to files like elastic#33733
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@spalger spalger merged commit 96206bd into elastic:master Mar 23, 2019
spalger pushed a commit to spalger/kibana that referenced this pull request Mar 23, 2019
I'd like to add another custom eslint rule, but there isn't a very good place to do that right now. We have the `eslint-plugin-kibana-custom` package, which is super simple but isn't in the `@kbn` namespace and isn't included in the root eslint config, and `@kbn/eslint-plugin-license-header` is too specific, so I've merged those two packages into `@kbn/eslint-plugin-eslint`, which is a little redundant but allows is to refer to the rules within it as `@kbn/eslint/{rule}`, which feels nice.

Thoughts?

_**NOTE:**_ merging the eslint rules from the two packages means enabling prettier for the code from `@kbn/eslint-plugin-license-header`, all those changes are made in elastic@42c7da6. [View the changes without the prettier updates](elastic/kibana@b647f2b...74e07a0)
spalger pushed a commit to spalger/kibana that referenced this pull request Mar 23, 2019
I'd like to add another custom eslint rule, but there isn't a very good place to do that right now. We have the `eslint-plugin-kibana-custom` package, which is super simple but isn't in the `@kbn` namespace and isn't included in the root eslint config, and `@kbn/eslint-plugin-license-header` is too specific, so I've merged those two packages into `@kbn/eslint-plugin-eslint`, which is a little redundant but allows is to refer to the rules within it as `@kbn/eslint/{rule}`, which feels nice.

Thoughts?

_**NOTE:**_ merging the eslint rules from the two packages means enabling prettier for the code from `@kbn/eslint-plugin-license-header`, all those changes are made in elastic@42c7da6. [View the changes without the prettier updates](elastic/kibana@b647f2b...74e07a0)
spalger pushed a commit that referenced this pull request Mar 23, 2019
Backports the following commits to 7.x:
 - [eslint] merge custom rules into a single plugin  (#33733)
spalger pushed a commit that referenced this pull request Mar 23, 2019
Backports the following commits to 7.0:
 - [eslint] merge custom rules into a single plugin  (#33733)
@spalger
Copy link
Contributor Author

spalger commented Mar 23, 2019

7.x/7.1: f09e17e
7.0: 56352b2

@spalger spalger deleted the refactor/eslint-plugins branch March 23, 2019 01:54
joelgriffith pushed a commit that referenced this pull request Mar 27, 2019
The fixtures used by reporting's `extract()` tests have tripped me and others up several times because from the outside they look and behave like source files, but require updating archive fixtures whenever the source is touched. The source of this file is irrelevant though, since the tests are just making sure that the extraction is accurate.

This PR updates the fixture to a markdown file with Lorem Ipsum in it, so it won't look relevant to people making broad strokes changes to files like #33733
joelgriffith pushed a commit that referenced this pull request Mar 27, 2019
I'd like to add another custom eslint rule, but there isn't a very good place to do that right now. We have the `eslint-plugin-kibana-custom` package, which is super simple but isn't in the `@kbn` namespace and isn't included in the root eslint config, and `@kbn/eslint-plugin-license-header` is too specific, so I've merged those two packages into `@kbn/eslint-plugin-eslint`, which is a little redundant but allows is to refer to the rules within it as `@kbn/eslint/{rule}`, which feels nice.

Thoughts?

_**NOTE:**_ merging the eslint rules from the two packages means enabling prettier for the code from `@kbn/eslint-plugin-license-header`, all those changes are made in 42c7da6. [View the changes without the prettier updates](b647f2b...74e07a0)
@spalger spalger added the release_note:skip Skip the PR/issue when compiling release notes label Apr 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes review Team:Operations Team label for Operations Team v7.0.0 v7.2.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants