Skip to content

Commit 5d7f63d

Browse files
authored
ci: upgrade stylelint, husky (#47)
* ci: upgrade stylelint, husky * ci: support eslint
1 parent a0d6893 commit 5d7f63d

28 files changed

+32591
-14200
lines changed

.eslintrc.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* @type {import('eslint').Linter.Config}
3+
*/
4+
module.exports = {
5+
root: true,
6+
extends: ['@tinkoff/eslint-config-angular', '@tinkoff/eslint-config-angular/html'],
7+
ignorePatterns: ['projects/**/test.ts', '*.json', '*.less', '*.md', '*.js'],
8+
parser: '@typescript-eslint/parser',
9+
parserOptions: {
10+
ecmaVersion: 2020,
11+
sourceType: 'module',
12+
project: [require.resolve('./tsconfig.eslint.json')],
13+
},
14+
};

.github/workflows/lint.yml

+2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ jobs:
1111

1212
- name: Lint check
1313
run: |
14+
npm run typecheck
1415
npm run format -- --check
16+
npm run stylelint
1517
npm run lint
1618
1719
concurrency:

.husky/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/commit-msg

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
# shellcheck disable=SC1090
3+
. "$(dirname "$0")/_/husky.sh"
4+
5+
npx commitlint --edit $1

.husky/pre-commit

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
# shellcheck disable=SC1090
3+
. "$(dirname "$0")/_/husky.sh"
4+
5+
npx lint-staged
6+
npm run typecheck

.npmrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
legacy-peer-deps=true
2+
engine-strict=false
3+
lockfileVersion=2
4+
ignore-engines=true
5+
loglevel=error

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
**/coverage/**
33
**/schematics/*/files/**/*
44
package-lock.json
5+
.husky

.stylelintrc

-13
This file was deleted.

README.md

+37-26
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Angular Open-source Starter
22

3-
![Travis (.org)](https://img.shields.io/travis/TinkoffCreditSystems/angular-open-source-starter)
3+
[![Deploy](https://github.com/Tinkoff/angular-open-source-starter/actions/workflows/deploy.yml/badge.svg)](https://github.com/Tinkoff/angular-open-source-starter/actions/workflows/deploy.yml)
4+
[![Unit tests](https://github.com/Tinkoff/angular-open-source-starter/actions/workflows/test.yml/badge.svg)](https://github.com/Tinkoff/angular-open-source-starter/actions/workflows/test.yml)
5+
[![codecov](https://codecov.io/gh/Tinkoff/angular-open-source-starter/branch/main/graph/badge.svg?token=KfV90T6KkK)](https://codecov.io/gh/Tinkoff/angular-open-source-starter)
6+
[![Demo](https://img.shields.io/badge/demo-website-green)](https://tinkoff.github.io/angular-open-source-starter/)
47

58
## How to use
69

@@ -24,42 +27,50 @@
2427

2528
## Cool features
2629

27-
1. Versioning is ready for you with following simple commands:
30+
- [x] Versioning is ready for you with following simple commands:
2831

29-
```json
30-
"release": "standard-version",
31-
"release:patch": "npm run release -- --release-as patch",
32-
"release:minor": "npm run release -- --release-as minor",
33-
"release:major": "npm run release -- --release-as major",
34-
"publish": "npm run build:all && npm publish:all"
35-
```
32+
```json
33+
{
34+
"release": "standard-version",
35+
"release:patch": "npm run release -- --release-as patch",
36+
"release:minor": "npm run release -- --release-as minor",
37+
"release:major": "npm run release -- --release-as major",
38+
"publish": "npm run build:all && npm publish:all"
39+
}
40+
```
3641

37-
Just use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0-beta.4/) format and `CHANGELOG.md`
38-
will be automatically generated on releases by
39-
[Standard Version](https://github.com/conventional-changelog/standard-version#standard-version).
42+
Just use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0-beta.4/) format and `CHANGELOG.md` will be
43+
automatically generated on releases by
44+
[Standard Version](https://github.com/conventional-changelog/standard-version#standard-version).
4045

41-
2. This project has Angular Universal — you can easily test your library with SSR and Prerender:
46+
- [x] This project has Angular Universal — you can easily test your library with SSR and Prerender:
4247

43-
`npm run dev:ssr` or `npm run prerender`
48+
`npm run dev:ssr` or `npm run prerender`
4449

45-
3. CI and code coverage are ready, GitHub Action checks that packages build, test and lint correctly. It also sends
46-
test results to [Coveralls](https://coveralls.io).
50+
- [x] CI and code coverage are ready, GitHub Action checks that packages build, test and lint correctly. It also sends
51+
test results to [Codecov](https://about.codecov.io).
4752

48-
4. Precommit checks, prettier, linter and all that jazz is there.
53+
- [x] Precommit checks, prettier, linter and all that jazz is there.
4954

50-
5. You can also deploy your demo to [StackBlitz](https://stackblitz.com) with no hustle, just use link in the following
51-
format:
55+
- [x] You can also deploy your demo to [StackBlitz](https://stackblitz.com) with no hustle, just use link in the
56+
following format:
5257

53-
https://stackblitz.com/github/[User|Organization]/[Repository]/tree/main/projects/demo
58+
https://stackblitz.com/github/[User|Organization]/[Repository]/tree/main/projects/demo
5459

55-
6. You can add more libraries using the same `npm run add` command to create a whole Angular Workspace with multiple
56-
libraries. Versioning and publishing is configured that they are released simultaneously like Angular packages.
60+
- [x] You can add more libraries using the same `npm run add` command to create a whole Angular Workspace with multiple
61+
libraries. Versioning and publishing is configured that they are released simultaneously like Angular packages.
5762

58-
## View Engine
63+
## Infrastructure
5964

60-
This starter uses Angular 9. This way your libraries will be supported across all Angular versions in Ivy world. If you
61-
need to support older versions of Angular like 6 and above, you can use tag `view-engine` of this repository as your
62-
starting point as it is running Angular 7.
65+
- [x] GitHub Actions
66+
- [x] Node.js 16, npm 8
67+
- [ ] Nx 13+
68+
- [ ] Angular 12+
69+
- [ ] TypeScript 4+
70+
- [x] Prettier 2.6+
71+
- [x] Stylelint 14+
72+
- [x] ESLint 7+
73+
- [x] Husky 7+
6374

6475
## Badge
6576

angular.json

-7
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,6 @@
7373
"browsers": "ChromeHeadless"
7474
}
7575
},
76-
"lint": {
77-
"builder": "@angular-devkit/build-angular:tslint",
78-
"options": {
79-
"tsConfig": ["tsconfig.json"],
80-
"exclude": ["**/node_modules/**"]
81-
}
82-
},
8376
"server": {
8477
"builder": "@angular-devkit/build-angular:server",
8578
"options": {

codecov.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
codecov:
2+
branch: main
3+
notify:
4+
require_ci_to_pass: no
5+
6+
coverage:
7+
# This value is used to customize the visible color range in Codecov.
8+
# The first number represents the red, and the second represents green.
9+
# You can change the range of colors by adjusting this configuration.
10+
range: 50..100 # by default 70..100
11+
round: down
12+
precision: 2
13+
14+
# Disable codecov/patch check
15+
status:
16+
project:
17+
default:
18+
enabled: false
19+
patch:
20+
default:
21+
enabled: false

0 commit comments

Comments
 (0)