Skip to content

Commit aa84345

Browse files
Hristo313Hristo HristovLipata
authored
fix: update eslint and fix warnings (#1378)
* fix(cli): upgrade eslint * fix(cli): update eslint version and fix config logic * fix(cli): add missing files * fix(cli): add version 14.3.14-beta.0 * fix(cli): update glob to 11.0.0 and fix tests * fix(cli): remove rimraf under 5 versions, inflight and glob under 10 version from yarn lock * fix(cli): fix yarn lock and release verison 14.3.14-beta.1 * fix(cli): upgrade eslint plugin react hooks to fix react error * fix(cli): release version 14.3.14-beta.2 * fix(cli): upgrade coveralls version to 2.4.0 * fix(cli): revert coveralls upgrade * fix(cli): turn off no internal modules import * fix(cli): fix typo * fix(cli): revert change in configuration * fix(cli): increase chunk size when build react and web components add terser to minify the code * chore(cli): release version 14.3.14-beta.3 * fix(cli): change eslint config file names * fix(cli): add packages in angular package json * fix(cli): add missing configs for angular eslint * chore(cli): release version 14.3.14-beta.4 * fix(cli): add terser options * chore(cli): release version 14.3.14-beta.5 * fix(cli): update eslint configuration for react and wc * fix(cli): update lint command in package json files * chore(cli): release version 14.3.14-beta.6 * chore(cli): release version 14.3.14-beta.7 * fix(cli): fix configurations for es lint * chore(cli): release version 14.3.14-beta.8 * fix(cli): remove pure comment error from wc projects * fix(cli): add fixes in angular configuration * chore(cli): release version 14.3.14-beta.9 * fix(cli): add option for angular templates to disable optionalChainNotNullable check * chore(cli): release version 14.3.14-beta.10 * fix: build and lint errors from a project for all components and scenarios * fix: clear more lint warnings and build errors. --------- Co-authored-by: Hristo Hristov <[email protected]> Co-authored-by: lipata <[email protected]>
1 parent 1849e0c commit aa84345

File tree

49 files changed

+565
-478
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+565
-478
lines changed

.eslintrc.json

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

eslint.config.mjs

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
import eslintPluginImport from 'eslint-plugin-import';
2+
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
3+
import eslintPluginPreferArrow from 'eslint-plugin-prefer-arrow';
4+
import typescriptParser from '@typescript-eslint/parser';
5+
6+
export default [
7+
{
8+
files: ['**/*.ts', '**/*.tsx'],
9+
languageOptions: {
10+
globals: {
11+
browser: true,
12+
es6: true,
13+
node: true
14+
},
15+
//"extends": [
16+
// TODO: consider extending the recommended by ts rules and overriding them where necessary
17+
// 'eslint:recommended',
18+
// 'plugin:@typescript-eslint/recommended'
19+
//],
20+
parser: typescriptParser,
21+
parserOptions: {
22+
project: '**/tsconfig.json',
23+
sourceType: 'module',
24+
},
25+
},
26+
plugins: {
27+
'eslint-plugin-import': eslintPluginImport,
28+
'eslint-plugin-unicorn': eslintPluginUnicorn,
29+
'eslint-plugin-prefer-arrow': eslintPluginPreferArrow,
30+
//"@typescript-eslint" - install it if we extend the recommended ts rules
31+
},
32+
rules: {
33+
'complexity': 'off',
34+
'eslint-plugin-import/no-extraneous-dependencies': 'warn',
35+
'eslint-plugin-import/no-internal-modules': 'warn',
36+
'eslint-plugin-import/order': [
37+
'off',
38+
{
39+
alphabetize: {
40+
caseInsensitive: true,
41+
order: 'asc',
42+
},
43+
'newlines-between': 'ignore',
44+
groups: [
45+
[
46+
'builtin',
47+
'external',
48+
'internal',
49+
'unknown',
50+
'object',
51+
'type',
52+
],
53+
'parent',
54+
['sibling', 'index'],
55+
],
56+
distinctGroup: false,
57+
pathGroupsExcludedImportTypes: [],
58+
pathGroups: [
59+
{
60+
pattern: './',
61+
patternOptions: { nocomment: true, dot: true },
62+
group: 'sibling',
63+
position: 'before',
64+
},
65+
{
66+
pattern: '.',
67+
patternOptions: { nocomment: true, dot: true },
68+
group: 'sibling',
69+
position: 'before',
70+
},
71+
{
72+
pattern: '..',
73+
patternOptions: { nocomment: true, dot: true },
74+
group: 'parent',
75+
position: 'before',
76+
},
77+
{
78+
pattern: '../',
79+
patternOptions: { nocomment: true, dot: true },
80+
group: 'parent',
81+
position: 'before',
82+
},
83+
],
84+
},
85+
],
86+
'no-constant-condition': 'warn',
87+
'no-case-declarations': 'off',
88+
'no-extra-boolean-cast': 'warn',
89+
'no-unused-vars': 'off',
90+
'no-unexpected-multiline': 'off',
91+
'no-useless-escape': 'off',
92+
'new-parens': 'error',
93+
'no-bitwise': 'off',
94+
'no-caller': 'error',
95+
'no-cond-assign': 'error',
96+
'no-console': 'off',
97+
'no-debugger': 'error',
98+
'no-duplicate-case': 'error',
99+
'no-duplicate-imports': 'error',
100+
'no-empty': 'off',
101+
'no-empty-function': 'off',
102+
'no-eval': 'error',
103+
'no-extra-bind': 'error',
104+
'no-fallthrough': 'off',
105+
'no-invalid-this': 'off',
106+
'no-new-func': 'error',
107+
'no-new-wrappers': 'error',
108+
'no-redeclare': 'error',
109+
'no-return-await': 'error',
110+
'no-sequences': 'error',
111+
'no-shadow': 'off',
112+
'no-sparse-arrays': 'error',
113+
'no-template-curly-in-string': 'error',
114+
'no-throw-literal': 'error',
115+
'no-trailing-spaces': 'error',
116+
'no-undef-init': 'error',
117+
'no-underscore-dangle': 'off',
118+
'no-unsafe-finally': 'error',
119+
'no-unused-expressions': 'off',
120+
'no-unused-labels': 'error',
121+
'no-use-before-define': 'off',
122+
'no-var': 'error',
123+
'object-shorthand': 'warn',
124+
'one-var': ['error', 'never'],
125+
'prefer-arrow/prefer-arrow-functions': 'off',
126+
'prefer-const': 'warn',
127+
'prefer-object-spread': 'off',
128+
'radix': 'error',
129+
'space-in-parens': ['error', 'never'],
130+
'unicorn/prefer-ternary': 'off',
131+
'use-isnan': 'error',
132+
'valid-typeof': 'off',
133+
},
134+
},
135+
{
136+
ignores: [
137+
'/node_modules/**/*',
138+
'/coverage/**/*',
139+
'/output/**/*',
140+
'/packages/cli/templates/**/*',
141+
'**/files/**/*'
142+
]
143+
},
144+
];

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"test": "nyc npm run jasmine",
2828
"jasmine": "node spec/jasmine-runner.js",
2929
"coverage": "nyc report --report-dir",
30-
"lint": "eslint -c .eslintrc.json ./**/*.ts",
30+
"lint": "eslint -c eslint.config.mjs ./**/*.ts",
3131
"config-schema": "typescript-json-schema packages/core/types/Config.ts Config -o packages/core/config/Config.schema.json"
3232
},
3333
"nyc": {
@@ -65,9 +65,9 @@
6565
"@types/node": "^22.5.5",
6666
"@typescript-eslint/eslint-plugin": "^8.21.0",
6767
"@typescript-eslint/parser": "^8.21.0",
68-
"coveralls-next": "^4.2.1",
6968
"browser-sync": "^3.0.3",
70-
"eslint": "^8.57.0",
69+
"coveralls-next": "^4.2.1",
70+
"eslint": "^9.20.0",
7171
"eslint-plugin-import": "^2.29.1",
7272
"eslint-plugin-prefer-arrow": "^1.2.3",
7373
"eslint-plugin-unicorn": "^52.0.0",

packages/cli/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "igniteui-cli",
3-
"version": "14.3.13",
3+
"version": "14.3.14-beta.10",
44
"description": "CLI tool for creating Ignite UI projects",
55
"keywords": [
66
"CLI",
@@ -76,8 +76,8 @@
7676
"all": true
7777
},
7878
"dependencies": {
79-
"@igniteui/angular-templates": "~19.0.14313",
80-
"@igniteui/cli-core": "~14.3.13",
79+
"@igniteui/angular-templates": "~19.0.14314-beta.10",
80+
"@igniteui/cli-core": "~14.3.14-beta.10",
8181
"@inquirer/prompts": "^5.4.0",
8282
"@types/yargs": "^17.0.33",
8383
"chalk": "^5.3.0",

packages/cli/templates/angular/ig-ts/line-chart/default/files/src/app/assets/line-chart-data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const data = [
1+
const data: any = [
22
{ "CountryName": "China", "Pop1995": 1216, "Pop2005": 1297, "Pop2015": 1361, "Pop2025": 1394 },
33
{ "CountryName": "India", "Pop1995": 920, "Pop2005": 1090, "Pop2015": 1251, "Pop2025": 1396 },
44
{ "CountryName": "United States", "Pop1995": 266, "Pop2005": 295, "Pop2015": 322, "Pop2025": 351 },

packages/cli/templates/react/igr-es6/doughnut-chart/default/files/src/views/__path__/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ IgrDoughnutChartModule.register();
1414
IgrRingSeriesModule.register();
1515

1616

17-
const data = [
17+
const data: any = [
1818
{ MarketShare: 30, Company: "Google", },
1919
{ MarketShare: 15, Company: "Microsoft", },
2020
{ MarketShare: 30, Company: "Apple", },
@@ -82,4 +82,4 @@ export default class $(ClassName) extends Component {
8282
</div>
8383
)
8484
}
85-
}
85+
}

packages/cli/templates/react/igr-es6/financial-chart/default/files/src/views/__path__/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import style from './style.css';
55

66
IgrFinancialChartModule.register();
77

8-
const data = [
8+
const data: any = [
99
{ time: new Date(2013, 1, 1), open: 268.93, high: 268.93, low: 262.80, close: 265.00, volume: 6118146 },
1010
{ time: new Date(2013, 1, 4), open: 262.78, high: 264.68, low: 259.07, close: 259.98, volume: 3723793 },
1111
{ time: new Date(2013, 1, 5), open: 262.00, high: 268.03, low: 261.46, close: 266.89, volume: 4013780 },
@@ -52,4 +52,4 @@ export default class $(ClassName) extends Component {
5252
</div >
5353
)
5454
}
55-
}
55+
}

packages/cli/templates/react/igr-es6/pie-chart/default/files/src/views/__path__/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import style from './style.css';
99
IgrPieChartModule.register();
1010
IgrItemLegendModule.register();
1111

12-
const data = [
12+
const data: any = [
1313
{ MarketShare: 30, Company: "Google", },
1414
{ MarketShare: 15, Company: "Microsoft", },
1515
{ MarketShare: 30, Company: "Apple", },
@@ -80,4 +80,4 @@ export default class $(ClassName) extends Component {
8080
</div>
8181
)
8282
}
83-
}
83+
}

0 commit comments

Comments
 (0)