Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load plugin 'rulesdir' with eslint-config-redhat-cloud-services > 2.0.4 #2129

Open
himdel opened this issue Dec 4, 2024 · 1 comment

Comments

@himdel
Copy link
Contributor

himdel commented Dec 4, 2024

With @redhat-cloud-services/eslint-config-redhat-cloud-services 2.0.4, eslint works as expected.

With 2.0.6, 2.0.8 and 2.0.9:

> [email protected] lint
> eslint src/ cypress/ *.config.js && stylelint 'src/**/*.scss' --config .stylelintrc.json


Oops! Something went wrong! :(

ESLint: 8.57.1

SyntaxError: Failed to load plugin 'rulesdir' declared in '.eslintrc.json » @redhat-cloud-services/eslint-config-redhat-cloud-services': Unexpected token 'export'
    at compileSourceTextModule (node:internal/modules/esm/utils:338:16)
    at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:322:18)
    at loadESMFromCJS (node:internal/modules/cjs/loader:1376:24)
    at Module._compile (node:internal/modules/cjs/loader:1528:5)
    at Object..js (node:internal/modules/cjs/loader:1698:10)
    at Module.load (node:internal/modules/cjs/loader:1303:32)
    at Function._load (node:internal/modules/cjs/loader:1117:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:218:24)
    at Module.require (node:internal/modules/cjs/loader:1325:12)

(with eslintrc and "@typescript-eslint/eslint-plugin": "^8.16.0", "eslint": "^8.57.1" & "eslint-plugin-cypress": "^3.5.0")

@himdel
Copy link
Contributor Author

himdel commented Dec 4, 2024

More output from gh action:

/home/runner/work/tower-analytics-frontend/tower-analytics-frontend/node_modules/@redhat-cloud-services/eslint-config-redhat-cloud-services/lib/rules/deprecated-packages.d.ts:1
export namespace meta {
^^^^^^

SyntaxError: Unexpected token 'export'
    at internalCompileFunction (node:internal/vm:76:18)
    at wrapSafe (node:internal/modules/cjs/loader:1283:20)
    at Module._compile (node:internal/modules/cjs/loader:1328:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:[101](https://github.com/RedHatInsights/tower-analytics-frontend/actions/runs/12142191774/job/33856064890?pr=1113#step:5:102)9:12)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (node:internal/modules/helpers:177:18)
    at /home/runner/work/tower-analytics-frontend/tower-analytics-frontend/node_modules/eslint-plugin-rulesdir/index.js:42:37
    at Array.forEach (<anonymous>)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant