mirror of
https://github.com/makeplane/plane.git
synced 2025-12-16 20:07:56 +01:00
90 lines
2.2 KiB
JavaScript
90 lines
2.2 KiB
JavaScript
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";
|
|
|
|
/**
|
|
* @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,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
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",
|
|
},
|
|
},
|
|
{
|
|
plugins: {
|
|
import: pluginImport,
|
|
},
|
|
rules: {
|
|
...pluginImport.configs.recommended.rules,
|
|
"import/no-unresolved": "off",
|
|
"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,
|
|
},
|
|
},
|
|
],
|
|
},
|
|
},
|
|
];
|