Skip to content

Commit

Permalink
#19 #18 Switch from tslint to eslint and add prettier
Browse files Browse the repository at this point in the history
Also
- set prettier as default vscode formatter
- set some default rules
  • Loading branch information
artfulsage committed Dec 10, 2020
1 parent 7939a91 commit 1cde125
Show file tree
Hide file tree
Showing 6 changed files with 1,364 additions and 140 deletions.
46 changes: 46 additions & 0 deletions src/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"root": true,
"extends": ["plugin:angular/johnpapa"],
"rules": {
"eol-last": "error",
"array-bracket-newline": ["error", { "multiline": true }],
"array-bracket-spacing": [
"error",
"always",
{
"singleValue": false
}
],
"array-element-newline": ["error", "consistent"],
"object-curly-spacing": ["error", "always"],
"object-curly-newline": ["error", { "multiline": true }],
"object-property-newline": [
"error",
{
"allowAllPropertiesOnSameLine": true
}
]
},
"overrides": [
{
"files": ["*.ts"],
"parserOptions": {
"project": ["tsconfig.*?.json", "e2e/tsconfig.json"],
"createDefaultProgram": true
},
"extends": ["plugin:@angular-eslint/recommended"],
"rules": {}
},
{
"files": ["*.component.html"],
"extends": ["plugin:@angular-eslint/template/recommended"],
"rules": {
"max-len": ["error", { "code": 140 }]
}
},
{
"files": ["*.component.ts"],
"extends": ["plugin:@angular-eslint/template/process-inline-templates"]
}
]
}
7 changes: 7 additions & 0 deletions src/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"singleQuote": true,
"trailingComma": "es5",
"useTabs": false,
"tabWidth": 2,
"semi": true
}
3 changes: 3 additions & 0 deletions src/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
}
12 changes: 4 additions & 8 deletions src/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,11 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.component.html"
]
}
},
Expand Down
Loading

0 comments on commit 1cde125

Please sign in to comment.