Skip to content

Commit

Permalink
chore: eslint prettier and husky initial config
Browse files Browse the repository at this point in the history
  • Loading branch information
buka4rill committed Jun 9, 2024
1 parent 35146f4 commit 5ce5388
Show file tree
Hide file tree
Showing 7 changed files with 742 additions and 18 deletions.
57 changes: 42 additions & 15 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,52 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
env: {
browser: true,
es2021: true,
node: true,
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
],
root: true,
env: {
node: true,
jest: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 13,
sourceType: 'module',
project: ['./tsconfig.json'],
},
ignorePatterns: ['.eslintrc.js'],
ignorePatterns: ['build/', 'public/', '/docs'],
plugins: ['@typescript-eslint'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-floating-promises': 'warn',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'import/no-restricted-paths': [
'error',
{
zones: [
{
target: './src/**/domain/**.*ts',
from: './src/**/infra/**/*.ts',
},
{
target: './src/**/domain/**.*ts',
from: './src/**/usecases/**/*.ts',
},
{
target: './src/**/domain/**.*ts',
from: './src/**/app/**/*.ts',
},
],
},
],
},
};
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
build
coverage
7 changes: 5 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"printWidth": 120,
"arrowParens": "avoid",
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "all"
}
"trailingComma": "es5"
}
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"command": "npm run test",
"name": "Test",
"request": "launch",
"type": "node-terminal"
}
]
}
30 changes: 30 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"workbench.colorCustomizations": {
"activityBar.background": "#333d2a",
"activityBar.activeBackground": "#333d2a",
"activityBar.activeBorder": "#5b6e84",
"activityBar.foreground": "#e7e7e7",
"activityBar.inactiveForeground": "#e7e7e799",
"activityBarBadge.background": "#5b6e84",
"activityBarBadge.foreground": "#e7e7e7",
"statusBar.background": "#1a1f15",
"statusBarItem.hoverBackground": "#333d2a",
"statusBar.foreground": "#e7e7e7",
"panel.border": "#333d2a",
"sideBar.border": "#333d2a",
"editorGroup.border": "#333d2a"
},
"peacock.color": "#1a1f15",
"eslint.validate": [
"javascript",
"javascriptreact",
{ "language": "typescript", "autoFix": true },
{ "language": "typescriptreact", "autoFix": true }
],
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
}
}
Loading

0 comments on commit 5ce5388

Please sign in to comment.