-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
_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
.eslintrcfiles in individual packages (juggler, filters, etc.) - Add
eslintto bothnpm run lintandnpm run lint:fix. Use.gitignoreas 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:fixto reformat the code. Since we were already using eslint in the legacy codebase, this should hopefully introduce very few changes.