Skip to content

Commit f7efb1a

Browse files
authored
chore: add prettier to workspace (#26)
Add prettier to workspace and enable the precommit hook and linter closes #3
1 parent 5ceeb7f commit f7efb1a

File tree

123 files changed

+13512
-2136
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+13512
-2136
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules
22
dist
33
lerna-debug.log
4-
yarn-debug.log
4+
yarn-debug.log
5+
yarn-error.log

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist
2+
coverage

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all"
4+
}

.yarnrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--install.exact true
1+
--add.exact true

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ This repo utilizes [Yarn Workspaces](https://yarnpkg.com/lang/en/docs/workspaces
66

77
## Commit Message Guidelines
88

9-
We follow the [Conventional Commits](https://conventionalcommits.org/) guidelines. These are enforced through the use of [commitlint](http://marionebl.github.io/commitlint). If you would like a more interactive way of formatting your commit messages, run `yarn commit` once your changes are staged.
9+
We follow the [Conventional Commits](https://conventionalcommits.org/) guidelines. These are enforced through the use of [commitlint](http://marionebl.github.io/commitlint). If you would like a more interactive way of formatting your commit messages, run `yarn commit` once your changes are staged.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# @angular-redux
2+
23
[![CircleCI](https://circleci.com/gh/angular-redux/platform/tree/master.svg?style=svg)](https://circleci.com/gh/angular-redux/platform/tree/master)
34

45
[Redux](https://redux.js.org/) bindings for [Angular](https://angular.io/) applications.

package.json

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,23 @@
77
"build": "lerna run build",
88
"lint": "lerna run lint",
99
"commit": "commit",
10-
"commitmsg": "commitlint -E GIT_PARAMS"
10+
"prettier": "prettier --write \"**/*.*(ts|js|css|scss|json|md)\"",
11+
"pre-commit": "lint-staged",
12+
"commit-msg": "commitlint -E GIT_PARAMS"
13+
},
14+
"lint-staged": {
15+
"*.{ts,js,css,scss,json,md}": [
16+
"prettier --write",
17+
"git add"
18+
]
1119
},
1220
"devDependencies": {
13-
"@commitlint/cli": "^7.0.0",
14-
"@commitlint/config-conventional": "^7.0.1",
15-
"@commitlint/prompt-cli": "^7.0.0",
16-
"husky": "^0.14.3",
17-
"lerna": "2.11.0"
21+
"@commitlint/cli": "7.0.0",
22+
"@commitlint/config-conventional": "7.0.1",
23+
"@commitlint/prompt-cli": "7.0.0",
24+
"husky": "0.14.3",
25+
"lerna": "2.11.0",
26+
"lint-staged": "7.2.0",
27+
"prettier": "1.13.7"
1828
}
1929
}

packages/example-app/.angular-cli.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,15 @@
77
{
88
"root": "src",
99
"outDir": "dist",
10-
"assets": [
11-
"assets",
12-
"favicon.ico"
13-
],
10+
"assets": ["assets", "favicon.ico"],
1411
"index": "index.html",
1512
"main": "main.ts",
1613
"polyfills": "polyfills.ts",
1714
"test": "test.ts",
1815
"tsconfig": "tsconfig.app.json",
1916
"testTsconfig": "tsconfig.spec.json",
2017
"prefix": "zoo",
21-
"styles": [
22-
"styles.css"
23-
],
18+
"styles": ["styles.css"],
2419
"scripts": [],
2520
"environmentSource": "environments/environment.ts",
2621
"environments": {

packages/example-app/README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@
55
This is a sample project showing how the following packages work together to make a simple
66
application.
77

8-
* [redux](https://github.com/reactjs/redux) Predictable state container for Javascript.
9-
* [redux-observable](https://github.com/redux-observable/redux-observable) Side-effect handling with Observables
10-
* [@angular-redux/store](https://github.com/angular-redux/store) Redux + Angular bindings
11-
* [@angular-redux/router](https://github.com/angular-redux/router) Time travel with the Angular router
12-
* [@angular-redux/form](https://github.com/angular-redux/form) Time travel with Angular forms
13-
* [Redux DevTools Chrome Extension](https://github.com/zalmoxisus/redux-devtools-extension)
8+
- [redux](https://github.com/reactjs/redux) Predictable state container for Javascript.
9+
- [redux-observable](https://github.com/redux-observable/redux-observable) Side-effect handling with Observables
10+
- [@angular-redux/store](https://github.com/angular-redux/store) Redux + Angular bindings
11+
- [@angular-redux/router](https://github.com/angular-redux/router) Time travel with the Angular router
12+
- [@angular-redux/form](https://github.com/angular-redux/form) Time travel with Angular forms
13+
- [Redux DevTools Chrome Extension](https://github.com/zalmoxisus/redux-devtools-extension)
1414

1515
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.0.0-rc.0.
1616

1717
## Development server
18+
1819
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
1920

2021
## Code scaffolding

packages/example-app/karma.conf.js

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Karma configuration file, see link for more information
22
// https://karma-runner.github.io/0.13/config/configuration-file.html
33

4-
module.exports = function (config) {
4+
module.exports = function(config) {
55
config.set({
66
basePath: '',
77
frameworks: ['jasmine', '@angular/cli'],
@@ -10,35 +10,34 @@ module.exports = function (config) {
1010
require('karma-chrome-launcher'),
1111
require('karma-jasmine-html-reporter'),
1212
require('karma-coverage-istanbul-reporter'),
13-
require('@angular/cli/plugins/karma')
13+
require('@angular/cli/plugins/karma'),
1414
],
15-
client:{
16-
clearContext: false // leave Jasmine Spec Runner output visible in browser
15+
client: {
16+
clearContext: false, // leave Jasmine Spec Runner output visible in browser
1717
},
18-
files: [
19-
{ pattern: './src/test.ts', watched: false }
20-
],
18+
files: [{ pattern: './src/test.ts', watched: false }],
2119
preprocessors: {
22-
'./src/test.ts': ['@angular/cli']
20+
'./src/test.ts': ['@angular/cli'],
2321
},
2422
mime: {
25-
'text/x-typescript': ['ts','tsx']
23+
'text/x-typescript': ['ts', 'tsx'],
2624
},
2725
coverageIstanbulReporter: {
28-
reports: [ 'html', 'lcovonly' ],
29-
fixWebpackSourcePaths: true
26+
reports: ['html', 'lcovonly'],
27+
fixWebpackSourcePaths: true,
3028
},
3129
angularCli: {
32-
environment: 'dev'
30+
environment: 'dev',
3331
},
34-
reporters: config.angularCli && config.angularCli.codeCoverage
35-
? ['progress', 'coverage-istanbul']
36-
: ['progress', 'kjhtml'],
32+
reporters:
33+
config.angularCli && config.angularCli.codeCoverage
34+
? ['progress', 'coverage-istanbul']
35+
: ['progress', 'kjhtml'],
3736
port: 9876,
3837
colors: true,
3938
logLevel: config.LOG_INFO,
4039
autoWatch: true,
4140
browsers: ['Chrome'],
42-
singleRun: false
41+
singleRun: false,
4342
});
4443
};

0 commit comments

Comments
 (0)