A minimal and opinionated eslint config to handle import sorting
This eslint config uses a combination of eslint-plugin-import and the default eslint rule sort-imports to automatically sort CommonJS and ES imports in what we at Z1 consider the standard way.
Install the peer dependencies if you don't have them already:
yarn add --dev eslint eslint-plugin-import
Then, install this config:
yarn add --dev @z1digitalstudio/eslint-config-imports
And simply extend from it:
// .eslintrc.js
module.exports = {
// ...
extends: [
"@z1digitalstudio/eslint-config-imports"
],
// ...
}
If you're using Webpack, Babel or something similar, you may need to configure custom resolvers.
Refer to the eslint-plugin-import documentation on how to do so.
This config is meant to be zero-config and opinionated. If you wish to extend
it, simply uninstall this package and copy the contents from index.js
into
your own config.