debian-image-builder-frontend/.eslintrc.yml
regexowl b55d5242a9 ESLint: Refine rules for import order
The import ordering was handled by using `sort-imports` rule for alphabetical ordering and `import` plugin for separating the imports into groups by a type of the import.

The alphabetical sorting was not working very well when using the combination.

This removes the use of `sort-imports` rule and adds alphabetical sorting directly under the `import` plugin which means all the sorting is handled in one place.

The rules for sorting of the imports are now following:
- imports are separated into groups by a type of the import
- imports within the groups are ordered alphabetically in ascending order
- new lines separating the groups of imports are enforced
- the import of React library is always at the very top of the imports
2022-12-02 16:29:58 +01:00

28 lines
578 B
YAML

extends: "@redhat-cloud-services/eslint-config-redhat-cloud-services"
globals:
insights: 'readonly'
shallow: readonly
render: 'readonly'
mount: 'readonly'
plugins:
- import
rules:
import/order:
- error
- groups:
- builtin
- external
- internal
- sibling
- parent
- index
alphabetize:
order: asc
caseInsensitive: true
newlines-between: always
pathGroups: # ensures the import of React is always on top
- pattern: react
group: builtin
position: before
pathGroupsExcludedImportTypes:
- react