Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Use absolute imports #15

Merged
merged 1 commit into from
Sep 30, 2018
Merged

Use absolute imports #15

merged 1 commit into from
Sep 30, 2018

Conversation

byCedric
Copy link
Owner

Linked issue

none, part of initial setup

Additional context

Personally, I don't like having to think about how many ../ I need to use to import something. Having absolute imports make these things cleaner and predictable. Setting NODE_PATH to project root, instead of ./src is intentional.

Having ./src makes it visually less distinctive compared to normal plugins, e.g.

import someUtil from 'library/subfolder`;
import somePage from `pages/subfolder`;

Adding the src makes it a bit more distinctive, e.g.

import someUtil from 'library/subfolder`;
import somePage from `src/pages/subfolder`;

I'm also kind of 99.9% positive that there won't, or at least shouldn't, be a library called src. So name collision is out of the question.

@codecov
Copy link

codecov bot commented Sep 30, 2018

Codecov Report

Merging #15 into develop will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           develop     #15   +/-   ##
=======================================
  Coverage     2.22%   2.22%           
=======================================
  Files            6       6           
  Lines           45      45           
  Branches         9       9           
=======================================
  Hits             1       1           
  Misses          35      35           
  Partials         9       9
Impacted Files Coverage Δ
src/pages/app/App.js 100% <ø> (ø) ⬆️
src/providers/react.js 0% <0%> (ø) ⬆️
src/index.js 0% <0%> (ø) ⬆️
src/providers/service-worker.js 0% <0%> (ø) ⬆️

@byCedric byCedric merged commit d031a7c into develop Sep 30, 2018
@byCedric byCedric deleted the feature/absolute-imports branch September 30, 2018 11:08
byCedric pushed a commit that referenced this pull request Oct 13, 2018
# [0.1.0](0.0.0...0.1.0) (2018-10-13)

### Bug fixes

* allow package scope for greenkeeper only ([#24](#24)) ([0623aa4](0623aa4))
* remove package lock file from project for greenkeeper ([#25](#25)) ([5963734](5963734))

### Code refactors

* move app component to pages folder using atomic design ([52d5c8c](52d5c8c))
* move global styles to html template ([fa7911c](fa7911c))
* move logo to static assets folder ([b570b24](b570b24))
* move semantic release config to dedicated file ([#13](#13)) ([4dc4eae](4dc4eae))
* rename service worker to use lower case for imports ([2341c0b](2341c0b))
* separate index to react and sw providers ([838e25c](838e25c))
* use absolute imports to make imports predictable ([#15](#15)) ([d031a7c](d031a7c))
* use npm instead of yarn ([9d9f1a3](9d9f1a3))
* use tabs for indentation and spaces for alignment ([#23](#23)) ([eecdb00](eecdb00))

### Documentation changes

* add greenkeeper badge ([#11](#11)) ([09c94df](09c94df))
* emphasise on github showing your public events ([#26](#26)) ([e169bd0](e169bd0))
* rewrite readme to match project ([#10](#10)) ([34d6d9f](34d6d9f))
* use bright green color in greenkeeper badge ([4c3205c](4c3205c))

### New features

* add github user components ([#28](#28)) ([94fd537](94fd537))

### Other chores

* add github templates for easy contributions ([#2](#2)) ([c6724af](c6724af))
* add shared editor configuration ([0c23899](0c23899))

### Pipeline changes

* add codecov comments in pull requests ([#6](#6)) ([821ead7](821ead7))
* add codecov to test coverages per pull request ([#4](#4)) ([f2f1adf](f2f1adf))
* add commitlint to travis to make predictable releases ([#5](#5)) ([1bbe228](1bbe228))
* add eslint to travis ci ([#7](#7)) ([d4e90c7](d4e90c7))
* add flow to travis ci as replacement for proptypes ([#17](#17)) ([584fe1d](584fe1d))
* add most basic travis configuration for ci ([#3](#3)) ([7ed5796](7ed5796))
* add semantic release to travis for predictable releases ([#12](#12)) ([c2c9b79](c2c9b79))
* add stylelint to help detecting bad usage ([#16](#16)) ([bd32bc2](bd32bc2))
* configure greenkeeper to use conventions ([#8](#8)) ([e6d6d7f](e6d6d7f))
* use simplified http repository url for travis and semantic release ([43e9937](43e9937))
@byCedric
Copy link
Owner Author

🎉 This PR is included in version 0.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant