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

Centralize and simplify ESLint config #62

Closed
geoffrich opened this issue Feb 12, 2021 · 5 comments · Fixed by #100
Closed

Centralize and simplify ESLint config #62

geoffrich opened this issue Feb 12, 2021 · 5 comments · Fixed by #100
Assignees
Labels
Type: Feature New Feature

Comments

@geoffrich
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Our ESLint config has way too many rules (200+ lines of rules in addition to the recommended config), including multiple deprecated rules and rules that are already off by default explicitly turned off. In addition, it's easy for the config to get out of sync between projects and when changes are made in one component's config they aren't made in the other component packages.

Describe the solution you'd like

We should put our ESLint config into it's own repo + package (eslint-config-auro?), so that changes can be made in one place and components simply have to extend the config and update to the latest package to get the changes.

This will also allow devs to open PRs/issues on the repo if they want to propose code style changes.

Describe alternatives you've considered

Extend someone else's config and don't maintain this ourselves. We'll probably want to make tweaks to it though, in which case we're back to the problem of making the same ESLint changes across 20 (and counting) components.

Additional context

Motivated by #61, a change we'll want to make across every component. Putting our ESLint config into a package should make this easier.

@blackfalcon
Copy link
Member

I have considered exactly this. The question discussed at that time was to create a supporting lib much like WCSS. That way users can pull in this lib and pick-and-choose what additional 'directives' they want to use.

This issue brings up a concern for a code dependency during development.

For this specific issue, I have looked at using https://eslint.org/docs/developer-guide/shareable-configs in the past.

Extend someone else's config and don't maintain this ourselves.

This one I looked into as well, but the use of esLint across the floor was amazing low and no one had good recommendations to start from. Doing a quick search, there are a few recommendation projects out there, but they are really out of date.

@blackfalcon
Copy link
Member

@geoffrich

Defining our own esLint is a very large task. Others like Google or AirBnB have done amazing work to define these rules. Is there a current style guide that we want to adopt?

I feel that it will be impossible to create our own style guide until we draw a line in the sand and define a starting point. Currently, that starting point is the basic install of esLint.

My vote is for using eslint-config-airbnb-base and starting there?

And using this, does that then negate the need to store our config in the cloud?

@geoffrich
Copy link
Contributor Author

geoffrich commented Mar 8, 2021

Using someone else's config as a base makes sense, since creating a style guide is a lot of work.

I think it would still be good to store our config in a package/repo. That way there's one place to make updates. We'll likely want to override some settings and add stuff like lit-element linting.

Unless we could have the config live in the generator and have it updated with the work done for #68?

@blackfalcon
Copy link
Member

blackfalcon commented Mar 8, 2021

So the scenario is this.

  1. Support something like AirBnb config where the config is in a versioned npm
  2. If there are customizations that differ from the AirBnb config, then we need a cloud solution to ensure that all repos are up to standard without manual updates

I think for No.2 we need to go with the sharable config idea above so that updates can be pushed to each repo without having to manually update anything.

@blackfalcon
Copy link
Member

See https://github.com/AlaskaAirlines/auro-eslint-config to support this update.

AuroDesignSystem pushed a commit that referenced this issue May 17, 2021
# [3.0.0](v2.11.0...v3.0.0) (2021-05-17)

### Bug Fixes

* **husky:** update husky script to reference correct linters script ([a469915](a469915))

### Features

* **dart-sass:** update to dart-sass from node-sass [#111](#111) ([f6aa3fe](f6aa3fe))
* **generator init api:** update generator to use a single name input [#93](#93) ([d90e5d4](d90e5d4))
* **v3.0:** add remote eslint support [#62](#62) ([d5df429](d5df429))
* **v3.0:** update default npm namespace to [@AuroDesignSystem](https://github.com/aurodesignsystem) ([fc6f24e](fc6f24e))
* **v3.0:** update stylelintrc for extended support [#83](#83) ([c63c572](c63c572))
* **v3.0:** update to support fixed attr by default [#108](#108) ([69e06c6](69e06c6))

### BREAKING CHANGES

* **generator init api:** This update changes the generator
execution command. Removes supoprt for namespace argument
and instead uses single namespace-name argument.
* **v3.0:** This update will require that direct dependencies using the namespace
will need to be updated prior to release. This update will redirect all new packages to
be published in the new @AuroDesignSystem namespace.
jason-capsule42 pushed a commit that referenced this issue May 20, 2021
# [3.0.0](v2.11.0...v3.0.0) (2021-05-17)

### Bug Fixes

* **husky:** update husky script to reference correct linters script ([a469915](a469915))

### Features

* **dart-sass:** update to dart-sass from node-sass [#111](#111) ([f6aa3fe](f6aa3fe))
* **generator init api:** update generator to use a single name input [#93](#93) ([d90e5d4](d90e5d4))
* **v3.0:** add remote eslint support [#62](#62) ([d5df429](d5df429))
* **v3.0:** update default npm namespace to [@AuroDesignSystem](https://github.com/aurodesignsystem) ([fc6f24e](fc6f24e))
* **v3.0:** update stylelintrc for extended support [#83](#83) ([c63c572](c63c572))
* **v3.0:** update to support fixed attr by default [#108](#108) ([69e06c6](69e06c6))

### BREAKING CHANGES

* **generator init api:** This update changes the generator
execution command. Removes supoprt for namespace argument
and instead uses single namespace-name argument.
* **v3.0:** This update will require that direct dependencies using the namespace
will need to be updated prior to release. This update will redirect all new packages to
be published in the new @AuroDesignSystem namespace.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New Feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants