-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(template): update dependencies of angular template (#12184)
Fixes TIMOB-28200
- Loading branch information
Showing
6 changed files
with
115 additions
and
58 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
/** | ||
* ----------------------------------------------------- | ||
* NOTES ON CONFIGURATION STRUCTURE | ||
* ----------------------------------------------------- | ||
* | ||
* Out of the box, ESLint does not support TypeScript or HTML. Naturally those are the two | ||
* main file types we care about in Angular projects, so we have to do a little extra work | ||
* to configure ESLint exactly how we need to. | ||
* | ||
* Fortunately, ESLint gives us an "overrides" configuration option which allows us to set | ||
* different lint tooling (parser, plugins, rules etc) for different file types, which is | ||
* critical because our .ts files require a different parser and different rules to our | ||
* .html (and our inline Component) templates. | ||
*/ | ||
{ | ||
"root": true, | ||
"overrides": [ | ||
/** | ||
* ----------------------------------------------------- | ||
* TYPESCRIPT FILES (COMPONENTS, SERVICES ETC) (.ts) | ||
* ----------------------------------------------------- | ||
*/ | ||
{ | ||
"files": ["*.ts"], | ||
"parserOptions": { | ||
"project": [ | ||
"tsconfig.*?.json" | ||
], | ||
"createDefaultProgram": true | ||
}, | ||
"extends": ["plugin:@angular-eslint/recommended"], | ||
"rules": { | ||
/** | ||
* Any TypeScript related rules you wish to use/reconfigure over and above the | ||
* recommended set provided by the @angular-eslint project would go here. | ||
* | ||
* There are some examples below from the @angular-eslint plugin and ESLint core: | ||
*/ | ||
"@angular-eslint/directive-selector": [ | ||
"error", | ||
{ "type": "attribute", "prefix": "app", "style": "camelCase" } | ||
], | ||
"@angular-eslint/component-selector": [ | ||
"error", | ||
{ "type": "element", "prefix": "app", "style": "kebab-case" } | ||
], | ||
"quotes": ["error", "single", { "allowTemplateLiterals": true }] | ||
} | ||
}, | ||
|
||
/** | ||
* ----------------------------------------------------- | ||
* COMPONENT TEMPLATES | ||
* ----------------------------------------------------- | ||
* | ||
* If you use inline templates, make sure you read the notes on the configuration | ||
* object after this one to understand how they relate to this configuration directly | ||
* below. | ||
*/ | ||
{ | ||
"files": ["*.component.html"], | ||
"extends": ["plugin:@angular-eslint/template/recommended"], | ||
"rules": { | ||
/** | ||
* Any template/HTML related rules you wish to use/reconfigure over and above the | ||
* recommended set provided by the @angular-eslint project would go here. | ||
* | ||
* There is an example below from ESLint core (note, this specific example is not | ||
* necessarily recommended for all projects): | ||
*/ | ||
"max-len": ["error", { "code": 140 }] | ||
} | ||
}, | ||
|
||
/** | ||
* ----------------------------------------------------- | ||
* EXTRACT INLINE TEMPLATES (from within .component.ts) | ||
* ----------------------------------------------------- | ||
* | ||
* This extra piece of configuration is necessary to extract inline | ||
* templates from within Component metadata, e.g.: | ||
* | ||
* @Component({ | ||
* template: `<h1>Hello, World!</h1>` | ||
* }) | ||
* ... | ||
* | ||
* It works by extracting the template part of the file and treating it as | ||
* if it were a full .html file, and it will therefore match the configuration | ||
* specific for *.component.html above when it comes to actual rules etc. | ||
* | ||
* NOTE: This processor will skip a lot of work when it runs if you don't use | ||
* inline templates in your projects currently, so there is no great benefit | ||
* in removing it, but you can if you want to. | ||
* | ||
* You won't specify any rules here. As noted above, the rules that are relevant | ||
* to inline templates are the same as the ones defined for *.component.html. | ||
*/ | ||
{ | ||
"files": ["*.component.ts"], | ||
"extends": ["plugin:@angular-eslint/template/process-inline-templates"] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { platformTitanium } from 'titanium-angular'; | ||
import { AppModuleNgFactory } from "./app/app.module.ngfactory"; | ||
import { AppModuleNgFactory } from './app/app.module.ngfactory'; | ||
|
||
platformTitanium().bootstrapModuleFactory(AppModuleNgFactory); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
templates/app/angular-default/template/typings/node/index.d.ts
This file was deleted.
Oops, something went wrong.