Skip to content

Commit

Permalink
eslint-upgraded
Browse files Browse the repository at this point in the history
  • Loading branch information
anasnadeemws committed Sep 5, 2024
1 parent 5e0968d commit b7fd262
Show file tree
Hide file tree
Showing 5 changed files with 14,818 additions and 10,410 deletions.
25 changes: 0 additions & 25 deletions .eslintignore

This file was deleted.

65 changes: 0 additions & 65 deletions .eslintrc.js

This file was deleted.

117 changes: 117 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import globals from 'globals';
import { includeIgnoreFile } from '@eslint/compat';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';
import fs from 'fs';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const gitignorePath = path.resolve(__dirname, '.gitignore');

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

const prettierOptions = JSON.parse(fs.readFileSync(path.resolve(__dirname, '.prettierrc'), 'utf8'));

export default [
...compat.extends(
'eslint:recommended',
// 'plugin:import/recommended',
'plugin:react/recommended',
'plugin:jest/recommended',
'plugin:prettier/recommended',
// 'next',
'prettier',
'prettier-standard'
),

includeIgnoreFile(gitignorePath),

{
languageOptions: {
globals: {
...globals.browser,
...globals.amd,
GLOBAL: false,
it: false,
expect: false,
describe: false,
},
},

rules: {
'prettier/prettier': [
'error',
prettierOptions,
],

'import/no-webpack-loader-syntax': 0,
'curly': ['error', 'all'],
'react/display-name': 'off',
'react/react-in-jsx-scope': 'off',
'no-console': ['error', { allow: ['error'] }],
'max-lines': ['error', { max: 300, skipBlankLines: true, skipComments: true }],
'max-lines-per-function': ['error', 250],
'no-else-return': 'error',
'max-params': ['error', 4],
'no-shadow': 'error',
'complexity': ['error', 5],
'no-empty': 'error',
'import/order': [
'error',
{
groups: [['builtin', 'external', 'internal', 'parent', 'sibling', 'index']],
},
],
},

settings: {
'import/resolver': {
alias: {
map: [
['@app', './app'],
['@components', './app/components'],
['@themes', './app/themes'],
['@utils', './app/utils'],
['@images', './app/images'],
['@store', './app/store'],
['@services', './app/services'],
],
extensions: ['.ts', '.js', '.jsx', '.json'],
},
},
},

ignores: [
'build',
'out',
'node_modules',
'stats.json',
'.next',
'.DS_Store',
'npm-debug.log',
'.idea',
'**/coverage/**',
'**/storybook-static/**',
'**/server/**',
'lighthouserc.js',
'lingui.config.js',
'__tests__',
'internals/**/*.*',
'coverage/**/*.*',
'reports/**/*.*',
'badges/**/*.*',
'assets/**/*.*',
'**/tests/**/*.test.js',
'playwright.config.js',
'babel.config.js',
'app/translations/*.js',
'app/**/stories/**/*.*',
],
},
];
40 changes: 26 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"test:ci": "jest --ci",
"lint": "npm run lint:js && npm run lint:css",
"lint:css": "stylelint **/*.js",
"lint:eslint": "eslint --ignore-path .eslintignore ",
"lint:eslint:fix": "eslint --ignore-path .eslintignore --fix",
"lint:eslint": "eslint",
"lint:eslint:fix": "eslint --fix",
"lint:js": "npm run lint:eslint -- . ",
"lint:staged": "lint-staged",
"test:clean": "rimraf ./coverage",
Expand Down Expand Up @@ -65,40 +65,52 @@
"redux-saga": "^1.3.0",
"reduxsauce": "^1.3.0",
"reselect": "^4.1.8",
"styled-components": "^5.3.11"
"styled-components": "^6.1.13"
},
"devDependencies": {
"@babel/core": "7.25.2",
"@emotion/babel-plugin": "11.12.0",
"@emotion/jest": "^11.13.0",
"@stylelint/postcss-css-in-js": "^0.37.2",
"@eslint/compat": "^1.1.1",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.9.1",
"@stylelint/postcss-css-in-js": "^0.38.0",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^16.0.1",
"@typescript-eslint/eslint-plugin": "^8.4.0",
"@typescript-eslint/parser": "^8.4.0",
"axios-mock-adapter": "^1.22.0",
"babel-jest": "^28.1.3",
"babel-plugin-styled-components": "^2.1.4",
"eslint": "^8.57.0",
"eslint-config-next": "12.3.4",
"eslint-config-prettier": "^8.10.0",
"eslint": "^9.9.1",
"eslint-config-next": "14.2.7",
"eslint-config-prettier": "^9.1.0",
"eslint-config-prettier-standard": "^4.0.1",
"eslint-config-standard": "^17.1.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-immutable": "github:alichherawalla/eslint-plugin-immutable.git#6af48f5498ca1912b618c16bceab8c5464a92f1c",
"eslint-plugin-import": "^2.30.0",
"eslint-plugin-jest": "^26.9.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-jest": "^28.8.2",
"eslint-plugin-n": "^17.10.2",
"eslint-plugin-prettier": "5.0.0",
"eslint-plugin-promise": "^7.1.0",
"globals": "^15.9.0",
"jest": "^28.1.3",
"jest-cli": "28.1.3",
"jest-environment-jsdom": "^29.7.0",
"jest-styled-components": "^7.2.0",
"lint-staged": "^12.5.0",
"lint-staged": "^15.2.10",
"next-transpile-modules": "^9.1.0",
"postcss-syntax": "^0.36.2",
"prettier": "^2.8.8",
"prettier": "^3.3.3",
"prettier-config-standard": "^7.0.0",
"react-floki": "^1.0.96",
"react-test-renderer": "^18.3.1",
"stylelint": "^14.8.4",
"stylelint-config-recommended": "^7.0.0",
"stylelint": "^16.9.0",
"stylelint-config-recommended": "^14.0.1",
"stylelint-config-styled-components": "^0.1.1",
"stylelint-processor-styled-components": "^1.10.0"
"stylelint-processor-styled-components": "^1.10.0",
"typescript": "^5.5.4"
}
}
Loading

0 comments on commit b7fd262

Please sign in to comment.