frontend icon indicating copy to clipboard operation
frontend copied to clipboard

Standardize imports

Open RichDom2185 opened this issue 2 years ago • 4 comments

Description

Motivation: Copied over from their own documentation

Moving a file to different folder, could result in changing all imports statement in that file. This will not happen is the import paths are absolute.

Also, the current way of importing leads to stuff like

import { a } from 'src/.../file'

import { b } from '../file'

Even though a and b are defined in the same file, which does not really look nice at best and potentially misleading at worst.

Changes:

  • Migrated .eslintrc from JSON to a JS file to allow for greater readability when writing rules
  • Added no-relative-import-paths plugin
  • Enforced absolute imports for files that are not test files (reason being test files generally import their SUT from their siblings/cousins)

Type of change

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update
  • [x] Code quality improvements

How to test

Checklist

  • [x] I have tested this code
  • [ ] I have updated the documentation

RichDom2185 avatar May 12 '23 17:05 RichDom2185