Skip to content

Enable code linter in juggler monorepo #1741

@bajtos

Description

@bajtos

_This story requires the new monorepo to be created first, see #1725, and also Prettier to be already configured, see #1740.

Start linting code using eslint. If we decide to migrate to TypeScript before this story is done, then use tslint instead of eslint, or whatever approach is used by loopback-next at that time.

Caveat: eslint-config-loopback contains rules that are duplicating Prettier formatting. Ideally, we should modify eslint-config-loopback to be fully compatible with prettier. Alternatively, we can disable formatting-related rules in .eslintrc of our new monorepo.

Acceptance criteria

The changes should be split to (at least) the following two commits:

Setup eslint infrastructure

  • Add .eslintrc, see the version imported from loopback-datasource-juggler for inspiration.
  • Remove .eslintrc files in individual packages (juggler, filters, etc.)
  • Add eslint to both npm run lint and npm run lint:fix. Use .gitignore as the file to configure list of source code files to ignore (see how linting was setup in original juggler). Important: run eslint first, prettier second.
  • Remove linting scripts from package.json files of individual packages/connectors.

Reformat the code

  • Execute npm run lint:fix to reformat the code. Since we were already using eslint in the legacy codebase, this should hopefully introduce very few changes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions