1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/packages/infrastructure/eslint-config
Janne Savolainen 699fc0309e
Introduce eslint and prettier for features and start using it (#7306)
* Introduce package for sharing eslint and prettier configurations

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Start using eslint and prettier in packages

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

---------

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2023-03-10 12:25:04 +02:00
..
bin Introduce eslint and prettier for features and start using it (#7306) 2023-03-10 12:25:04 +02:00
eslint-config.js Introduce eslint and prettier for features and start using it (#7306) 2023-03-10 12:25:04 +02:00
package.json Introduce eslint and prettier for features and start using it (#7306) 2023-03-10 12:25:04 +02:00
prettier-config.json Introduce eslint and prettier for features and start using it (#7306) 2023-03-10 12:25:04 +02:00
README.md Introduce eslint and prettier for features and start using it (#7306) 2023-03-10 12:25:04 +02:00

Lens Code Style

Note: This package contains Eslint and Prettier configurations, name of package is @k8slens/eslint-config just because Eslint has arbitrary requirement (https://eslint.org/docs/latest/extend/shareable-configs).

Usage

  1. Install @k8slens/eslint-config
  2. Create .prettierrc that contains "@k8slens/eslint-config/prettier"
  3. Add a .eslintrc.js that extends @k8slens/eslint-config/eslint, for example:
module.exports = {
  extends: "@k8slens/eslint-config/eslint",
  parserOptions: {
    project: "./tsconfig.json"
  }
};
  1. Add linting and formatting scripts to package.json
{
  "scripts": {
    "lint": "lens-lint",
    "lint:fix": "lens-lint --fix"
  }
}
  1. Run npm run lint to lint
  2. Run npm run format to fix all formatting