1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/packages/infrastructure/eslint-config
Gabriel d28da8e7ac chore: update package version
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-05-30 23:02:45 +02:00
..
bin Switch to using messaging and startable stoppable from NPM package (#7368) 2023-03-21 11:38:43 +02:00
CHANGELOG.md Release 6.5.0 2023-05-26 14:00:45 -04:00
eslint-config.js chore: update package version 2023-05-30 23:02:45 +02:00
package.json Release 6.5.0 2023-05-26 14:00:45 -04:00
prettier-config.json Persist apiVersion when editing resources in monaco (#4406) 2023-04-05 10:56:23 -04: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