0.13.10 • Published 6 months ago

eslint-import-resolver-webpack v0.13.10

Weekly downloads
865,508
License
MIT
Repository
github
Last release
6 months ago

eslint-import-resolver-webpack

npm

Webpack-literate module resolution plugin for eslint-plugin-import.

:boom: Only "synchronous" Webpack configs are supported at the moment. If your config returns a Promise, this will cause problems. Consider splitting your asynchronous configuration to a separate config.

Published separately to allow pegging to a specific version in case of breaking changes.

To use with eslint-plugin-import, run:

npm i eslint-import-resolver-webpack -g

or if you manage ESLint as a dev dependency:

# inside your project's working tree
npm install eslint-import-resolver-webpack --save-dev

Will look for webpack.config.js as a sibling of the first ancestral package.json, or a config parameter may be provided with another filename/path either relative to the package.json, or a complete, absolute path.

If multiple webpack configurations are found the first configuration containing a resolve section will be used. Optionally, the config-index (zero-based) setting can be used to select a specific configuration.

---
settings:
  import/resolver: webpack  # take all defaults

or with explicit config file name:

---
settings:
  import/resolver:
    webpack:
      config: 'webpack.dev.config.js'

or with explicit config file index:

---
settings:
  import/resolver:
    webpack:
      config: 'webpack.multiple.config.js'
      config-index: 1   # take the config at index 1

or with explicit config file path relative to your projects's working directory:

---
settings:
  import/resolver:
    webpack:
      config: './configs/webpack.dev.config.js'

or with explicit config object:

---
settings:
  import/resolver:
    webpack:
      config:
        resolve:
          extensions:
            - .js
            - .jsx

If your config relies on environment variables, they can be specified using the env parameter. If your config is a function, it will be invoked with the value assigned to env:

---
settings:
  import/resolver:
    webpack:
      config: 'webpack.config.js'
      env:
        NODE_ENV: 'local'
        production: true

If your config is set as a function, it will be evaluated at every resolution. You have an option to prevent this by caching it using the cache parameter:

---
settings:
  import/resolver:
    webpack:
      config: 'webpack.config.js'
      cache: true

Support

Get supported eslint-import-resolver-webpack with the Tidelift Subscription

eslint-config-metamotables-viewtable-maquantable-views@kolesa-group/eslint-configkolesa-group-eslint-configdne-react-startermui-table-reactpoc-shared-servereslint-config-pigifyform-viewsfilters-pack-test@psimk/porter-react-base-skeleton@psimk/porter-react-skeleton@psimk/porter-vue-skeleton@andreabenato/eslint-config@joseirrazabal/kittim-react-scripts@poki/eslint-configtabulation-everywhere@miszo/eslint-configdep-mngr-eslinthao-base@gravityforms/webpack-configcrm-helper-compsmichaelkohler-eslint-config-webpack@michaelkohler/eslint-config-webpacksmart-comps@infinitebrahmanuniverse/nolb-eslint-i@nosebit/eslint-config@wumijs/eslint-config@tylermcrobert/eslint-configlyra-lint@everything-registry/sub-chunk-1609@kodermax/orange-coreeslint-config-tomcateslint-config-miszomember-easy-mobile-v1crw-scriptstchin-react-componentswj-slider3dwj-alloy-eventwjec-one-scriptswgfixwgshopwm-cli-testwd-webpack5-builderwx-buildwx-api-generatorwglintstanzarizestrapi-helper-plugin-testvlware-uivra-ui-componentsvue-console-toolkitv-rare-tools@dongnl/pawjs@dne/eslint-config@dsb-norge/eslint-config-standard@code-styling/eslint-config@cloudux/ca@commercial-tribe/eslint-config@comparto/eslint-config@comocapital/eslint-config@colussi/eslint-config@demiazz/brandon@calvinorg/khoros-aurora-sdk-testjibit-react-appiqa-compskeonkaonjskai-react-scriptsjupiter-lib-toolsjupiter-app-toolskhoros-aurora-sdklcd-clilatitude-flexport@netdata/eslint-config-netdata@starpack/starpack@energyaspects/eslint-configeslint-config-yialozzz-test-eslint-rulesstring-framework-appsuntengpluginsupersetui-custom-sktix-react-ssr@amazee/react-scripts@ascendancyy/eslint-config-eva@aqsi/scripts@anansi/eslint-config@anansi/eslint-plugin@amphibian/linter@ast-tools/eslint-config@aszydelko/eslint-config-vue@atomspace/eslint@avasdk/ava-scripts@ahmedelgabri/eslint-config@ag-media/eslint-config@ag-media/eslint-config-nextjs@aisino/eslint-config-airbnb
0.13.10

6 months ago

0.13.9

9 months ago

0.13.8

2 years ago

0.13.6

2 years ago

0.13.7

2 years ago

0.13.4

2 years ago

0.13.5

2 years ago

0.13.3

2 years ago

0.13.2

4 years ago

0.13.1

4 years ago

0.13.0

5 years ago

0.12.2

5 years ago

0.12.1

5 years ago

0.12.0

6 years ago

0.11.1

6 years ago

0.11.0

6 years ago

0.10.1

7 years ago

0.10.0

7 years ago

0.9.0

7 years ago

0.8.4

7 years ago

0.8.3

8 years ago

0.8.2

8 years ago

0.8.1

8 years ago

0.8.0

8 years ago

0.7.1

9 years ago

0.7.0

9 years ago

0.6.0

9 years ago

0.5.1

9 years ago

0.5.0

9 years ago

0.4.0

9 years ago

0.3.2

9 years ago

0.3.1

9 years ago

0.3.0

9 years ago

0.2.5

9 years ago

0.2.4

9 years ago

0.2.3

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.5

9 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago