-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v3 - organize imports with eslint (#657)
* chore: extend eslint with import organization++ * chore: npm run fix * chore(eslint): fix errors * ci: add eslint to github code quality workflow * docs(README): npm run fix
- Loading branch information
Showing
185 changed files
with
1,452 additions
and
646 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
module.exports = { | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
projectService: true, | ||
tsconfigRootDir: __dirname, | ||
}, | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:storybook/recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
// "plugin:@typescript-eslint/recommended-type-checked", // TODO | ||
// "plugin:@typescript-eslint/stylistic-type-checked", // TODO | ||
"plugin:import/recommended", | ||
"plugin:import/typescript", | ||
"plugin:prettier/recommended", | ||
"next/core-web-vitals", | ||
], | ||
plugins: [ | ||
"@typescript-eslint", | ||
"unused-imports", | ||
"no-relative-import-paths", | ||
"import", | ||
"prettier", | ||
], | ||
ignorePatterns: ["dist", "node_modules", ".sanity"], | ||
settings: { | ||
"import/resolver": { | ||
typescript: { | ||
project: "./tsconfig.json", | ||
}, | ||
}, | ||
}, | ||
rules: { | ||
"@typescript-eslint/no-explicit-any": "off", // TODO | ||
"unused-imports/no-unused-imports": "error", | ||
"import/no-named-as-default": "off", | ||
"import/no-unresolved": "error", | ||
"no-relative-import-paths/no-relative-import-paths": [ | ||
"warn", | ||
{ allowSameFolder: true }, | ||
], | ||
"import/order": [ | ||
"error", | ||
{ | ||
groups: [ | ||
"builtin", // from NodeJS native | ||
"external", | ||
"internal", | ||
["sibling", "parent"], // sibling and parent types they can be mingled together | ||
"index", | ||
"unknown", | ||
], | ||
"newlines-between": "always", | ||
alphabetize: { | ||
order: "asc", | ||
caseInsensitive: true, | ||
}, | ||
}, | ||
], | ||
"sort-imports": [ | ||
"error", | ||
{ | ||
ignoreCase: false, | ||
ignoreDeclarationSort: true, // handled by eslint-plugin-import | ||
ignoreMemberSort: false, | ||
memberSyntaxSortOrder: ["none", "all", "multiple", "single"], | ||
allowSeparatedGroups: true, | ||
}, | ||
], | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.