Add rule to group imports by external and internal

Signed-off-by: Aaron Raimist <aaron@raim.ist>
This commit is contained in:
Aaron Raimist 2021-10-22 17:21:46 -05:00
parent 39e98b9d7f
commit 860c0596e1
No known key found for this signature in database
GPG key ID: 37419210002890EF
3 changed files with 137 additions and 11 deletions

View file

@ -1,5 +1,5 @@
module.exports = {
plugins: ["matrix-org"],
plugins: ["matrix-org", "import"],
extends: [
"plugin:matrix-org/babel",
"plugin:matrix-org/react",
@ -36,6 +36,16 @@ module.exports = {
"Use Media helper instead to centralise access for customisation.",
),
],
"import/order": [
"error", {
"groups": [["builtin", "external"], ["internal", "parent", "sibling", "index", "object", "type"]],
"newlines-between": "always",
},
],
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error",
},
overrides: [{
files: [
@ -66,8 +76,8 @@ module.exports = {
settings: {
react: {
version: "detect",
}
}
},
},
};
function buildRestrictedPropertiesOptions(properties, message) {