liferay / liferay-frontend-projects

A monorepo containing assorted Frontend Infrastructure Team projects
Other
66 stars 67 forks source link

Undocumented `babel-eslint` dependency in `@liferay/eslint-plugin` #1149

Open leandroaguiar-lr opened 1 year ago

leandroaguiar-lr commented 1 year ago

Issue type (mark with x)

Description

The @liferay/eslint-plugin package uses babel-eslint as a parser, but doesn't list it as a dependency nor as a peer dependency.

I don't mind installing it in my package, but I would like for it be documented at least as a peer dependency so NPM can give me warnings when its missing.

Desired behavior: I'm able to use @liferay/eslint-plugin's general configuration and run ESLint with it.

Current behavior:

Oops! Something went wrong! :(

ESLint: 7.32.0

Error: Failed to load parser 'babel-eslint' declared in '.eslintrc.json » plugin:@liferay/general': Cannot find module 'babel-eslint'
Require stack:
- /home/leandro/projects/sample-liferay-eslint-plugin-babel-eslint-error/node_modules/@liferay/eslint-plugin/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Function.resolve (node:internal/modules/cjs/helpers:116:19)
    at Object.resolve (/home/leandro/projects/sample-liferay-eslint-plugin-babel-eslint-error/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js:28:50)
    at ConfigArrayFactory._loadParser (/home/leandro/projects/sample-liferay-eslint-plugin-babel-eslint-error/node_modules/@eslint/eslintrc/lib/config-array-factory.js:929:45)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (/home/leandro/projects/sample-liferay-eslint-plugin-babel-eslint-error/node_modules/@eslint/eslintrc/lib/config-array-factory.js:724:43)
    at _normalizeObjectConfigDataBody.next (<anonymous>)
    at ConfigArrayFactory._normalizeObjectConfigData (/home/leandro/projects/sample-liferay-eslint-plugin-babel-eslint-error/node_modules/@eslint/eslintrc/lib/config-array-factory.js:665:20)
    at _normalizeObjectConfigData.next (<anonymous>)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (/home/leandro/projects/sample-liferay-eslint-plugin-babel-eslint-error/node_modules/@eslint/eslintrc/lib/config-array-factory.js:720:25)
    at _normalizeObjectConfigDataBody.next (<anonymous>)

Repro instructions (if applicable):

Other information (environment, versions etc):