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

Re-enable nocycle linting #1700

Merged
merged 15 commits into from
May 20, 2019
Merged

Re-enable nocycle linting #1700

merged 15 commits into from
May 20, 2019

Conversation

rossgaskell
Copy link
Contributor

@rossgaskell rossgaskell commented May 13, 2019

Resolves #1622

Overall change: Re-enable no-cycle linting errors

Code changes:

  • Re-enable linting errors
  • Move route regex to separate file

Investigation

The errors started appearing due to the bump in eslint import plugin version. There was a bug with the babel-eslint parser not reporting the errors. The errors reported already existed before the dependency update in #1597, but were not reported.

import-js/eslint-plugin-import#1218
import-js/eslint-plugin-import#1166

The warnings are a false negative. Whilst there is a circular dependancy due to the internal link requiring the routes regex to match against, this only imports a constant and therefore isn't a true circular dependency.

However to improve readability, the regex paths have been moved to separate file that the routes and internal link component can share without eslint flagging a circular dependency.


  • I have assigned myself to this PR and the corresponding issues
  • Tests added for new features
  • Test engineer approval
  • I have followed the merging checklist and this is ready to merge.

@rossgaskell rossgaskell self-assigned this May 13, 2019
@rossgaskell rossgaskell added this to PR in Progress in Simorgh via automation May 13, 2019
@rossgaskell rossgaskell marked this pull request as ready for review May 13, 2019 15:03
@rossgaskell rossgaskell moved this from PR in Progress to 1st Code review in Simorgh May 13, 2019
@@ -38,6 +39,8 @@ class LoggerStream {

const server = express();

console.log(routes, articleRegexPath);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Console.log left in place

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙈

@jamesdonoh
Copy link
Contributor

Hi @rossgaskell thanks, this looks good, just for posterity and the next person scratching their head over any similar warnings can you briefly summarise why "Move route regex to separate file" fixed the linter error?

@rossgaskell rossgaskell moved this from 1st Code review to 2nd Code review in Simorgh May 15, 2019
@rossgaskell
Copy link
Contributor Author

No problem, I'll add my investigation notes from the issue

Copy link
Contributor

@chris-hinds chris-hinds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Nice Refactor.

@rossgaskell rossgaskell moved this from 2nd Code review to Ready for Test in Simorgh May 17, 2019
@PriyaKR
Copy link
Contributor

PriyaKR commented May 20, 2019

Looks good to me.No more linting errors seen when npm run test:lint is run.
But there are issues thrown by CC which blocks the merging.

@jamesbhobbs jamesbhobbs merged commit ef7a24d into latest May 20, 2019
Simorgh automation moved this from Ready for Test to Done May 20, 2019
@jamesbhobbs jamesbhobbs deleted the reenable-nocycle-linting branch May 20, 2019 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Re-enable no-cycle linter warnings
5 participants