-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add experimental
skyux-eslint
package for custom ESLint rules (…
- Loading branch information
1 parent
26f9841
commit 659d628
Showing
92 changed files
with
3,102 additions
and
1,418 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -8,6 +8,8 @@ | |
"novalidate", | ||
"pillarbox", | ||
"tabindex", | ||
"Tmpl", | ||
"TSES", | ||
"xlink" | ||
] | ||
} |
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 |
---|---|---|
|
@@ -90,4 +90,5 @@ jobs: | |
sdk/e2e-schematics | ||
sdk/eslint-config | ||
sdk/prettier-schematics | ||
sdk/skyux-eslint | ||
sdk/testing |
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
"packages", | ||
"prettier-schematics", | ||
"router", | ||
"skyux-eslint", | ||
"storybook", | ||
"testing" | ||
], | ||
|
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,44 +1,24 @@ | ||
const { FlatCompat } = require('@eslint/eslintrc'); | ||
const js = require('@eslint/js'); | ||
const path = require('node:path'); | ||
// @ts-check | ||
const tsEslint = require('typescript-eslint'); | ||
const skyux = require('../../libs/sdk/skyux-eslint/dev-transpiler.cjs'); | ||
const config = require('../../eslint-apps.config'); | ||
|
||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
}); | ||
|
||
module.exports = [ | ||
module.exports = tsEslint.config( | ||
...config, | ||
...compat | ||
.config({ | ||
extends: ['../../libs/sdk/eslint-config/recommended'], | ||
}) | ||
.map((config) => ({ | ||
files: ['**/src/app/code-examples/**/*.ts'], | ||
languageOptions: { | ||
...config.languageOptions, | ||
parserOptions: { | ||
project: [path.join(__dirname, 'tsconfig.editor.json')], | ||
tsconfigRootDir: '.', | ||
}, | ||
}, | ||
linterOptions: { reportUnusedDisableDirectives: true }, | ||
rules: { | ||
...config.rules, | ||
'no-alert': 'warn', | ||
'no-console': 'warn', | ||
'no-restricted-imports': [ | ||
'error', | ||
{ | ||
patterns: [ | ||
{ | ||
group: ['../*'], | ||
message: 'Make sure to import from local files only.', | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
})), | ||
]; | ||
{ | ||
files: ['**/src/app/code-examples/**/*.ts'], | ||
extends: [...skyux.configs.tsAll], | ||
rules: { | ||
'@typescript-eslint/no-deprecated': 'warn', | ||
'no-alert': 'warn', | ||
'no-console': 'warn', | ||
}, | ||
}, | ||
{ | ||
files: ['**/src/app/code-examples/**/*.html'], | ||
extends: [...skyux.configs.templateAll], | ||
rules: { | ||
'skyux-eslint-template/no-deprecated-directives': 'warn', | ||
}, | ||
}, | ||
); |
3 changes: 1 addition & 2 deletions
3
...-examples/src/app/code-examples/action-bars/summary-action-bar/modal/modal.component.html
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
3 changes: 1 addition & 2 deletions
3
...de-examples/src/app/code-examples/ag-grid/data-entry-grid/basic/edit-modal.component.html
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
3 changes: 1 addition & 2 deletions
3
...rc/app/code-examples/ag-grid/data-entry-grid/data-manager-added/edit-modal.component.html
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
3 changes: 1 addition & 2 deletions
3
...mples/src/app/code-examples/ag-grid/data-entry-grid/inline-help/edit-modal.component.html
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
2 changes: 1 addition & 1 deletion
2
...ples/src/app/code-examples/ag-grid/data-entry-grid/inline-help/inline-help.component.html
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,5 +1,5 @@ | ||
<sky-help-inline | ||
class="sky-control-help" | ||
ariaLabel="Information about {{ displayName }}" | ||
[ariaLabel]="'Information about ' + displayName" | ||
(actionClick)="onHelpClick()" | ||
/> |
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
12 changes: 1 addition & 11 deletions
12
apps/code-examples/src/app/code-examples/core/id/demo.component.html
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,11 +1 @@ | ||
<sky-input-box> | ||
<label class="sky-control-label" [for]="input1.id"> Label </label> | ||
<input #input1="skyId" class="sky-form-control" type="text" skyId /> | ||
</sky-input-box> | ||
|
||
<sky-input-box> | ||
<label class="sky-control-label" [for]="input2.id"> Label </label> | ||
<select #input2="skyId" class="sky-form-control" skyId> | ||
<option>Value</option> | ||
</select> | ||
</sky-input-box> | ||
<div #myDiv="skyId" skyId>This DIV's id is '{{ myDiv.id }}'</div> |
3 changes: 1 addition & 2 deletions
3
apps/code-examples/src/app/code-examples/core/id/demo.component.ts
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,11 +1,10 @@ | ||
import { Component } from '@angular/core'; | ||
import { SkyIdModule } from '@skyux/core'; | ||
import { SkyInputBoxModule } from '@skyux/forms'; | ||
|
||
@Component({ | ||
standalone: true, | ||
selector: 'app-demo', | ||
templateUrl: './demo.component.html', | ||
imports: [SkyIdModule, SkyInputBoxModule], | ||
imports: [SkyIdModule], | ||
}) | ||
export class DemoComponent {} |
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
68 changes: 31 additions & 37 deletions
68
apps/code-examples/src/app/code-examples/forms/character-count/demo.component.html
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,39 +1,33 @@ | ||
<div style="width: 50%"> | ||
<form [formGroup]="formGroup"> | ||
<sky-input-box stacked="true"> | ||
<label class="sky-control-label" [for]="descriptionInput.id"> | ||
Transaction description | ||
</label> | ||
<form [formGroup]="formGroup"> | ||
<sky-input-box stacked="true" labelText="Transaction description"> | ||
<sky-character-counter-indicator | ||
#descriptionIndicator | ||
data-sky-id="description-indicator" | ||
/> | ||
|
||
<sky-character-counter-indicator | ||
#descriptionIndicator | ||
data-sky-id="description-indicator" | ||
/> | ||
<input | ||
#descriptionInput="skyId" | ||
class="sky-form-control description-input" | ||
formControlName="description" | ||
skyCharacterCounter | ||
skyId | ||
type="text" | ||
[attr.aria-describedby]="characterCountError.id" | ||
[skyCharacterCounterIndicator]="descriptionIndicator" | ||
[skyCharacterCounterLimit]="maxDescriptionCharacterCount" | ||
/> | ||
|
||
<input | ||
#descriptionInput="skyId" | ||
class="sky-form-control description-input" | ||
formControlName="description" | ||
skyCharacterCounter | ||
skyId | ||
type="text" | ||
[attr.aria-describedby]="characterCountError.id" | ||
[skyCharacterCounterIndicator]="descriptionIndicator" | ||
[skyCharacterCounterLimit]="maxDescriptionCharacterCount" | ||
/> | ||
|
||
<span #characterCountError="skyId" class="sky-error-indicator" skyId> | ||
@if (description.errors?.['skyCharacterCounter']) { | ||
<sky-status-indicator | ||
data-sky-id="description-status-indicator-over-limit" | ||
descriptionType="error" | ||
indicatorType="danger" | ||
> | ||
Limit Transaction description to | ||
{{ maxDescriptionCharacterCount }} characters. | ||
</sky-status-indicator> | ||
} | ||
</span> | ||
</sky-input-box> | ||
</form> | ||
</div> | ||
<span #characterCountError="skyId" class="sky-error-indicator" skyId> | ||
@if (description.errors?.['skyCharacterCounter']) { | ||
<sky-status-indicator | ||
data-sky-id="description-status-indicator-over-limit" | ||
descriptionType="error" | ||
indicatorType="danger" | ||
> | ||
Limit Transaction description to | ||
{{ maxDescriptionCharacterCount }} characters. | ||
</sky-status-indicator> | ||
} | ||
</span> | ||
</sky-input-box> | ||
</form> |
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
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
Oops, something went wrong.