fix: eslint upgrade to v9

This commit is contained in:
sriramveeraghanta
2025-08-29 16:47:43 +05:30
parent 258d24bf06
commit 3446e4cea5
41 changed files with 615 additions and 970 deletions

View File

@@ -1,12 +0,0 @@
.next/*
out/*
public/*
dist/*
node_modules/*
.turbo/*
.env*
.env
.env.local
.env.development
.env.production
.env.test

View File

@@ -0,0 +1,4 @@
import { config } from "@plane/eslint-config/next";
/** @type {import("eslint").Linter.Config} */
export default config;

View File

@@ -4,6 +4,7 @@
"version": "0.28.0",
"license": "AGPL-3.0",
"private": true,
"type": "module",
"scripts": {
"dev": "next dev --port 3001",
"build": "next build",
@@ -49,6 +50,7 @@
"@types/node": "18.16.1",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.2.18",
"eslint": "9.31.0",
"@types/uuid": "^9.0.8",
"typescript": "5.8.3"
}

View File

@@ -1,4 +0,0 @@
module.exports = {
root: true,
extends: ["@plane/eslint-config/server.js"],
};

View File

@@ -0,0 +1,4 @@
import { config } from "@plane/eslint-config/server";
/** @type {import("eslint").Linter.Config} */
export default config;

View File

@@ -1,4 +0,0 @@
module.exports = {
root: true,
extends: ["@plane/eslint-config/next.js"],
};

View File

@@ -64,7 +64,6 @@
"@types/react": "^18.3.11",
"@types/react-dom": "^18.2.18",
"@types/uuid": "^9.0.1",
"@typescript-eslint/eslint-plugin": "^8.36.0",
"typescript": "5.8.3"
}
}

View File

@@ -1,4 +0,0 @@
module.exports = {
root: true,
extends: ["@plane/eslint-config/next.js"],
};

View File

@@ -0,0 +1,4 @@
import { config } from "@plane/eslint-config/next";
/** @type {import("eslint").Linter.Config} */
export default config;

View File

@@ -0,0 +1,4 @@
import { config } from "@plane/eslint-config/library";
/** @type {import("eslint").Linter.Config} */
export default config;

View File

@@ -1,4 +0,0 @@
module.exports = {
root: true,
extends: ["@plane/eslint-config/library.js"],
};

View File

@@ -0,0 +1,4 @@
import { config } from "@plane/eslint-config/library";
/** @type {import("eslint").Linter.Config} */
export default config;

View File

@@ -1,4 +0,0 @@
module.exports = {
root: true,
extends: ["@plane/eslint-config/library.js"],
};

View File

@@ -0,0 +1,4 @@
import { config } from "@plane/eslint-config/library";
/** @type {import("eslint").Linter.Config} */
export default config;

View File

@@ -0,0 +1,3 @@
### @plane/eslint-config
Collection of all eslint config files for the monorepo

View File

@@ -0,0 +1,30 @@
import js from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import eslintTurboPlugin from "eslint-config-turbo";
import eslintTypescript from "typescript-eslint";
import onlyWarnPlugin from "eslint-plugin-only-warn";
/**
* @type {import("eslint").Linter.Config}
*/
export const configs = [
js.configs.recommended,
eslintConfigPrettier,
...eslintTypescript.configs.recommended,
{
plugins: {
turbo: eslintTurboPlugin,
},
rules: {
"turbo/no-undeclared-env-vars": "warn",
},
},
{
plugins: {
onlyWarn: onlyWarnPlugin,
},
},
{
ignores: ["dist/**", "node_modules/"],
},
];

View File

@@ -1,81 +1,63 @@
const { resolve } = require("node:path");
const project = resolve(process.cwd(), "tsconfig.json");
import js from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import tseslint from "typescript-eslint";
import pluginReactHooks from "eslint-plugin-react-hooks";
import pluginReact from "eslint-plugin-react";
import globals from "globals";
import pluginImport from "eslint-plugin-import";
import { config as baseConfig } from "./index.js";
/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["prettier", "plugin:@typescript-eslint/recommended"],
parser: "@typescript-eslint/parser",
plugins: ["react", "react-hooks", "@typescript-eslint", "import"],
globals: {
React: true,
JSX: true,
},
env: {
node: true,
browser: true,
},
settings: {
"import/resolver": {
typescript: {
project,
export const config = [
...baseConfig,
js.configs.recommended,
eslintConfigPrettier,
...tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
{
languageOptions: {
...pluginReact.configs.flat.recommended.languageOptions,
globals: {
...globals.serviceworker,
...globals.browser,
},
},
},
rules: {
"no-useless-escape": "off",
"prefer-const": "error",
"no-irregular-whitespace": "error",
"no-trailing-spaces": "error",
"no-duplicate-imports": "error",
"no-useless-catch": "warn",
"no-case-declarations": "error",
"no-undef": "error",
"no-unreachable": "error",
"arrow-body-style": ["error", "as-needed"],
"@next/next/no-html-link-for-pages": "off",
"@next/next/no-img-element": "off",
"react/jsx-key": "error",
"react/self-closing-comp": ["error", { component: true, html: true }],
"react/jsx-boolean-value": "error",
"react/jsx-no-duplicate-props": "error",
"react-hooks/exhaustive-deps": "warn",
"@typescript-eslint/no-unused-expressions": "warn",
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
{
plugins: {
"react-hooks": pluginReactHooks,
},
settings: {
react: {
version: "detect",
},
],
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-useless-empty-export": "error",
"@typescript-eslint/prefer-ts-expect-error": "warn",
"import/order": [
"warn",
{
groups: ["builtin", "external", "internal", "parent", "sibling"],
pathGroups: [
{
pattern: "@plane/**",
group: "external",
position: "after",
},
{
pattern: "@/**",
group: "internal",
position: "before",
},
],
pathGroupsExcludedImportTypes: ["builtin", "internal", "react"],
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
},
rules: {
...pluginReactHooks.configs.recommended.rules,
"react/react-in-jsx-scope": "off",
},
},
ignorePatterns: [".*.js", "node_modules/", "dist/"],
};
...pluginImport.flatConfigs.recommended,
{
rules: {
"import/order": [
"warn",
{
groups: ["builtin", "external", "internal", "parent", "sibling"],
pathGroups: [
{
pattern: "@plane/**",
group: "external",
position: "after",
},
],
pathGroupsExcludedImportTypes: ["builtin", "internal", "react"],
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
},
},
];

View File

@@ -1,105 +1,85 @@
const { resolve } = require("node:path");
const project = resolve(process.cwd(), "tsconfig.json");
import js from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import tseslint from "typescript-eslint";
import pluginReactHooks from "eslint-plugin-react-hooks";
import pluginReact from "eslint-plugin-react";
import globals from "globals";
import pluginNext from "@next/eslint-plugin-next";
import pluginImport from "eslint-plugin-import";
import { config as baseConfig } from "./index.js";
module.exports = {
extends: ["next", "prettier", "plugin:@typescript-eslint/recommended"],
parser: "@typescript-eslint/parser",
plugins: ["react", "@typescript-eslint", "import"],
globals: {
React: "readonly",
JSX: "readonly",
},
env: {
node: true,
browser: true,
},
settings: {
"import/resolver": {
typescript: {
project,
/**
* @type {import("eslint").Linter.Config}
*/
export const config = [
...baseConfig,
js.configs.recommended,
eslintConfigPrettier,
...tseslint.configs.recommended,
{
...pluginReact.configs.flat.recommended,
languageOptions: {
...pluginReact.configs.flat.recommended.languageOptions,
globals: {
...globals.serviceworker,
},
},
},
ignorePatterns: [".*.js", "node_modules/"],
rules: {
"no-useless-escape": "off",
"prefer-const": "error",
"no-irregular-whitespace": "error",
"no-trailing-spaces": "error",
"no-duplicate-imports": "error",
"no-useless-catch": "warn",
"no-case-declarations": "error",
"no-undef": "error",
"no-unreachable": "error",
"arrow-body-style": ["error", "as-needed"],
"@next/next/no-html-link-for-pages": "off",
"@next/next/no-img-element": "off",
"react/jsx-key": "error",
"react/self-closing-comp": ["error", { component: true, html: true }],
"react/jsx-boolean-value": "error",
"react/jsx-no-duplicate-props": "error",
"react-hooks/exhaustive-deps": "warn",
"@typescript-eslint/no-unused-expressions": "warn",
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-useless-empty-export": "error",
"@typescript-eslint/prefer-ts-expect-error": "warn",
"@typescript-eslint/naming-convention": [
"warn",
{
selector: "variable",
format: ["camelCase", "snake_case", "UPPER_CASE", "PascalCase"],
leadingUnderscore: "allow",
},
],
"import/order": [
"warn",
{
groups: ["builtin", "external", "internal", "parent", "sibling"],
pathGroups: [
{
pattern: "react",
group: "external",
position: "before",
},
{
pattern: "lucide-react",
group: "external",
position: "after",
},
{
pattern: "@headlessui/**",
group: "external",
position: "after",
},
{
pattern: "@plane/**",
group: "external",
position: "after",
},
{
pattern: "@/**",
group: "internal",
},
{
pattern: "public/**",
group: "internal",
position: "after",
},
],
pathGroupsExcludedImportTypes: ["builtin", "internal", "react"],
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
{
plugins: {
"@next/next": pluginNext,
},
rules: {
...pluginNext.configs.recommended.rules,
...pluginNext.configs["core-web-vitals"].rules,
},
},
};
{
plugins: {
"react-hooks": pluginReactHooks,
},
settings: { react: { version: "detect" } },
rules: {
...pluginReactHooks.configs.recommended.rules,
// React scope no longer necessary with new JSX transform.
"react/react-in-jsx-scope": "off",
},
},
...pluginImport.flatConfigs.recommended,
{
rules: {
"import/order": [
"warn",
{
groups: ["builtin", "external", "internal", "parent", "sibling"],
pathGroups: [
{
pattern: "react",
group: "external",
position: "before",
},
{
pattern: "@plane/**",
group: "external",
position: "after",
},
{
pattern: "@/**",
group: "internal",
},
{
pattern: "public/**",
group: "internal",
position: "after",
},
],
pathGroupsExcludedImportTypes: ["builtin", "internal", "react"],
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
},
},
];

View File

@@ -3,21 +3,24 @@
"private": true,
"version": "0.28.0",
"license": "AGPL-3.0",
"files": [
"library.js",
"next.js",
"server.js"
],
"exports": {
".": "./index.js",
"./next": "./next.js",
"./library": "./library.js",
"./server": "./server.js"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^8.6.0",
"@typescript-eslint/parser": "^8.6.0",
"eslint": "8.57.1",
"eslint-config-next": "^14.1.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-turbo": "^1.12.4",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^5.2.0",
"typescript": "5.8.3"
"@eslint/js": "9.31.0",
"@next/eslint-plugin-next": "15.4.2",
"eslint": "9.31.0",
"eslint-config-prettier": "10.1.1",
"eslint-plugin-only-warn": "1.1.0",
"eslint-plugin-react": "7.37.5",
"eslint-plugin-react-hooks": "5.2.0",
"eslint-plugin-import": "2.31.0",
"eslint-config-turbo": "2.5.0",
"globals": "16.3.0",
"typescript": "5.8.3",
"typescript-eslint": "8.37.0"
}
}

View File

@@ -1,58 +1,36 @@
const { resolve } = require("node:path");
const project = resolve(process.cwd(), "tsconfig.json");
import js from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import tseslint from "typescript-eslint";
import pluginImport from "eslint-plugin-import";
import { config as baseConfig } from "./index.js";
module.exports = {
extends: ["prettier", "plugin:@typescript-eslint/recommended"],
parser: "@typescript-eslint/parser",
env: {
node: true,
es6: true,
},
plugins: ["@typescript-eslint", "import"],
settings: {
"import/resolver": {
typescript: {
project,
},
/** @type {import("eslint").Linter.Config} */
export const config = [
...baseConfig,
js.configs.recommended,
eslintConfigPrettier,
...tseslint.configs.recommended,
...pluginImport.flatConfigs.recommended,
{
rules: {
"import/order": [
"warn",
{
groups: ["builtin", "external", "internal", "parent", "sibling"],
pathGroups: [
{
pattern: "@plane/**",
group: "external",
position: "after",
},
],
pathGroupsExcludedImportTypes: ["builtin", "internal", "react"],
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
},
},
ignorePatterns: [".*.js", "node_modules/"],
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
rules: {
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"import/order": [
"warn",
{
groups: ["builtin", "external", "internal", "parent", "sibling"],
pathGroups: [
{
pattern: "@plane/**",
group: "external",
position: "after",
},
{
pattern: "@/**",
group: "internal",
position: "before",
},
],
pathGroupsExcludedImportTypes: ["builtin", "internal", "react"],
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
},
};
];

View File

@@ -1,4 +0,0 @@
module.exports = {
root: true,
extends: ["@plane/eslint-config/library.js"],
};

View File

@@ -0,0 +1,4 @@
import { config } from "@plane/eslint-config/library";
/** @type {import("eslint").Linter.Config} */
export default config;

View File

@@ -1,4 +0,0 @@
module.exports = {
root: true,
extends: ["@plane/eslint-config/library.js"],
};

View File

@@ -0,0 +1,4 @@
import { config } from "@plane/eslint-config/library";
/** @type {import("eslint").Linter.Config} */
export default config;

View File

@@ -1,4 +0,0 @@
module.exports = {
root: true,
extends: ["@plane/eslint-config/library.js"],
};

View File

@@ -0,0 +1,4 @@
import { config } from "@plane/eslint-config/library";
/** @type {import("eslint").Linter.Config} */
export default config;

View File

@@ -1,29 +0,0 @@
module.exports = {
root: true,
extends: ["@plane/eslint-config/library.js", "plugin:storybook/recommended"],
rules: {
"import/order": [
"warn",
{
groups: ["builtin", "external", "internal", "parent", "sibling"],
pathGroups: [
{
pattern: "react",
group: "external",
position: "before",
},
{
pattern: "@plane/**",
group: "external",
position: "after",
},
],
pathGroupsExcludedImportTypes: ["builtin", "internal", "react"],
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
},
};

View File

@@ -0,0 +1,4 @@
import { config } from "@plane/eslint-config/library";
/** @type {import("eslint").Linter.Config} */
export default config;

View File

@@ -1,4 +0,0 @@
module.exports = {
root: true,
extends: ["@plane/eslint-config/library.js"],
};

View File

@@ -0,0 +1,4 @@
import { config } from "@plane/eslint-config/library";
/** @type {import("eslint").Linter.Config} */
export default config;

View File

@@ -1,4 +0,0 @@
module.exports = {
root: true,
extends: ["@plane/eslint-config/library.js"],
};

View File

@@ -1,4 +0,0 @@
module.exports = {
root: true,
extends: ["@plane/eslint-config/library.js"],
};

View File

@@ -0,0 +1,4 @@
import { config } from "@plane/eslint-config/library";
/** @type {import("eslint").Linter.Config} */
export default config;

View File

@@ -1,4 +0,0 @@
module.exports = {
root: true,
extends: ["@plane/eslint-config/library.js"],
};

View File

@@ -0,0 +1,4 @@
import { config } from "@plane/eslint-config/library";
/** @type {import("eslint").Linter.Config} */
export default config;

View File

@@ -1,4 +0,0 @@
module.exports = {
root: true,
extends: ["@plane/eslint-config/library.js"],
};

View File

@@ -0,0 +1,4 @@
import { config } from "@plane/eslint-config/library";
/** @type {import("eslint").Linter.Config} */
export default config;

View File

@@ -4,6 +4,7 @@
"description": "Helper functions shared across multiple apps internally",
"license": "AGPL-3.0",
"private": true,
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",

968
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff