2024-09-23 17:10:38 +05:30
|
|
|
const { resolve } = require("node:path");
|
|
|
|
|
|
|
|
|
|
const project = resolve(process.cwd(), "tsconfig.json");
|
|
|
|
|
|
|
|
|
|
/** @type {import("eslint").Linter.Config} */
|
2023-02-21 11:31:43 +05:30
|
|
|
module.exports = {
|
2024-09-23 17:10:38 +05:30
|
|
|
extends: ["prettier", "plugin:@typescript-eslint/recommended"],
|
2025-08-27 21:03:20 +05:30
|
|
|
parser: "@typescript-eslint/parser",
|
2025-05-23 15:29:37 +05:30
|
|
|
plugins: ["react", "react-hooks", "@typescript-eslint", "import"],
|
2024-09-23 17:10:38 +05:30
|
|
|
globals: {
|
|
|
|
|
React: true,
|
|
|
|
|
JSX: true,
|
|
|
|
|
},
|
|
|
|
|
env: {
|
|
|
|
|
node: true,
|
|
|
|
|
browser: true,
|
|
|
|
|
},
|
2023-02-21 11:31:43 +05:30
|
|
|
settings: {
|
2024-09-23 17:10:38 +05:30
|
|
|
"import/resolver": {
|
|
|
|
|
typescript: {
|
|
|
|
|
project,
|
|
|
|
|
},
|
2023-02-21 11:31:43 +05:30
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
rules: {
|
2024-06-13 21:17:06 +05:30
|
|
|
"no-useless-escape": "off",
|
2023-02-21 11:31:43 +05:30
|
|
|
"prefer-const": "error",
|
|
|
|
|
"no-irregular-whitespace": "error",
|
|
|
|
|
"no-trailing-spaces": "error",
|
2025-11-13 04:11:06 -08:00
|
|
|
"import/no-duplicates": ["error", { considerQueryString: true }],
|
2024-06-17 16:45:35 +05:30
|
|
|
"no-useless-catch": "warn",
|
|
|
|
|
"no-case-declarations": "error",
|
|
|
|
|
"no-undef": "error",
|
|
|
|
|
"no-unreachable": "error",
|
2023-02-21 11:31:43 +05:30
|
|
|
"arrow-body-style": ["error", "as-needed"],
|
2024-03-06 18:39:14 +05:30
|
|
|
"@next/next/no-html-link-for-pages": "off",
|
2023-09-13 12:06:17 +05:30
|
|
|
"@next/next/no-img-element": "off",
|
2024-03-06 18:39:14 +05:30
|
|
|
"react/jsx-key": "error",
|
|
|
|
|
"react/self-closing-comp": ["error", { component: true, html: true }],
|
|
|
|
|
"react/jsx-boolean-value": "error",
|
|
|
|
|
"react/jsx-no-duplicate-props": "error",
|
2025-05-23 15:29:37 +05:30
|
|
|
"react-hooks/exhaustive-deps": "warn",
|
2025-11-13 04:11:06 -08:00
|
|
|
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
|
|
|
|
|
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
|
|
|
"@typescript-eslint/consistent-type-imports": [
|
|
|
|
|
"error",
|
|
|
|
|
{
|
|
|
|
|
prefer: "type-imports",
|
|
|
|
|
fixStyle: "separate-type-imports",
|
|
|
|
|
disallowTypeAnnotations: false,
|
|
|
|
|
},
|
|
|
|
|
],
|
2024-09-23 17:10:38 +05:30
|
|
|
"@typescript-eslint/no-unused-expressions": "warn",
|
2025-07-24 13:14:51 -07:00
|
|
|
"@typescript-eslint/no-unused-vars": [
|
|
|
|
|
"warn",
|
|
|
|
|
{
|
2025-08-27 21:03:20 +05:30
|
|
|
argsIgnorePattern: "^_",
|
|
|
|
|
varsIgnorePattern: "^_",
|
|
|
|
|
caughtErrorsIgnorePattern: "^_",
|
|
|
|
|
},
|
2025-07-24 13:14:51 -07:00
|
|
|
],
|
2024-03-06 18:39:14 +05:30
|
|
|
"@typescript-eslint/no-explicit-any": "warn",
|
|
|
|
|
"@typescript-eslint/no-useless-empty-export": "error",
|
2024-09-23 17:10:38 +05:30
|
|
|
"@typescript-eslint/prefer-ts-expect-error": "warn",
|
2025-11-13 04:11:06 -08:00
|
|
|
|
2024-12-23 01:51:30 +05:30
|
|
|
"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,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
2023-02-21 11:31:43 +05:30
|
|
|
},
|
2024-12-23 01:51:30 +05:30
|
|
|
|
2024-09-23 17:10:38 +05:30
|
|
|
ignorePatterns: [".*.js", "node_modules/", "dist/"],
|
2023-02-21 11:31:43 +05:30
|
|
|
};
|