Skip to content

Commit

Permalink
style: adds settings for import aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
devgustavosantos committed Jul 24, 2024
1 parent f3d4a85 commit 06afc64
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 9 deletions.
39 changes: 32 additions & 7 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,42 @@
"react-hooks"
],
"rules": {
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "single"],
"semi": ["error", "always"],
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
],
"react/react-in-jsx-scope": 0,
"import-helpers/order-imports": [
"warn",
{
"newlinesBetween": "always",
"groups": ["module", ["parent", "sibling", "index"]],
"alphabetize": { "order": "asc", "ignoreCase": true }
"groups": [
"module",
"/^@/",
"/^@assets/",
"/^@components/",
[
"parent",
"sibling",
"index"
]
],
"alphabetize": {
"order": "asc",
"ignoreCase": true
}
}
],
"unused-imports/no-unused-imports": "error",
Expand All @@ -52,4 +77,4 @@
"version": "detect"
}
}
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"devDependencies": {
"@commitlint/cli": "^17.6.7",
"@commitlint/config-conventional": "^17.6.7",
"@types/node": "^20.14.12",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@types/styled-components": "^5.1.26",
Expand Down
8 changes: 7 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
"noFallthroughCasesInSwitch": true,
"baseUrl": ".",
"paths": {
"@/*": ["src/*"],
"@components/*": ["src/components/*"],
"@assets/*": ["src/assets/*"]
},
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
Expand Down
11 changes: 10 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import react from '@vitejs/plugin-react';
import path from 'path';
import { defineConfig } from 'vite';

import react from '@vitejs/plugin-react';

// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@assets': path.resolve(__dirname, './src/assets'),
'@components': path.resolve(__dirname, './src/components'),
},
},
plugins: [react()],
});

0 comments on commit 06afc64

Please sign in to comment.