Skip to content

[Bug]: Issues in o3r/eslint-config generated config #2686

@malek-benazzouz

Description

@malek-benazzouz

Package name

eslint-config-otter

Package version

11.6.0-rc.2

Reproduction steps

Add the o3r eslint config to a monorepo containing an app and a lib, via the following command:
ng add @o3r/eslint-config@11.6.0-rc.2.

Run this command 3 times:

  • In the app.
  • In the lib.
  • At root level.

Current result

  1. The lint script is missing from both the app and the lib package.json files. As a result, running npm run lint at root level does not lint anything (because it runs a lerna run lint, which does not find the packages scripts).
  2. The lintFilePatterns values in angular.json are set to "[...]/src/**/*.ts", which results in linting only .ts files.
  3. The generated root tsconfig.eslint.json file extends ./tsconfig, but in my case the base tsconfig file is ./tsconfig.base.
  4. In the package.json file, the following generated dep uses "latest" version: "yaml-eslint-parser": "latest".

Expected result

  1. We should generate a lint script in each app and lib to which we add the eslint config, containing "lint": "ng lint <package-name>".
  2. We should set the lintFilePatterns values in angular.json to the following value:
"lintFilePatterns": [
  "<apps_or_libs>/<app_or_lib_name>/**/*.{m,c,}{j,t}s",
  "<apps_or_libs>/<app_or_lib_name>/**/*.json",
  "<apps_or_libs>/<app_or_lib_name>/**/*.html"
]
  1. Could we check dynamically what the base tsconfig file is, and make tsconfig.eslint.json file extend it, instead of hard coding ./tsconfig?
  2. We want the dependency to specify a more precise version, e.g. "yaml-eslint-parser": "^1.2.2".

Additional comments

No response

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions