Proposal to replace Clang Format with ESLint and Prettier in phosphor-webui
Derick
derick.montague at gmail.com
Fri Jun 7 12:37:03 AEST 2019
Hello,
I propose we replace Clang Format in the phosphor-webui with an ESLint
and Prettier configuration. Clang format handles formatting reasonably
well, but it doesn't offer the ability to help identify potential
errors.
We can run ESLint and Prettier from the command-line and integrate
them into our editors. I have included links to the documentation for
the resources and would like to continue the conversation in the
Gerrit (https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-webui/+/22366).
My initial goal was to use the Angular 1 Style Guide's shared eslint
and the ESLint recommended configurations. However, those options
require a considerable amount of effort to update and regression test
to be compliant. For now, I have added a few Angular and ESLint rules
to the configuration that are categorized either as possible errors or
best practices. If we decide the AngularJS community's suggested best
practices will improve our code base, we can develop a plan to
implement those changes in a phased approach.
- ESLint: https://eslint.org/
- Prettier: https://prettier.io/
- ESLlint Angular Plugin: https://www.npmjs.com/package/eslint-plugin-angular
- Angular 1 Style Guide:
https://github.com/johnpapa/angular-styleguide/tree/master/a1
- Gerrit Review:
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-webui/+/22366
More information about the openbmc
mailing list