diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..571f004 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,4 @@ +node_modules +package-lock.json +documentation +e2e \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json index 7e8a580..694e7de 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -15,7 +15,8 @@ }, "extends": [ "plugin:@angular-eslint/recommended", - "plugin:@typescript-eslint/recommended" + "plugin:@typescript-eslint/recommended", + "prettier" ], "rules": { "@angular-eslint/component-class-suffix": [ diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..571f004 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +node_modules +package-lock.json +documentation +e2e \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..88d3a63 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,6 @@ +{ + "endOfLine": "lf", + "printWidth": 80, + "tabWidth": 2, + "trailingComma": "es5" +} \ No newline at end of file diff --git a/README.md b/README.md index 78b5010..9211b21 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ [![default](https://user-images.githubusercontent.com/7531596/81993396-d5142b00-9645-11ea-995f-98342b7d5c8f.png)](https://github.com/wlucha/angular-starter) # Angular 12 + ESLint + Material + Transloco + Jest + Compodoc + Docker -Angular 12 Starter with ESLint, Material, Transloco, Jest & Compodoc -by [@wlucha](https://github.com/wlucha) +Angular 12 Starter with Material, Transloco, Jest & Compodoc + ![Angular12](https://img.shields.io/badge/Angular-12-brightgreen) [![Build](https://api.travis-ci.org/wlucha/angular-starter.svg?branch=master)](https://travis-ci.org/github/wlucha/angular-starter) @@ -17,13 +17,15 @@ by [@wlucha](https://github.com/wlucha) --> ## Features -✅ Angular 12 -✅ Material Theming -✅ Jest Unit Testing -✅ Internationalization with Transloco -✅ Auto documentation with Compodoc -✅ Analyse your project with webpack-bundle-analyzer -✅ Docker Support +✅ [Angular 12](https://angular.io/) +✅ [Angular Material](https://material.angular.io/) +✅ [Jest Unit Testing](https://jestjs.io/) +✅ Internationalization with [Transloco](https://github.com/ngneat/transloco) +✅ Auto documentation with [Compodoc](https://compodoc.app/) +✅ Analyse your project with [webpack-bundle-analyzer](https://www.npmjs.com/package/webpack-bundle-analyzer) +✅ [Docker](https://www.docker.com/) +✅ [ESLint](https://eslint.org/) +✅ [Prettier](https://prettier.io/) ## Deploy [![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy) @@ -69,6 +71,7 @@ https://hub.docker.com/r/wlucha/angular-starter - `npm run analyse` - analyse bundle with [webpack-bundle-analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer) - `npm run compodoc` - generate [compodoc](https://github.com/compodoc/compodoc) documentation - `npm run changelog` - generate changelog +- `npm run prettier` - format the whole project ## License MIT License diff --git a/package-lock.json b/package-lock.json index 94c947c..531e214 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10743,6 +10743,12 @@ } } }, + "eslint-config-prettier": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz", + "integrity": "sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==", + "dev": true + }, "eslint-import-resolver-node": { "version": "0.3.4", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", @@ -19054,6 +19060,12 @@ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, + "prettier": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz", + "integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==", + "dev": true + }, "pretty-bytes": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", diff --git a/package.json b/package.json index 3e72366..5e7d798 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "e2e": "ng e2e", "compodoc": "npx compodoc -p tsconfig.app.json", "changelog": "changelog", - "analyze": "webpack-bundle-analyzer dist/angular-starter/stats-es2015.json" + "analyze": "webpack-bundle-analyzer dist/angular-starter/stats-es2015.json", + "prettier": "prettier --write \"src/app/**/*.{js,json,css,scss,less,md,ts,html,component.html}\"" }, "private": true, "dependencies": { @@ -51,6 +52,7 @@ "@typescript-eslint/parser": "4.28.2", "codelyzer": "^6.0.0", "eslint": "^7.26.0", + "eslint-config-prettier": "^8.3.0", "eslint-plugin-import": "^2.23.4", "eslint-plugin-jsdoc": "^36.0.6", "eslint-plugin-prefer-arrow": "^1.2.3", @@ -58,6 +60,7 @@ "jest": "^25.1.0", "jest-junit": "^10.0.0", "jest-preset-angular": "^8.2.0", + "prettier": "2.3.2", "protractor": "~7.0.0", "ts-node": "~8.3.0", "typescript": "~4.3.5", diff --git a/sonar-project.properties b/sonar-project.properties index 91d72e0..906a283 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -5,7 +5,7 @@ sonar.projectVersion=1.0 sonar.sourceEncoding=UTF-8 sonar.sources=src/app -sonar.exclusions=src/app/*.module.ts, documentation/** +sonar.exclusions=src/app/*.module.ts,**/documentation/** sonar.tests=src/app sonar.test.inclusions=**/*.spec.ts