Skip to content

Commit

Permalink
Support Angular 16 (#18)
Browse files Browse the repository at this point in the history
* Add support for Angular 16.
* Rewritten CI testing for multiple NodeJS, ESLint and Angular version.
* Fix linting for lockfile. See lirantal/lockfile-lint#175 & isaacs/jackspeak#5
* Update all packages and run linting & Prettier.
* [Fix SonarCloud warning about duplicates in regex.](https://sonarcloud.io/project/issues?open=AYJ_Asgte7FPvNTvNf5F&id=jerone_eslint-plugin-angular-template-consistent-this)
* Connect SonarLint VSCode extension.
  • Loading branch information
jerone authored Sep 17, 2023
1 parent 4b0ef02 commit 38b9394
Show file tree
Hide file tree
Showing 9 changed files with 1,657 additions and 6,063 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,37 +26,44 @@ jobs:
# and assume that the intermediate versions are good.
node-version:
# Angular supported Node.js versions.
# https://gist.github.com/LayZeeDK/c822cc812f75bb07b7c55d07ba2719b3
# https://angular.io/guide/versions
- 14.15.0
- 16.10.0
- 16.14.0
- 18.10.0
# Latest Node.js version.
- latest
eslint-version: [7, 8]
# Angular ESLint version, and corresponding typescript-eslint version.
angular-eslint-version:
- [13, "5.27.1"]
- [14, "latest"]
- [15, "latest"]
- [16, "latest"]
exclude:
# Angular v16 dropped support for NodeJS v14.
- node-version: 14.15.0
angular-eslint-version: [16, "latest"]
steps:
- uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
# Cannot use `npm ci`, because this package uses ESLint plugins,
# which conflict with the different installations below.
# Also the package-lock file is to new for npm on older NodeJS versions.
- name: Install packages
run: npm ci --no-fund
run: npm install rimraf typescript jest jest-junit ts-jest
- name: Install Angular ESLint ${{ matrix.angular-eslint-version[0] }}
run: |
npm install --save-dev \
npm install \
@angular-eslint/template-parser@${{ matrix.angular-eslint-version[0] }} \
@angular-eslint/utils@${{ matrix.angular-eslint-version[0] }} \
@angular/compiler@${{ matrix.angular-eslint-version[0] }} \
@typescript-eslint/eslint-plugin@${{ matrix.angular-eslint-version[1] }} \
@typescript-eslint/parser@${{ matrix.angular-eslint-version[1] }}
- name: Install ESLint ${{ matrix.eslint-version }}
run: npm install --save-dev eslint@${{ matrix.eslint-version }}
run: npm install eslint@${{ matrix.eslint-version }}
- name: Run tests
run: npm run test
- name: Test Report
Expand Down
11 changes: 9 additions & 2 deletions .lockfile-lintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{
"allowedHosts": ["npm"],
"allowedHosts": [
"npm"
],
"allowedPackageNameAliases": [
"string-width-cjs:string-width",
"strip-ansi-cjs:strip-ansi",
"wrap-ansi-cjs:wrap-ansi"
],
"path": "package-lock.json",
"type": "npm",
"validateHttps": true,
"validatePackageNames": true
}
}
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,9 @@
"jsonc",
"yaml",
"markdown"
]
],
"sonarlint.connectedMode.project": {
"connectionId": "jerone",
"projectKey": "jerone_eslint-plugin-angular-template-consistent-this"
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Read more about this rule [in the documentation](https://github.com/jerone/eslin
You'll need to have an Angular project with the following packages installed:

- [ESLint](https://eslint.org/) - version 7 and 8 are tested.
- [Angular ESLint](https://github.com/angular-eslint/angular-eslint) - version 13, 14 & 15 are tested.
- [Angular ESLint](https://github.com/angular-eslint/angular-eslint) - version 13, 14 & 15 & 16 are tested.

## Installation

Expand Down
Loading

0 comments on commit 38b9394

Please sign in to comment.