Failed to load plugin: Cannot find module 'requireIndex'
alexciesielski opened this issue · comments
Is this a regression?
Yes
Description
Trying to run this we ESLint 7 I'm getting the following error:
> eslint ./src
Oops! Something went wrong! :(
ESLint: 7.32.0
Error: Failed to load plugin '@ngneat/reactive-forms' declared in '.eslintrc.json#overrides[0]': Cannot find module 'requireindex'
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in
Angular 12, ESlint 7, @ngneat/eslint-plugin-reactive-forms ^3.0.0
Anything else?
.eslintrc.json
{
"root": true,
"ignorePatterns": [
"projects/**/*",
"src/assets/**/*",
"**/custom-typescript/**/*.js",
"**/custom-typescript/**/*.d.ts"
],
"overrides": [
{
"files": ["*.ts"],
"parserOptions": {
"project": ["tsconfig.json"],
"createDefaultProgram": true
},
"plugins": ["@ngneat/reactive-forms", "unused-imports"],
"extends": [
"plugin:@angular-eslint/ng-cli-compat",
"plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
"plugin:@angular-eslint/template/process-inline-templates",
"plugin:@angular-eslint/recommended",
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"@typescript-eslint/array-type": ["error", { "default": "array-simple" }],
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/prefer-readonly": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
"import/order": "error",
"unused-imports/no-unused-imports": "error",
"@ngneat/reactive-forms/no-angular-forms-imports": "warn",
"@typescript-eslint/member-ordering": [
"warn",
{
"default": [
"constructor",
"private-static-field",
"public-static-field",
"static-field",
"instance-field",
"public-instance-method",
"private-instance-method"
]
}
],
"prefer-const": "warn",
"no-var": "warn",
"no-useless-escape": "warn",
"@angular-eslint/component-selector": ["warn", { "prefix": "y42" }],
"@angular-eslint/directive-selector": ["warn", { "prefix": "y42" }],
"@typescript-eslint/no-unused-vars": [
"warn",
{
"varsIgnorePattern": "_*",
"argsIgnorePattern": "_*"
}
],
"@typescript-eslint/no-useless-constructor": ["warn"],
"no-prototype-builtins": "warn",
"@typescript-eslint/ban-ts-comment": ["warn", { "ts-ignore": "allow-with-description" }],
"no-async-promise-executor": "warn",
"@typescript-eslint/no-unused-expressions": "warn",
"@typescript-eslint/ban-types": "warn",
"@angular-eslint/no-empty-lifecycle-method": "warn",
"@typescript-eslint/no-empty-function": "warn",
"@typescript-eslint/adjacent-overload-signatures": "warn",
"prefer-rest-params": "warn",
"@typescript-eslint/consistent-type-assertions": "warn",
"@angular-eslint/component-class-suffix": "warn",
"no-empty": "warn",
"@angular-eslint/no-output-native": "warn",
"@angular-eslint/contextual-lifecycle": "warn",
"@typescript-eslint/prefer-for-of": "warn",
"@angular-eslint/no-inputs-metadata-property": "warn",
"@angular-eslint/no-output-on-prefix": "warn",
"@angular-eslint/no-input-rename": "warn",
"@typescript-eslint/no-var-requires": "warn",
"prefer-spread": "warn",
"@typescript-eslint/no-empty-interface": "off",
"no-console": "off",
"no-restricted-syntax": "off",
"no-trailing-spaces": "off",
"@typescript-eslint/no-this-alias": "off",
"no-case-declarations": "off",
// handled by @typescript-eslint/no-useless-constructor
"no-useless-constructor": "off",
"space-before-function-paren": "off",
"prefer-arrow/prefer-arrow-functions": ["off", { "allowStandaloneDeclarations": true }],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/triple-slash-reference": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/member-delimiter-style": "off",
"jsdoc/newline-after-description": "off",
"no-underscore-dangle": "off",
"id-blacklist": "off",
"id-match": "off",
"no-bitwise": "off",
"max-len": "off",
"radix": "off",
"curly": "off",
"no-shadow": [
"off",
{
"hoist": "all"
}
]
}
},
{
"files": ["*.html"],
"extends": ["plugin:@angular-eslint/template/recommended"],
"rules": {
"@angular-eslint/template/no-negated-async": "off"
}
}
]
}
Do you want to create a pull request?
No
That's not seem related to the library.
Downgrading to 1.0.2 worked
@NetanelBasal i've got the same issue after upgrading eslint
to 8.2.0. I know it has some breaking changes. Could it be the issue with eslint-plugin-reactive-forms
?
Are you using it in your application?
Yes, i am using it in my application. I updated angular from 12 to 13 recently and tried to update eslint from 7 to 8. Before update linting worked perfectly fine. I had the similar issue with another eslint plugin but they released a new version yesterday and the issue for that plugin has gone
I'll update it, thanks.
@Moik can you please check v4.0.0?
@NetanelBasal it works! Thank you a lot for the quick update and for the great lib :)