Skip to content

Commit

Permalink
feat: add first version of cytoscape
Browse files Browse the repository at this point in the history
  • Loading branch information
juancarlosfarah committed Sep 8, 2023
1 parent b22aef0 commit ffe87a3
Show file tree
Hide file tree
Showing 7 changed files with 5,301 additions and 42 deletions.
193 changes: 193 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
{
"extends": [
"airbnb",
"plugin:import/typescript", // this is needed because airbnb uses eslint-plugin-import
"prettier",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
"eslint:recommended"
],
"plugins": [
"@typescript-eslint",
"react-hooks"
],
"env": {
"browser": true,
"node": true,
"mocha": true,
"jest": true
},
"globals": {
"cy": true,
"Cypress": true,
"JSX": "readonly"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"import/order": "off",
"react/function-component-definition": [
2,
{
"namedComponents": "arrow-function"
}
],
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
// remove when possible
"@typescript-eslint/no-explicit-any": "off",
// disable the rule for all files
"no-restricted-syntax": "off",
// disable the rule for all files
"@typescript-eslint/explicit-module-boundary-types": "off",
"jsx-a11y/anchor-is-valid": [
"error",
{
"components": [
"Link"
],
"specialLink": [
"to",
"hrefLeft",
"hrefRight"
],
"aspects": [
"noHref",
"invalidHref",
"preferButton"
]
}
],
"react/jsx-filename-extension": [
"warn",
{
"extensions": [
".js",
".jsx",
".ts",
".tsx"
]
}
],
"import/no-named-as-default": "off",
"react/static-property-placement": [
"error",
"property assignment",
{
"childContextTypes": "static public field",
"contextTypes": "static public field",
"contextType": "static public field",
"defaultProps": "static public field",
"displayName": "static public field",
"propTypes": "static public field"
}
],
"react/state-in-constructor": [
"error",
"never"
],
"no-console": [
1,
{
"allow": [
"error"
]
}
],
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
}
],
"react/prop-types": "off",
"react/require-default-props": "off",
// eslint rule reports false error
"no-shadow": "off",
"@typescript-eslint/no-shadow": [
"error"
],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
],
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": true
}
],
},
"overrides": [
{
// enable the rule specifically for TypeScript files
"files": [
"*.ts",
"*.tsx"
],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": [
"error"
]
}
},
{
// enable the rule specifically for src files
"files": [
"src/**/*.js",
"src/**/*.tsx",
"src/**/*.ts"
],
"rules": {
"no-restricted-syntax": [
"error"
]
}
}
],
"settings": {
"import/extensions": [
".js",
".jsx",
".ts",
".tsx"
],
"import/parsers": {
"@typescript-eslint/parser": [
".ts",
".tsx"
]
},
"import/resolver": {
"typescript": {
"directory": "./tsconfig.json"
},
"node": {
"extensions": [
".js",
".jsx",
".ts",
".tsx"
]
}
}
},
"ignorePatterns": [
"node_modules/*"
]
}
19 changes: 19 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"bracketSpacing": true,
"arrowParens": "always",
"importOrder": [
"^react",
"^@?mui",
"^@?graasp",
"<THIRD_PARTY_MODULES>",
"^@/",
"^[./]"
],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"plugins": ["@trivago/prettier-plugin-sort-imports"]
}
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,23 @@
"test": "vitest"
},
"dependencies": {
"cytoscape": "^3.26.0",
"cytoscape-avsdf": "^1.0.0",
"cytoscape-cola": "^2.5.1",
"cytoscape-fcose": "^2.2.0",
"react": "^18.2.0",
"react-cytoscapejs": "^2.0.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
"@types/react": "^18.2.12",
"@types/react-cytoscapejs": "^1.2.2",
"@types/react-dom": "^18.2.5",
"@vitejs/plugin-react": "^4.0.0",
"autoprefixer": "^10.4.14",
"postcss": "^8.4.24",
"prettier": "^3.0.3",
"tailwindcss": "^3.3.2",
"typescript": "^5.1.3",
"vite": "^4.3.9",
Expand Down
Loading

0 comments on commit ffe87a3

Please sign in to comment.