Skip to content

Commit c209161

Browse files
feat(ref:#106): now with eslint9
feat(ref:#106): now with eslint9
2 parents dbe217b + d81e6d8 commit c209161

File tree

17 files changed

+1194
-1614
lines changed

17 files changed

+1194
-1614
lines changed

.eslintignore

Lines changed: 0 additions & 19 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 107 deletions
This file was deleted.

.github/hooks/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ npm run test
1919
npm run build
2020

2121
npm run build:lib
22+

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
build:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
13-
- uses: actions/setup-node@v3
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
1414
with:
15-
node-version: 18
15+
node-version: 20
1616
registry-url: https://registry.npmjs.org/
1717
- name: Build library
1818
run: |
@@ -69,4 +69,4 @@ jobs:
6969
]
7070
}
7171
env:
72-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
72+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

.github/workflows/quality-check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
permissions:
1818
contents: write
1919
steps:
20-
- uses: actions/checkout@v3
21-
- uses: actions/setup-node@v3
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-node@v4
2222
with:
23-
node-version: 18
23+
node-version: 20
2424
- name: Check quality
2525
run: |
2626
npm ci --force

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ import {NgxLoaderIndicatorModule} from 'ngx-loader-indicator'
9393
### Usage
9494

9595
```html
96-
<div [loader]="isLoading">Content</div>
96+
<div [ngxLoaderIndicator]="isLoading">Content</div>
9797
```
9898

9999
#### Examples
100100

101101
```html
102-
<form (ngSubmit)="save(form.value)" [formGroup]="form" [loader]="isLoading">
102+
<form (ngSubmit)="save(form.value)" [formGroup]="form" [ngxLoaderIndicator]="isLoading">
103103
<h2>Login</h2>
104104
<input matInput type="email" placeholder="Email" #email formControlName="email">
105105
<input matInput type="password" placeholder="Password" #name formControlName="password">

eslint.config.js

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
// @ts-check
2+
const globals = require('globals');
3+
// Allows us to bring in the recommended core rules from eslint itself
4+
const eslint = require('@eslint/js');
5+
6+
// Allows us to use the typed utility for our config, and to bring in the recommended rules for TypeScript projects from typescript-eslint
7+
const tseslint = require('typescript-eslint');
8+
9+
// Allows us to bring in the recommended rules for Angular projects from angular-eslint
10+
const angular = require('angular-eslint');
11+
12+
const json = require('eslint-plugin-json');
13+
14+
const ignores = [
15+
'dist/',
16+
'tmp/',
17+
'out-tsc/',
18+
'bazel-out/',
19+
'node_modules/',
20+
'.idea/',
21+
'.vscode/',
22+
'.history/',
23+
'.angular/',
24+
'coverage/',
25+
'coverage-ts/',
26+
'package-lock.json',
27+
];
28+
29+
// Export our config array, which is composed together thanks to the typed utility function from typescript-eslint
30+
module.exports = tseslint.config(
31+
{
32+
ignores,
33+
},
34+
{
35+
// Everything in this config object targets our TypeScript files (Components, Directives, Pipes etc)
36+
files: ['**/*.ts'],
37+
extends: [
38+
// Apply the recommended core rules
39+
eslint.configs.recommended,
40+
// Apply the recommended TypeScript rules
41+
...tseslint.configs.recommended,
42+
// Optionally apply stylistic rules from typescript-eslint that improve code consistency
43+
...tseslint.configs.stylistic,
44+
// Apply the recommended Angular rules
45+
...angular.configs.tsRecommended,
46+
],
47+
// Set the custom processor which will allow us to have our inline Component templates extracted
48+
// and treated as if they are HTML files (and therefore have the .html config below applied to them)
49+
processor: angular.processInlineTemplates,
50+
// Override specific rules for TypeScript files (these will take priority over the extended configs above)
51+
rules: {
52+
'@angular-eslint/directive-selector': [
53+
'error',
54+
{
55+
type: 'attribute',
56+
prefix: ['ngxLoaderIndicator','jsdaddy'],
57+
style: 'camelCase',
58+
},
59+
],
60+
'@angular-eslint/component-selector': [
61+
'error',
62+
{
63+
type: 'element',
64+
prefix: 'jsdaddy',
65+
style: 'kebab-case',
66+
},
67+
],
68+
},
69+
},
70+
{
71+
// Everything in this config object targets our HTML files (external templates,
72+
// and inline templates as long as we have the `processor` set on our TypeScript config above)
73+
files: ['**/*.html'],
74+
extends: [
75+
// Apply the recommended Angular template rules
76+
...angular.configs.templateRecommended,
77+
// Apply the Angular template rules which focus on accessibility of our apps
78+
...angular.configs.templateAccessibility,
79+
],
80+
rules: {},
81+
},
82+
{
83+
files: ['**/*.js'],
84+
extends: [eslint.configs.recommended],
85+
languageOptions: {
86+
sourceType: 'commonjs',
87+
globals: {
88+
...globals.node,
89+
},
90+
},
91+
rules: {},
92+
},
93+
{
94+
files: ['**/*.json'],
95+
extends: [json.configs.recommended],
96+
rules: {},
97+
}
98+
);

0 commit comments

Comments
 (0)