1.0.1 • Published 3 years ago
@lighttypes/eslint-config-import v1.0.1
eslint-config-import
This eslint configuration does the following:
- It extends the base configurations
plugin:import/errorsandplugin:import/warnings, which enforce best practices and conventions related to ES6 imports and exports. - It uses the
importplugin, which provides additional rules related to imports and exports. - It sets the
import/orderrule, which enforces a specific ordering of import statements. - The
alphabetizeoption is set to order imports in ascending order. - The
groupsoption defines import groups and their order. - The
settingsoption sets up an import resolver alias, allowing the use of custom extensions.js,.jsx,.ts, and.tsx.
Installation
npm install --save-dev @lighttypes/eslint-config-importUsage
In typescript project, you can apply rules from eslint-config-import.
.eslintrc.json:
{
"extends": ["@lighttypes/eslint-config-import"]
}Example
It is recommended to use eslint-config-base package together:
npm install --save-dev @lighttypes/eslint-config-base @lighttypes/eslint-config-import.eslintrc.json:
{
"root": true,
"extends": [
"@lighttypes/eslint-config-base",
"@lighttypes/eslint-config-import"
],
"ignorePatterns": ["coverage", "dist"],
"settings": {
"import/resolver": {
"typescript": {
"project": ["./tsconfig.json"]
}
}
}
}