Skip to content

Commit

Permalink
Merge pull request #2 from Eccoar/142_linting
Browse files Browse the repository at this point in the history
Solve #142 Configurar ESLINT nos repositórios de microsserviços
  • Loading branch information
devsalula authored Apr 10, 2021
2 parents a63c4cc + 6c78251 commit 13fd5f5
Show file tree
Hide file tree
Showing 18 changed files with 7,921 additions and 7,062 deletions.
33 changes: 22 additions & 11 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
]
}
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2019,
"sourceType": "module",
"project": "./tsconfig.json"
},
"plugins": ["@typescript-eslint/eslint-plugin"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"eslint-config-prettier"
],
"ignorePatterns": ["db/**/*", "jest.config.js"],
"rules": {
"strict": ["error", "never"],
"@typescript-eslint/explicit-module-boundary-types": "error",
"semi": "off",
"@typescript-eslint/semi": ["error"]
}
}
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@
node_modules/
build/
tmp/
temp/
temp/

coverage/
test-report.json
test-report.xml
lint-report.html
.eslintcache
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged && npm run validate
18 changes: 18 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxBracketSameLine": false,
"jsxSingleQuote": true,
"printWidth": 80,
"proseWrap": "always",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": true,
"tabWidth": 4,
"trailingComma": "all",
"useTabs": true,
"vueIndentScriptAndStyle": false
}
14 changes: 11 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
preset: 'ts-jest',
testEnvironment: 'node',
testPathIgnorePatterns: ['build'],
moduleNameMapper: {
'@controllers/(.*)': '<rootDir>/src/controllers/$1',
'@entity/(.*)': '<rootDir>/src/entity/$1',
'@repositories/(.*)': '<rootDir>/src/repositories/$1',
'@services/(.*)': '<rootDir>/src/services/$1',
'@utils/(.*)': '<rootDir>/src/utils/$1',
},
};
Loading

0 comments on commit 13fd5f5

Please sign in to comment.