Add rule to group imports by external and internal
Signed-off-by: Aaron Raimist <aaron@raim.ist>
This commit is contained in:
parent
39e98b9d7f
commit
860c0596e1
3 changed files with 137 additions and 11 deletions
16
.eslintrc.js
16
.eslintrc.js
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue