Skip to content

Commit

Permalink
Added ESLint and Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
chandez committed Sep 2, 2022
1 parent 31f04c6 commit 63126d7
Show file tree
Hide file tree
Showing 6 changed files with 3,413 additions and 155 deletions.
51 changes: 51 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"root": true,
"ignorePatterns": ["projects/**/*"],
"overrides": [
{
"files": ["*.ts"],
"parserOptions": {
"project": ["tsconfig.json"],
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates",
"plugin:prettier/recommended"
],
"plugins": ["prettier"],
"rules": {
"@angular-eslint/no-empty-lifecycle-method": "off",
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "app",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "app",
"style": "kebab-case"
}
],
"prettier/prettier": "error"
}
},
{
"files": ["*.html"],
"extends": ["plugin:@angular-eslint/template/recommended", "plugin:prettier/recommended"],
"plugins": ["prettier"],
"rules": {
"@angular-eslint/template/conditional-complexity": ["error", { "maxComplexity": 4 }],
"@angular-eslint/template/cyclomatic-complexity": ["error", { "maxComplexity": 5 }],
"@angular-eslint/template/no-duplicate-attributes": "error",
"@angular-eslint/template/use-track-by-function": "off",
"prettier/prettier": "error"
}
}
]
}
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
build
coverage
dist
e2e
node_modules
24 changes: 24 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"arrow-body-style": "off",
"bracketSpacing": true,
"prefer-arrow-callback": "off",
"printWidth": 120,
"singleQuote": true,
"semi": true,
"trailingComma": "es5",
"useTabs": false,
"overrides": [
{
"files": "*.html",
"options": {
"parser": "html"
}
},
{
"files": "*.component.html",
"options": {
"parser": "angular"
}
}
]
}
28 changes: 12 additions & 16 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,8 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss",
"node_modules/ngx-toastr/toastr.css"
],
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.scss", "node_modules/ngx-toastr/toastr.css"],
"scripts": []
},
"configurations": {
Expand Down Expand Up @@ -92,20 +86,22 @@
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.scss"],
"scripts": []
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
}
}
}
}
},
"cli": {
"analytics": false
"analytics": false,
"schematicCollections": ["@angular-eslint/schematics"]
}
}
Loading

0 comments on commit 63126d7

Please sign in to comment.