Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19,225 changes: 16,187 additions & 3,038 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions tests/angular/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
/.angular
/dist
6 changes: 4 additions & 2 deletions tests/angular/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Angular Smoke Test

## Overview
This package is a smoke test for using the Angular rules in an Angular workspace. See [CONTRIBUTING.md](../../CONTRIBUTING.md#smoke-tests) for more information on smoke tests.

This package is a smoke test for using the Angular rules in a project. See [CONTRIBUTING.md](../../CONTRIBUTING.md#smoke-tests) for more information.
## Testing

- The `npm test` script runs the linter to test that the lint configuration functions correctly with `ng lint` and and also runs `ng test`.
132 changes: 132 additions & 0 deletions tests/angular/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"angular-test": {
"projectType": "application",
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist/angular-test",
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": [
"zone.js",
"@angular/localize/init"
],
"tsConfig": "tsconfig.app.json"
},
"configurations": {
"production": {
"outputHashing": "all"
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"buildTarget": "angular-test:build:production"
},
"development": {
"buildTarget": "angular-test:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"browsers": "ChromeHeadlessNoSandbox",
"polyfills": [
"zone.js",
"zone.js/testing",
"@angular/localize/init"
],
"tsConfig": "tsconfig.spec.json",
"watch": false
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.js",
"src/**/*.mjs",
"src/**/*.html"
]
}
}
}
},
"angular-library": {
"projectType": "library",
"root": "projects/angular-library",
"sourceRoot": "projects/angular-library/src",
"prefix": "angular-lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"project": "projects/angular-library/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/angular-library/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "projects/angular-library/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"browsers": "ChromeHeadlessNoSandbox",
"polyfills": [
"zone.js",
"zone.js/testing",
"@angular/localize/init"
],
"tsConfig": "projects/angular-library/tsconfig.spec.json",
"watch": false
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"projects/angular-library/**/*.ts",
"projects/angular-library/**/*.js",
"projects/angular-library/**/*.mjs",
"projects/angular-library/**/*.html"
],
"eslintConfig": "projects/angular-library/eslint.config.mjs"
}
}
}
}
},
"cli": {
"analytics": false,
"schematicCollections": [
"angular-eslint"
]
}
}
2 changes: 0 additions & 2 deletions tests/angular/custom-ignore-attributes/index.html

This file was deleted.

24 changes: 0 additions & 24 deletions tests/angular/custom-ignore-attributes/index.spec.ts

This file was deleted.

15 changes: 0 additions & 15 deletions tests/angular/custom-ignore-attributes/index.ts

This file was deleted.

37 changes: 0 additions & 37 deletions tests/angular/eslint.config.js

This file was deleted.

38 changes: 38 additions & 0 deletions tests/angular/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { defineConfig, globalIgnores } from 'eslint/config';
import { angularTypescriptConfig, angularTemplateConfig, ignoreAttributes } from '@ni/eslint-config-angular';
import { javascriptConfig, importNodeEsmConfig } from '@ni/eslint-config-javascript';

export default defineConfig([
globalIgnores(['projects']),
{
files: ['**/*.js', '**/*.mjs'],
extends: [javascriptConfig, importNodeEsmConfig]
}, {
files: ['**/*.ts'],
extends: angularTypescriptConfig,
languageOptions: {
parserOptions: {
project: ['tsconfig.app.json', 'tsconfig.spec.json', 'tsconfig.json']
}
},
rules: {
'@angular-eslint/component-selector': [
'error', { prefix: 'app', style: 'kebab-case', type: 'element' }
]
}
}, {
files: ['**/*.spec.ts'],
rules: {
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off'
}
}, {
files: ['**/*.html'],
extends: angularTemplateConfig,
rules: {
'@angular-eslint/template/i18n': [
'error',
{ checkId: false, ignoreAttributes: [...ignoreAttributes.all, 'custom-field'] }
]
}
}]);
24 changes: 0 additions & 24 deletions tests/angular/index.spec.ts

This file was deleted.

Loading