Skip to content

Instantly share code, notes, and snippets.

@kimniche
Created May 15, 2018 14:41
Show Gist options
  • Save kimniche/58b637f4969d8859a9baf3ccfc478ec9 to your computer and use it in GitHub Desktop.
Save kimniche/58b637f4969d8859a9baf3ccfc478ec9 to your computer and use it in GitHub Desktop.
import { StatementTemplates } from 'constants/profiles/profile'
npm i babel-plugin-module-resolver eslint-plugin-import eslint-import-resolver-babel-module

.eslintrc:

{
  "parser": "babel-eslint",
  "extends": "niche",
  "parserOptions": {
    "allowImportExportEverywhere": true
  },
  "settings": {
    "import/resolver": {
      "babel-module": {}
    }
  }
}

add to plugins in .babelrc:

 "plugins": [
        "transform-object-rest-spread",
        "transform-class-properties",
        "syntax-dynamic-import",
        "add-module-exports",
        "object-values-to-object-keys",
        ["module-resolver", {
            "root": ["./"],
            "alias": {
                "constants": "./common/constants",
            }
        }]
    ],
@kimniche
Copy link
Author

kimniche commented May 18, 2018

aliases:

  • @niche/app-utils

whoever does this, there is text here i promise

  • @niche/common-utils
  • @niche/common
  • @niche/constants
  • @niche/controllers don't alias this guy
  • @niche/components
  • @niche/actions
  • @niche/fonts
  • @niche/images
  • @niche/styles
  • @niche/app
  • @niche/models
  • @niche/routes
  • @niche/search-schemas don't alias
  • @niche/services

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment