Skip to content

Commit 0b9ab0a

Browse files
committed
Update @angular-eslint/template/i18n to ignore common nimble and sl-lib attributes
Change files
1 parent 3187bb3 commit 0b9ab0a

File tree

6 files changed

+69
-4
lines changed

6 files changed

+69
-4
lines changed

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ The goal of the smoke tests is basic validation that the eslint configurations c
4242
1. Create a fork of the repository.
4343
2. (optional, but recommended) On the Actions tab of your repository enable actions for the repo. This allows the tests to run in the branches of your fork.
4444
3. Create and edit a branch in your fork.
45-
4. Open a pull request to Nimble for the branch.
45+
4. Open a pull request to @ni/javascript-styleguide for the branch.
4646
- (optional, but recommended) While creating the pull request enable the "Allow edits and access to secrets by maintainers" option. This will allow maintainers to push small changes to the branch to resolve needed changes quicker.
4747
5. Create a beachball change file for your project by doing one of the following:
4848
1. Follow the [Beachball change file](#beachball-change-file) instructions below to create a change file and push to your branch.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Update @angular-eslint/template/i18n to ignore common nimble and sl-lib attributes",
4+
"packageName": "@ni/eslint-config-angular",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
module.exports = {
2+
nimble: [
3+
'action-menu-slot',
4+
'appearance',
5+
'appearance-variant',
6+
'column-id',
7+
'field-name',
8+
'format',
9+
'icon',
10+
'id-field-name',
11+
'key',
12+
'key-type',
13+
'orientation',
14+
'severity',
15+
'slot',
16+
'theme'
17+
],
18+
'systemlink-lib-angular': [
19+
// sl-workspace-selector
20+
'action',
21+
22+
// sl-table
23+
'columnId',
24+
'fieldName',
25+
'idFieldName',
26+
'selectionMode',
27+
'slTableColumnId',
28+
29+
// sl-grid
30+
'dataRowId',
31+
'loadColumnStateBehavior',
32+
'parentDataField'
33+
],
34+
jqx: [
35+
// smart-table
36+
'sortMode',
37+
38+
// smart-query-builder
39+
'applyMode',
40+
'fieldsMode'
41+
],
42+
material: [
43+
'cdkDragPreviewContainer',
44+
'floatLabel',
45+
'fontIcon',
46+
'fontSet',
47+
'matColumnDef',
48+
'matTooltipClass',
49+
]
50+
};

packages/eslint-config-angular/template.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const ignoreAttributes = require('./i18n-attributes-ignore');
2+
13
module.exports = {
24
extends: [
35
'plugin:@angular-eslint/template/recommended'
@@ -68,7 +70,13 @@ module.exports = {
6870
and new applications in the chance that they'll need to be localized in the future. Disable this rule
6971
if an application will never be localized.
7072
*/
71-
'@angular-eslint/template/i18n': ['error', { checkId: false }],
73+
'@angular-eslint/template/i18n': [
74+
'error',
75+
{
76+
checkId: false,
77+
ignoreAttributes: [...ignoreAttributes.nimble, ...ignoreAttributes['systemlink-lib-angular'], ...ignoreAttributes.jqx, ...ignoreAttributes.material]
78+
}
79+
],
7280

7381
'@angular-eslint/template/no-any': 'error',
7482

tests/angular/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<!-- Angular Template Smoke Test -->
2-
<span i18n [(id)]="name">Hello {{ name }}</span>!
2+
<span i18n [(id)]="name" theme="non-localized-theme-id" title="This title should be localized." i18n-title>Hello {{name}}</span>

tests/angular/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Component, Input } from '@angular/core';
33

44
@Component({
55
selector: 'app-root',
6-
template: '<span i18n [(id)]="name">Hello {{name}}</span>!',
6+
template: '<span i18n [(id)]="name" theme="non-localized-theme-id" title="This title should be localized." i18n-title>Hello {{name}}</span>!',
77
styles: [`
88
span {
99
font-weight: bold;

0 commit comments

Comments
 (0)