Skip to content

Commit

Permalink
fix: update eslint and fix warnings (#1378)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
3 people authored Feb 24, 2025
1 parent 1849e0c commit aa84345
Show file tree
Hide file tree
Showing 49 changed files with 565 additions and 478 deletions.
154 changes: 0 additions & 154 deletions .eslintrc.json

This file was deleted.

144 changes: 144 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
import eslintPluginImport from 'eslint-plugin-import';
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
import eslintPluginPreferArrow from 'eslint-plugin-prefer-arrow';
import typescriptParser from '@typescript-eslint/parser';

export default [
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
globals: {
browser: true,
es6: true,
node: true
},
//"extends": [
// TODO: consider extending the recommended by ts rules and overriding them where necessary
// 'eslint:recommended',
// 'plugin:@typescript-eslint/recommended'
//],
parser: typescriptParser,
parserOptions: {
project: '**/tsconfig.json',
sourceType: 'module',
},
},
plugins: {
'eslint-plugin-import': eslintPluginImport,
'eslint-plugin-unicorn': eslintPluginUnicorn,
'eslint-plugin-prefer-arrow': eslintPluginPreferArrow,
//"@typescript-eslint" - install it if we extend the recommended ts rules
},
rules: {
'complexity': 'off',
'eslint-plugin-import/no-extraneous-dependencies': 'warn',
'eslint-plugin-import/no-internal-modules': 'warn',
'eslint-plugin-import/order': [
'off',
{
alphabetize: {
caseInsensitive: true,
order: 'asc',
},
'newlines-between': 'ignore',
groups: [
[
'builtin',
'external',
'internal',
'unknown',
'object',
'type',
],
'parent',
['sibling', 'index'],
],
distinctGroup: false,
pathGroupsExcludedImportTypes: [],
pathGroups: [
{
pattern: './',
patternOptions: { nocomment: true, dot: true },
group: 'sibling',
position: 'before',
},
{
pattern: '.',
patternOptions: { nocomment: true, dot: true },
group: 'sibling',
position: 'before',
},
{
pattern: '..',
patternOptions: { nocomment: true, dot: true },
group: 'parent',
position: 'before',
},
{
pattern: '../',
patternOptions: { nocomment: true, dot: true },
group: 'parent',
position: 'before',
},
],
},
],
'no-constant-condition': 'warn',
'no-case-declarations': 'off',
'no-extra-boolean-cast': 'warn',
'no-unused-vars': 'off',
'no-unexpected-multiline': 'off',
'no-useless-escape': 'off',
'new-parens': 'error',
'no-bitwise': 'off',
'no-caller': 'error',
'no-cond-assign': 'error',
'no-console': 'off',
'no-debugger': 'error',
'no-duplicate-case': 'error',
'no-duplicate-imports': 'error',
'no-empty': 'off',
'no-empty-function': 'off',
'no-eval': 'error',
'no-extra-bind': 'error',
'no-fallthrough': 'off',
'no-invalid-this': 'off',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-redeclare': 'error',
'no-return-await': 'error',
'no-sequences': 'error',
'no-shadow': 'off',
'no-sparse-arrays': 'error',
'no-template-curly-in-string': 'error',
'no-throw-literal': 'error',
'no-trailing-spaces': 'error',
'no-undef-init': 'error',
'no-underscore-dangle': 'off',
'no-unsafe-finally': 'error',
'no-unused-expressions': 'off',
'no-unused-labels': 'error',
'no-use-before-define': 'off',
'no-var': 'error',
'object-shorthand': 'warn',
'one-var': ['error', 'never'],
'prefer-arrow/prefer-arrow-functions': 'off',
'prefer-const': 'warn',
'prefer-object-spread': 'off',
'radix': 'error',
'space-in-parens': ['error', 'never'],
'unicorn/prefer-ternary': 'off',
'use-isnan': 'error',
'valid-typeof': 'off',
},
},
{
ignores: [
'/node_modules/**/*',
'/coverage/**/*',
'/output/**/*',
'/packages/cli/templates/**/*',
'**/files/**/*'
]
},
];
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"test": "nyc npm run jasmine",
"jasmine": "node spec/jasmine-runner.js",
"coverage": "nyc report --report-dir",
"lint": "eslint -c .eslintrc.json ./**/*.ts",
"lint": "eslint -c eslint.config.mjs ./**/*.ts",
"config-schema": "typescript-json-schema packages/core/types/Config.ts Config -o packages/core/config/Config.schema.json"
},
"nyc": {
Expand Down Expand Up @@ -65,9 +65,9 @@
"@types/node": "^22.5.5",
"@typescript-eslint/eslint-plugin": "^8.21.0",
"@typescript-eslint/parser": "^8.21.0",
"coveralls-next": "^4.2.1",
"browser-sync": "^3.0.3",
"eslint": "^8.57.0",
"coveralls-next": "^4.2.1",
"eslint": "^9.20.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prefer-arrow": "^1.2.3",
"eslint-plugin-unicorn": "^52.0.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "igniteui-cli",
"version": "14.3.13",
"version": "14.3.14-beta.10",
"description": "CLI tool for creating Ignite UI projects",
"keywords": [
"CLI",
Expand Down Expand Up @@ -76,8 +76,8 @@
"all": true
},
"dependencies": {
"@igniteui/angular-templates": "~19.0.14313",
"@igniteui/cli-core": "~14.3.13",
"@igniteui/angular-templates": "~19.0.14314-beta.10",
"@igniteui/cli-core": "~14.3.14-beta.10",
"@inquirer/prompts": "^5.4.0",
"@types/yargs": "^17.0.33",
"chalk": "^5.3.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const data = [
const data: any = [
{ "CountryName": "China", "Pop1995": 1216, "Pop2005": 1297, "Pop2015": 1361, "Pop2025": 1394 },
{ "CountryName": "India", "Pop1995": 920, "Pop2005": 1090, "Pop2015": 1251, "Pop2025": 1396 },
{ "CountryName": "United States", "Pop1995": 266, "Pop2005": 295, "Pop2015": 322, "Pop2025": 351 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ IgrDoughnutChartModule.register();
IgrRingSeriesModule.register();


const data = [
const data: any = [
{ MarketShare: 30, Company: "Google", },
{ MarketShare: 15, Company: "Microsoft", },
{ MarketShare: 30, Company: "Apple", },
Expand Down Expand Up @@ -82,4 +82,4 @@ export default class $(ClassName) extends Component {
</div>
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import style from './style.css';

IgrFinancialChartModule.register();

const data = [
const data: any = [
{ time: new Date(2013, 1, 1), open: 268.93, high: 268.93, low: 262.80, close: 265.00, volume: 6118146 },
{ time: new Date(2013, 1, 4), open: 262.78, high: 264.68, low: 259.07, close: 259.98, volume: 3723793 },
{ time: new Date(2013, 1, 5), open: 262.00, high: 268.03, low: 261.46, close: 266.89, volume: 4013780 },
Expand Down Expand Up @@ -52,4 +52,4 @@ export default class $(ClassName) extends Component {
</div >
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import style from './style.css';
IgrPieChartModule.register();
IgrItemLegendModule.register();

const data = [
const data: any = [
{ MarketShare: 30, Company: "Google", },
{ MarketShare: 15, Company: "Microsoft", },
{ MarketShare: 30, Company: "Apple", },
Expand Down Expand Up @@ -80,4 +80,4 @@ export default class $(ClassName) extends Component {
</div>
)
}
}
}
Loading

0 comments on commit aa84345

Please sign in to comment.