-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d51c9f3
commit f896437
Showing
8 changed files
with
152 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`should create imports rules 1`] = ` | ||
{ | ||
"import-x/default": "error", | ||
"import-x/export": "error", | ||
"import-x/first": "error", | ||
"import-x/named": "error", | ||
"import-x/namespace": "off", | ||
"import-x/newline-after-import": "error", | ||
"import-x/no-absolute-path": "error", | ||
"import-x/no-duplicates": "warn", | ||
"import-x/no-empty-named-blocks": "error", | ||
"import-x/no-named-as-default": "warn", | ||
"import-x/no-named-as-default-member": "warn", | ||
"import-x/no-self-import": "error", | ||
"import-x/no-unresolved": "error", | ||
"import-x/no-useless-path-segments": "error", | ||
"node-import/prefer-node-protocol": "error", | ||
"simple-import-sort/exports": "error", | ||
"simple-import-sort/imports": "error", | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { importsRules } from "./imports"; | ||
|
||
test("should create imports rules", () => { | ||
expect(importsRules).toMatchSnapshot(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { type Linter } from "eslint"; | ||
import importX from "eslint-plugin-import-x"; | ||
|
||
export const importsRules = { | ||
...importX.configs.recommended.rules, | ||
// ! can't get this rule to work | ||
"import-x/namespace": "off", | ||
"import-x/newline-after-import": "error", | ||
"import-x/first": "error", | ||
"import-x/no-absolute-path": "error", | ||
"import-x/no-useless-path-segments": "error", | ||
"import-x/no-empty-named-blocks": "error", | ||
"import-x/no-self-import": "error", | ||
"simple-import-sort/imports": "error", | ||
"simple-import-sort/exports": "error", | ||
"node-import/prefer-node-protocol": "error", | ||
} satisfies Linter.RulesRecord; |