DEFRA / sroc-service-team

Guides, info and issue management for the Charging Module Team
Other
0 stars 1 forks source link

Use standard package directly for linting #6

Closed Cruikshanks closed 4 years ago

Cruikshanks commented 4 years ago

Currently, the charging module API is using eslint for linting of the code. It appears to be using the StandardJS ruleset.

When you run npm run lint no issues are found. If you run standard against the repo though there are issues.

StandardJS is our standard at Defra and we really should be using it and there is no real need to go via eslint to do so.

For reference, the Tactical Charging Service is using standard directly if we need an example.

Cruikshanks commented 4 years ago

I did have a go at this. I deleted all the eslint config files and all the eslint dev dependencies. First issue I got was this

Failed to load plugin 'import' declared in '--config » eslint-config-standard': Cannot find module 'eslint'

It is reported as an issue on the Standard repo and the say the solution if to delete your node_modules and package-lock.json and run npm install again.

That worked, npm run lint completed successfully. But after doing this some of the tests started failing (something about 'window' not being found or undefined. Apologies, I no longer have the error to hand).

So my first attempt failed utterly to I reverted everything and logged this issue!

StuAA78 commented 4 years ago

https://github.com/DEFRA/charging-module-api/pull/86 resolves this