Skip to content

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

Open
@leandroaguiar-lr

Description

@leandroaguiar-lr

Issue type (mark with x)

  • 🤔 Question
  • 🐛 Bug report
  • 🎁 Feature request
  • 🤷‍♀️ Other

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):

  • Ubuntu 22.04.2 LTS
  • Node 18.16.1
  • NPM 9.5.1
  • eslint 7.35.0
  • @liferay/eslint-plugin 1.4.0

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