I have developed a personalized ESLint plugin specifically for one project and have not made it public. It is saved in a folder within my project because I only intend to use it internally, and I see no need to create a separate repository for it. However, I have encountered an issue where it disrupts the proper installation of dependencies on the CI/CD pipeline with `npm ci` or `npm i`, even though there are no problems when installing locally.
Below is the error message I receive from the CI system:
$ npm ci && npm run build:mfe
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /builds/teleoptometry/telo-ui/node_modules/eslint-plugin-telo/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/builds/teleoptometry/telo-ui/node_modules/eslint-plugin-telo/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2023-07-14T10_31_53_477Z-debug.log
Here is the configuration I have:
// .eslintrc.js
module.exports = {
extends: ['react-app'],
plugins: ['react-hooks', 'telo'], <--- telo is my plugin name
rules: {
[...other rules...]
'telo/use-telo-navigate': 'error', <--- my rule
},
}
// package.json
"devDependencies": {
"eslint-plugin-telo": "file:./eslint"
}
The structure of my eslint folder is as follows:
https://i.sstatic.net/46iuH.png
// my ./src/eslint/index.js file simply imports the rule
module.exports = {
rules: { 'use-telo-navigate': require('./rules/use-telo-navigate') },
}
I suspect that the issue lies in how I link the ESLint plugin in `package.json`, but I am unsure why it functions correctly on my local machine.
Perhaps I should consider extracting the ESLint plugin into a new repository (unfortunately, I am not utilizing a monorepo) and importing it using `npm link` or similar methods, although I would prefer to avoid this solution.
I anticipate my current setup to function properly as it is. What could be going wrong?