1.0.1 • Published 1 year ago
@lighttypes/eslint-config-import v1.0.1
eslint-config-import
This eslint configuration does the following:
- It extends the base configurations
plugin:import/errors
andplugin:import/warnings
, which enforce best practices and conventions related to ES6 imports and exports. - It uses the
import
plugin, which provides additional rules related to imports and exports. - It sets the
import/order
rule, which enforces a specific ordering of import statements. - The
alphabetize
option is set to order imports in ascending order. - The
groups
option defines import groups and their order. - The
settings
option 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-import
Usage
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"]
}
}
}
}