Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Lint issues and updated Eslint rules #2163

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
fix: resolves false positive eslint warnings for imports
mohitb35 committed Aug 19, 2024
commit 62d63665d96d5b9f9683575c008a4c6ef029dac6
42 changes: 25 additions & 17 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ module.exports = {
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:storybook/recommended',
'plugin:import/recommended' // Add this line to include recommended rules from eslint-plugin-import
'plugin:import/recommended', // Add this line to include recommended rules from eslint-plugin-import
],
parser: '@typescript-eslint/parser',
parserOptions: {
@@ -31,18 +31,24 @@ module.exports = {
'prefer-const': 'warn',
'no-var': 'error',
'consistent-return': 'warn',
'eqeqeq': ['error', 'always'],
eqeqeq: ['error', 'always'],
'@typescript-eslint/explicit-module-boundary-types': 'warn',
'@typescript-eslint/explicit-function-return-type': 'warn',

// React Best Practices
'react/jsx-key': 'error',
'react/no-array-index-key': 'warn',
'react/jsx-curly-brace-presence': ['warn', { props: 'never', children: 'never' }],
'react/jsx-curly-brace-presence': [
'warn',
{ props: 'never', children: 'never' },
],

// Code Quality
'complexity': ['warn', { max: 10 }],
'max-lines': ['warn', { max: 300, skipBlankLines: true, skipComments: true }],
complexity: ['warn', { max: 10 }],
'max-lines': [
'warn',
{ max: 300, skipBlankLines: true, skipComments: true },
],
'max-params': ['warn', MAX_PARAMS],
'no-magic-numbers': ['warn', { ignore: [0, 1] }],

@@ -58,7 +64,7 @@ module.exports = {
'no-empty-pattern': 'warn',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
@@ -68,28 +74,25 @@ module.exports = {
'react/react-in-jsx-scope': 'off',
'react/jsx-props-no-spreading': 'warn',
'react/jsx-filename-extension': [
'warn',
{ extensions: ['.js', '.jsx', '.tsx'] }
'warn',
{ extensions: ['.js', '.jsx', '.tsx'] },
],
'react/no-unknown-property': [
'error',
'error',
{
ignore: ['jsx', 'global'],
}
],
'react/jsx-indent': [
'warn',
JSX_INDENT_SIZE
},
],
'react/jsx-indent': ['warn', JSX_INDENT_SIZE],
'import/extensions': [
'warn',
'always',
'warn',
'always',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
}
},
],
'import/no-unresolved': 'warn', // should be error
'import/named': 'warn', // should be error
@@ -117,4 +120,9 @@ module.exports = {
cy: true,
NodeJS: true,
},
settings: {
'import/resolver': {
typescript: {},
},
},
};
Loading
Loading