Skip to content

Commit 75956e2

Browse files
authored
Merge pull request #16 from yasharsanaei/angular-17-fix
Angular 17 fix
2 parents 40e0abe + 1e12730 commit 75956e2

File tree

8 files changed

+511
-334
lines changed

8 files changed

+511
-334
lines changed

.eslintrc.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = {
1010
createDefaultProgram: false,
1111
},
1212
plugins: [/*'rxjs',*/ 'sonarjs', 'unused-imports'],
13-
extends: ['plugin:sonarjs/recommended', 'plugin:@angular-eslint/recommended', 'prettier'],
13+
extends: ['plugin:@typescript-eslint/recommended', 'plugin:sonarjs/recommended', 'plugin:@angular-eslint/recommended', 'prettier'],
1414
rules: {
1515
// Eslint
1616
'no-negated-in-lhs': 'error',
@@ -28,7 +28,7 @@ module.exports = {
2828
'no-cond-assign': 'error',
2929
'no-empty': 'warn',
3030
'no-redeclare': 'warn',
31-
// 'class-methods-use-this': 'warn', // This is producing a lot of warnings that aren't really important.
31+
'class-methods-use-this': 'off', // This is producing a lot of warnings that aren't really important.
3232
'prefer-const': 'warn',
3333
'no-console': ['error', { allow: ['error', 'warn'] }],
3434
eqeqeq: ['warn', 'smart'],
@@ -39,7 +39,7 @@ module.exports = {
3939
paths: [
4040
{
4141
name: 'rxjs/Rx',
42-
message: "Please import directly from 'rxjs' instead",
42+
message: 'Please import directly from \'rxjs\' instead',
4343
},
4444
],
4545
patterns: ['../../*'],
@@ -62,6 +62,12 @@ module.exports = {
6262
'warn',
6363
{ vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' },
6464
],
65+
'@typescript-eslint/no-unsafe-call': 'warn',
66+
'@typescript-eslint/no-unsafe-member-access': 'warn', // This is producing a lot of warnings that aren't really important.
67+
'@typescript-eslint/no-unsafe-return': 'warn',
68+
'@typescript-eslint/no-unnecessary-condition': 'off', // TODO: uncomment when all projects are strict:true
69+
'@typescript-eslint/no-explicit-any': 'warn',
70+
'@typescript-eslint/prefer-nullish-coalescing': 'warn',
6571
},
6672
},
6773
],

lib/configs/angular.js

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ module.exports = {
1010
createDefaultProgram: false,
1111
},
1212
plugins: [/*'rxjs',*/ 'sonarjs', '@tapsellorg', 'unused-imports'],
13-
extends: ['plugin:sonarjs/recommended', 'plugin:@angular-eslint/recommended', 'prettier'],
13+
extends: [
14+
'plugin:sonarjs/recommended',
15+
'plugin:@angular-eslint/recommended',
16+
'plugin:@typescript-eslint/recommended',
17+
'prettier',
18+
],
1419
rules: {
1520
// Eslint
1621
'no-negated-in-lhs': 'error',
@@ -28,7 +33,7 @@ module.exports = {
2833
'no-cond-assign': 'error',
2934
'no-empty': 'warn',
3035
'no-redeclare': 'warn',
31-
// 'class-methods-use-this': 'warn', // This is producing a lot of warnings that aren't really important.
36+
'class-methods-use-this': 'off', // This is producing a lot of warnings that aren't really important.
3237
'prefer-const': 'warn',
3338
'no-console': ['error', { allow: ['error', 'warn', 'assert'] }],
3439
eqeqeq: ['warn', 'smart'],
@@ -82,11 +87,9 @@ module.exports = {
8287
'@typescript-eslint/array-type': ['warn', { default: 'array' }],
8388
'@typescript-eslint/no-this-alias': 'warn',
8489
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'warn',
85-
// '@typescript-eslint/no-unnecessary-condition': 'warn', // TODO: uncomment when all projects are strict:true
86-
// '@typescript-eslint/no-unsafe-member-access': 'warn', // This is producing a lot of warnings that aren't really important.
8790
'@typescript-eslint/prefer-includes': 'error',
8891
'@typescript-eslint/prefer-as-const': 'warn',
89-
'@typescript-eslint/prefer-nullish-coalescing': 'warn',
92+
'prefer-optional-chain': 'off',
9093
'@typescript-eslint/prefer-optional-chain': 'warn',
9194
'@typescript-eslint/prefer-reduce-type-parameter': 'warn',
9295
// angular eslint
@@ -102,6 +105,26 @@ module.exports = {
102105
'warn',
103106
{ vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' },
104107
],
108+
'@typescript-eslint/prefer-nullish-coalescing': 'warn',
109+
'@typescript-eslint/no-unnecessary-condition': 'off', // TODO: uncomment when all projects are strict:true
110+
'@typescript-eslint/no-unsafe-member-access': 'warn', // This is producing a lot of warnings that aren't really important.
111+
'@typescript-eslint/no-unsafe-return': 'warn',
112+
'@typescript-eslint/no-unsafe-assignment': 'warn',
113+
'@typescript-eslint/no-unsafe-argument': 'warn',
114+
'@typescript-eslint/no-unsafe-call': 'warn',
115+
'prefer-rest-params': 'off',
116+
'@typescript-eslint/ban-types': 'off',
117+
'@typescript-eslint/no-explicit-any': 'warn',
118+
'@typescript-eslint/no-unnecessary-type-constraint': 'warn',
119+
'@typescript-eslint/consistent-indexed-object-style': 'warn',
120+
'@typescript-eslint/no-var-requires': 'warn',
121+
'@typescript-eslint/no-extraneous-class': [
122+
'warn',
123+
{
124+
allowConstructorOnly: true,
125+
allowEmpty: true,
126+
},
127+
],
105128
},
106129
},
107130
{

lib/index.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* @fileoverview Tapsell custom eslint plugin
3+
* @author Vahid Mohammadi
4+
*/
5+
6+
import angular from './configs/angular';
7+
8+
//------------------------------------------------------------------------------
9+
// Plugin Definition
10+
//------------------------------------------------------------------------------
11+
12+
// import all rules in lib/rules
13+
module.exports = {
14+
configs: {
15+
angular,
16+
},
17+
};

lib/rules/index.ts

Whitespace-only changes.

0 commit comments

Comments
 (0)