elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.47k stars 8.04k forks source link

[Usage Collection] Create rules to enforce common best-practices #90800

Open afharo opened 3 years ago

afharo commented 3 years ago

Let's create a set of rules to ensure we follow common best-practices when naming fields, structuring them, etc.

cc @thesmallestduck @alexfrancoeur to help me fill up the list.

Q: Should they error or only warn? I'd try with error first, and if there are too many, demote them to warnings. WDYT?

elasticmachine commented 3 years ago

Pinging @elastic/kibana-core (Team:Core)

Bamieh commented 3 years ago

what is the plan for handling all the changed field names?

I have some rules in mind:

afharo commented 3 years ago

@Bamieh, thank you for the additional entries, I've added them to the description.

Do you think it's worth separating between errors and warnings?

what is the plan for handling all the changed field names?

I was hoping we could implement most of them with eslint-rules, so, ultimately, devs already reporting fields that do not match these rules can disable it for "legacy" purposes. What do you think?

Bamieh commented 3 years ago

Do you think it's worth separating between errors and warnings?

I suggest throwing errors if we will be only affecing new changes. I believe using warnings will clutter the logs quickly making it useless noise.

I was hoping we could implement most of them with eslint-rules,

Sounds good!