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

Upgrade to Eslint v9 #10102

Merged
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
500ccc8
upgrade to v9
AdityaJ2305 Jan 22, 2025
1c857b1
Merge branch 'develop' into eslint_version_upgrade_v9
AdityaJ2305 Jan 22, 2025
ae7dfe7
rm lock file
AdityaJ2305 Jan 22, 2025
90372d6
Merge branch 'eslint_version_upgrade_v9' of https://github.com/Aditya…
AdityaJ2305 Jan 22, 2025
f518c0c
add lock file
AdityaJ2305 Jan 22, 2025
926e3ab
add lock file typo bugs
AdityaJ2305 Jan 22, 2025
4ed7956
Revert "add lock file typo bugs"
AdityaJ2305 Jan 22, 2025
5d4f49a
Merge branch 'develop' into eslint_version_upgrade_v9
AdityaJ2305 Jan 22, 2025
be64930
Merge branch 'develop' into eslint_version_upgrade_v9
AdityaJ2305 Jan 23, 2025
0d41754
Merge branch 'develop' into eslint_version_upgrade_v9
AdityaJ2305 Jan 23, 2025
070ce2e
update package-lock
sainak Jan 23, 2025
50275eb
Merge branch 'develop' into eslint_version_upgrade_v9
AdityaJ2305 Jan 23, 2025
2ce556b
config file updated
AdityaJ2305 Jan 23, 2025
17a6042
eslint errors fix 2.0
AdityaJ2305 Jan 24, 2025
986a0ef
Merge branch 'develop' into eslint_version_upgrade_v9
AdityaJ2305 Jan 24, 2025
8d859a4
Merge branch 'develop' into eslint_version_upgrade_v9
AdityaJ2305 Jan 24, 2025
2fac12c
lock file added
AdityaJ2305 Jan 24, 2025
c42d1e8
Merge branch 'eslint_version_upgrade_v9' of https://github.com/Aditya…
AdityaJ2305 Jan 24, 2025
a51a1ac
Merge branch 'develop' into eslint_version_upgrade_v9
AdityaJ2305 Jan 24, 2025
e8e63be
update package-lock
sainak Jan 23, 2025
6c89a22
updated lock file
sainak Jan 23, 2025
932ea50
updated lock file
AdityaJ2305 Jan 24, 2025
6bddd5e
reset lock file
AdityaJ2305 Jan 24, 2025
51bf1d4
eslint errors fix 3.0
AdityaJ2305 Jan 24, 2025
7ec6fa3
eslint errors fix 4.0
AdityaJ2305 Jan 24, 2025
81dbd2c
Empty-Commit
AdityaJ2305 Jan 24, 2025
6f239b9
Merge remote-tracking branch 'origin/develop' into eslint_version_upg…
sainak Jan 25, 2025
3ab5c3b
revert unnecessary changes
sainak Jan 25, 2025
fe1c7a7
revert unnecessary changes
sainak Jan 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 0 additions & 84 deletions .eslintrc.json

This file was deleted.

152 changes: 152 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
import eslint from "@eslint/js";
import tseslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import i18nextPlugin from "eslint-plugin-i18next";
import noRelativeImportPaths from "eslint-plugin-no-relative-import-paths";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
AdityaJ2305 marked this conversation as resolved.
Show resolved Hide resolved
import reactPlugin from "eslint-plugin-react";
import reactHooksPlugin from "eslint-plugin-react-hooks";
import globals from "globals";

export default [
// Base configuration
{
ignores: [
"**/dist",
"**/public",
"**/lib",
"**/build",
"**/*.css",
"**/*.csv",
"**/Dockerfile",
],
},
eslint.configs.recommended,

// Global settings for all JavaScript/TypeScript files
{
files: ["**/*.{js,jsx,ts,tsx,mjs,mts}"],
languageOptions: {
ecmaVersion: 12,
sourceType: "module",
globals: {
...globals.browser,
...globals.node,
React: true,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
settings: {
react: {
version: "detect",
},
},
linterOptions: {
reportUnusedDisableDirectives: true,
},
},

// TypeScript-specific rules
{
files: ["**/*.{ts,tsx}"],
plugins: {
"@typescript-eslint": tseslint,
},
languageOptions: {
parser: tsParser,
parserOptions: {
project: "./tsconfig.json",
},
},
rules: {
...tseslint.configs.recommended.rules,
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-unused-expressions": [
"error",
{ allowShortCircuit: true, allowTernary: true },
],
"@typescript-eslint/no-explicit-any": "warn",
"no-undef": "off",
},
},

// React-specific rules
{
files: ["**/*.{jsx,tsx}"],
plugins: {
react: reactPlugin,
"react-hooks": reactHooksPlugin,
},
rules: {
...reactPlugin.configs.recommended.rules,
...reactHooksPlugin.configs.recommended.rules,
"react/prop-types": "off",
"react/no-children-prop": "off",
},
},
// No Relative import paths rule
{
files: ["**/*.{js,jsx,ts,tsx}"],
plugins: {
"no-relative-import-paths": noRelativeImportPaths,
},
rules: {
"no-relative-import-paths/no-relative-import-paths": [
"error",
{
allowSameFolder: true,
prefix: "@",
},
],
},
},

// i18next plugin rules
{
files: ["**/*.{js,jsx,ts,tsx}"],
plugins: {
i18next: i18nextPlugin,
},
rules: {
...i18nextPlugin.configs.recommended.rules,
"i18next/no-literal-string": [
"warn",
{
mode: "jsx-only",
"jsx-attributes": {
include: ["label", "placeholder", "error", "title"],
exclude: [".*"],
},
callees: {
exclude: [".*"],
},
},
],
},
},

// Cypress-specific rules
{
files: ["cypress/**/*.ts"],
languageOptions: {
parser: tsParser,
parserOptions: {
project: "./cypress/tsconfig.json",
},
},
AdityaJ2305 marked this conversation as resolved.
Show resolved Hide resolved
},

// Add prettier recommended config last
eslintPluginPrettierRecommended,
];
Loading
Loading