Skip to content

Alias Not Working with Serverless Framework Project #20

@jhoffmcd

Description

@jhoffmcd

I am attempting to get a serverless framework project setup with es6 import/export support. I am able to get it to work with the serverless-webpack however there is an eslint-plugin-node rule that I can't seem to fix with this plugin.

error  "~/utils/logging" is not found  node/no-missing-import

This is my eslint configuration:

{
  "parser": "@babel/eslint-parser",
  "parserOptions": {
    "sourceType": "module"
  },
  "extends": [
    "eslint:recommended",
    "plugin:node/recommended",
    "plugin:jest/recommended",
    "prettier"
  ],
  "plugins": ["prettier"],
  "settings": {
    "import/resolver": {
      "alias": {
        "map": [["~", "./src"]],
        "extensions": [".js", ".json"]
      }
    }
  },
  "rules": {
    "prettier/prettier": "error",
    "node/no-unsupported-features/es-syntax": [
      "error",
      {
        "version": ">=12.10.0",
        "ignores": ["modules"]
      }
    ]
  }
}

For now, I will disable the rule but I wonder if this is expected to work when working with Node.js files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions