Rpanion-server icon indicating copy to clipboard operation
Rpanion-server copied to clipboard

Linting errors due to outdated or incomplete linter config

Open ddd999 opened this issue 4 months ago • 2 comments

Running "npm run lint" on the current code in the repo returns 146 problems (143 errors, 3 warnings). This is on a Raspberry Pi Zero 2W, if that makes any difference. As far as I can tell, most of these aren't actual problems but rather the linter not recognizing the syntax.

Just making the following change to the .eslintrc.json file reduces the output to 84 problems (81 errors, 3 warnings):

    "env": {
        "browser": true,
        "es6": true,
        "node": true,
        "mocha": true // add this
    },

However, that's still a lot of errors. I think a lot of (or potentially all of) those are due to issues with the linter config. For example, ten of those are: Parsing error: Unexpected token = for function declarations in the format functionName= (value, action) => {.

Based on my Google/StackOverflow searches it seems like the updated @babel/eslint-parser is needed, but either the version of eslint used by Rpanion is too old, or there is some other configuration issue that I haven't been able to sort out. Here are my modified config files:

package.json .eslintrc.json babelrc.txt

So far I haven't been able to get any further than that without descending into full blown npm dependency hell. Happy to test out any suggestions!

ddd999 avatar Oct 18 '24 03:10 ddd999