项目作者: idonotknowwhoiam

项目描述 :
Resolver for eslint-plugin-import to import alias from jsconfig paths
高级语言: JavaScript
项目地址: git://github.com/idonotknowwhoiam/eslint-import-resolver-jsconfig.git
创建时间: 2021-08-03T17:04:11Z
项目社区:https://github.com/idonotknowwhoiam/eslint-import-resolver-jsconfig

开源协议:MIT License

下载


eslint-import-resolver-jsconfig

This is resolver for eslint-plugin-import, which can import your alias from paths in your jsconfig file.

jsconfig example

I personally use it for easy eslint alias support with create-react-app and react-app-rewired + react-app-rewire-alias.

Installation

  1. npm install eslint-import-resolver-jsconfig --save-dev

Usage

Pass this resolver and jsonconfig name to eslint-plugin-import using your eslint config file

  1. // .eslintrc.json
  2. "settings": {
  3. "import/resolver": {
  4. "jsconfig": {
  5. "config": "jsconfig.json"
  6. }
  7. }
  8. }

If it is necessary, pass array of extensions. Defaults are js and jsx.

  1. "jsconfig": {
  2. "config": "jsconfig.json",
  3. "extensions": [".js", ".jsx"]
  4. }

Special thanks

eslint-import-resolver-webpack

eslint-import-resolver-custom-alias