UNPKG

@marciocamello/react-sortable-tree

Version:

Drag-and-drop sortable component for nested data and hierarchies

159 lines (158 loc) 5.01 kB
{ "env": { "browser": true, "shared-node-browser": true, "node": true, "es2021": true }, "extends": [ "airbnb", "airbnb-typescript", "airbnb/hooks", // "plugin:@typescript-eslint/recommended", // "plugin:@typescript-eslint/recommended-requiring-type-checking", "prettier", "plugin:sonarjs/recommended", "plugin:prettier/recommended", "plugin:react/recommended", "plugin:react/jsx-runtime", "plugin:import/recommended", "plugin:import/typescript", "plugin:react-hooks/recommended", "plugin:promise/recommended", "plugin:unicorn/recommended", "plugin:storybook/recommended" ], "plugins": [ "@typescript-eslint", "react", "prettier", "import", "sonarjs", "promise", "unicorn" ], "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaVersion": 2021, "sourceType": "module", "project": "./tsconfig.json", "ecmaFeatures": { "jsx": true } }, "rules": { "no-continue": "off", "no-plusplus": "off", "no-case-declarations": "off", // Too restrictive, writing ugly code to defend against a very unlikely scenario: https://eslint.org/docs/rules/no-prototype-builtins "no-prototype-builtins": "off", // https://basarat.gitbooks.io/typescript/docs/tips/defaultIsBad.html "import/prefer-default-export": "off", "import/no-default-export": "off", // Too restrictive: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/destructuring-assignment.md "react/destructuring-assignment": "off", "react/require-default-props": "off", "react/jsx-props-no-spreading": "off", "react/no-unstable-nested-components": ["warn", { "allowAsProps": true }], // No jsx extension: https://github.com/facebook/create-react-app/issues/87#issuecomment-234627904 "react/jsx-filename-extension": "off", // Use function hoisting to improve code readability "no-use-before-define": [ "error", { "functions": false, "classes": true, "variables": true } ], "@typescript-eslint/no-unused-vars": "off", // Allow most functions to rely on type inference. If the function is exported, then `@typescript-eslint/explicit-module-boundary-types` will ensure it's typed. "@typescript-eslint/explicit-function-return-type": "off", "@typescript-eslint/no-use-before-define": [ "error", { "functions": false, "classes": true, "variables": true, "typedefs": true } ], // Common abbreviations are known and readable "unicorn/prevent-abbreviations": "off", "unicorn/filename-case": "off", // Disable for simplify type checking for TS "unicorn/no-useless-undefined": "off", "unicorn/prefer-node-protocol": "off", // Temporary turn it off. "no-restricted-syntax": "off", "@typescript-eslint/no-unsafe-member-access": "off", "@typescript-eslint/no-unsafe-call": "off", "import/no-extraneous-dependencies": "off", "require-atomic-updates": "warn", "curly": ["warn", "multi-line", "consistent"], "no-console": "off", "import/named": "off", "import/no-named-as-default": "off", "import/no-unresolved": ["error", { "commonjs": true, "amd": true }], "import/export": "error", "react-hooks/rules-of-hooks": "error", "react-hooks/exhaustive-deps": "warn", "@typescript-eslint/no-duplicate-imports": ["error"], "@typescript-eslint/explicit-module-boundary-types": "off", "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-empty-interface": "off", "@typescript-eslint/no-explicit-any": "off", "import/order": [ "error", { "alphabetize": { "order": "asc", "caseInsensitive": true }, "groups": [ "builtin", "external", "internal", "parent", "sibling", "index", "object" ], "newlines-between": "never", "pathGroups": [ { "pattern": "react", "group": "builtin", "position": "before" } ], "pathGroupsExcludedImportTypes": ["builtin"] } ], "react/jsx-uses-react": "off", "react/react-in-jsx-scope": "off", "react/no-arrow-function-lifecycle": "warn", "sort-imports": [ "error", { "ignoreDeclarationSort": true } ] }, "settings": { "react": { "version": "detect" }, "import/extensions": [".js", ".jsx", ".ts", ".tsx"], "import/parsers": { "@typescript-eslint/parser": [".js", ".jsx", ".ts", ".tsx"] }, "import/resolver": { "node": { "extensions": [".js", ".jsx", ".ts", ".tsx", ".json"], "paths": ["src"] }, "typescript": { "alwaysTryTypes": true, "project": "./tsconfig.json" } } }, "overrides": [ { "files": ["src"], "parserOptions": { "project": "./tsconfig.json" } } ] }