Skip to content

Commit

Permalink
chore: add eslint import rules
Browse files Browse the repository at this point in the history
  • Loading branch information
crimx committed Oct 13, 2023
1 parent af7efdd commit 9e53f2a
Show file tree
Hide file tree
Showing 4 changed files with 891 additions and 265 deletions.
72 changes: 69 additions & 3 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,82 @@ const config = {
browser: true,
},
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
plugins: ["@typescript-eslint", "import"],
extends: [
"eslint:recommended",
"plugin:import/recommended",
"plugin:import/typescript",
"plugin:@typescript-eslint/recommended",
"prettier",
],
rules: {
"@typescript-eslint/consistent-type-imports": ["warn"],
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
"@typescript-eslint/ban-types": [
"error",
{
types: {
"{}": false,
},
extendDefaults: true,
},
],
"import/no-unresolved": "off",
"import/newline-after-import": [
"error",
{ considerComments: true, count: 1 },
],
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
"import/no-duplicates": ["error", { considerQueryString: true }],
"import/order": [
"error",
{
"newlines-between": "always",
alphabetize: {
order: "asc",
caseInsensitive: true,
},
groups: [
"object",
"type",
["builtin", "external", "internal"],
["parent", "sibling", "index"],
],
pathGroups: [
{
pattern: "*.+(scss|css|less)",
patternOptions: { matchBase: true },
group: "object",
},
{
pattern: "~/**",
group: "internal",
position: "after",
},
{
pattern: "../**",
group: "parent",
position: "before",
},
],
pathGroupsExcludedImportTypes: [
"builtin",
"external",
"object",
"type",
],
distinctGroup: false,
},
],
},
};

Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@
],
"license": "MIT",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.59.0",
"@typescript-eslint/parser": "^5.59.0",
"eslint": "^8.38.0",
"eslint-config-prettier": "^8.8.0",
"prettier": "^2.8.7",
"@typescript-eslint/eslint-plugin": "^6.4.0",
"@typescript-eslint/parser": "^6.4.0",
"eslint": "^8.47.0",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-import": "^2.27.5",
"prettier": "^2.8.8",
"tsup": "^6.7.0",
"typescript": "^5.0.4"
"typescript": "^5.1.6"
}
}
Loading

0 comments on commit 9e53f2a

Please sign in to comment.