Closed molebox closed 4 years ago
I think both eslint-loader
(which is giving the error) and eslint-config-react-app
belongs to gatsby. It's not a dependency in docz
itself.
Saw that you hade a lot of eslint-related packages and scripts in your package.json
. How are you using eslint
, how does your config look for example?
I think both
eslint-loader
(which is giving the error) andeslint-config-react-app
belongs to gatsby. It's not a dependency indocz
itself.Saw that you hade a lot of eslint-related packages and scripts in your
package.json
. How are you usingeslint
, how does your config look for example?
Yes i thought it might be related to Gatsby but i guess it must have something to do with docz integration of Gatsby as i use Gatsby in lots of other projects and have never seen this error before.
eslint was/is working fine in the project. Here is our eslintrc.js:
module.exports = {
env: {
"browser": true,
"es6": true
},
extends: ["plugin:import/typescript", "prettier/@typescript-eslint", "plugin:prettier/recommended", "prettier", "prettier/react"],
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly",
process: true,
logger: true
},
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: {
jsx: true
},
ecmaVersion: 2018,
sourceType: "module",
project: "./tsconfig.json"
},
settings: {
react: {
version: "detect"
}
},
plugins: ["react", "react-hooks", "@typescript-eslint", "prefer-arrow", "promise", "no-null", "jsdoc", "import", "prettier"],
rules: {
"prettier/prettier": "error",
"@typescript-eslint/ban-types": [
"warn",
{
"types": {
"Object": "Use {} instead",
"String": {
"message": "Use string instead",
"fixWith": "string"
}
}
}
],
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/explicit-member-accessibility": ["error", { "accessibility": "no-public" }],
"@typescript-eslint/no-inferrable-types": ["error", { "ignoreParameters": true, "ignoreProperties": true }],
"no-param-reassign": 0,
"@typescript-eslint/no-var-requires": 0,
"prefer-arrow/prefer-arrow-functions": 0,
"@typescript-eslint/promise-function-async": 0,
"@typescript-eslint/unified-signatures": "error",
"@typescript-eslint/await-thenable": "error",
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "semantic-ui-react",
"importNames": ["Button", "Tab", "Modal", "TextArea", "Input", "Loader"],
"message": "This component has been replaced by our own implementation."
}
]
}
],
"no-new-wrappers": "error",
"@typescript-eslint/no-for-in-array": "error",
"no-template-curly-in-string": "error",
"@typescript-eslint/no-object-literal-type-assertion": "error",
"no-return-await": "error",
"no-throw-literal": "error",
"@typescript-eslint/no-this-alias": 0,
"@typescript-eslint/no-extraneous-class": "error",
"prefer-object-spread": "error",
"@typescript-eslint/no-require-imports": 0,
"@typescript-eslint/array-type": ["error", "array-simple"],
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/explicit-function-return-type": 0,
"no-undef-init": "error",
"@typescript-eslint/no-unnecessary-qualifier": "warn",
"jsx-quotes": ["error", "prefer-double"],
"jsx-alignment": true,
"jsx-boolean-value": [true, "never"],
"jsx-curly-spacing": [true, "never"],
"jsx-equals-spacing": [true, "never"],
"jsx-key": true,
"jsx-no-bind": true,
"jsx-no-lambda": true,
"jsx-no-string-ref": true,
"jsx-use-translation-function": false, // May be useful when internationalization is in
"jsx-self-close": true,
"jsx-space-before-trailing-slash": true,
"jsx-wrap-multiline": [
true,
{
"declaration": "parens",
"assignment": "parens",
"return": "parens",
"arrow": "parens-new-line",
"condition": "ignore",
"logical": "ignore",
"prop": "ignore"
}
],
"import/no-cycle": ["error", { "maxDepth": 1 }],
"import/no-self-import": "error",
"object-curly-spacing": ["error", "never"],
"react-hooks/rules-of-hooks": "error"
}
}
Seems like tsdx
used in docz-components
is also using that config and needed to updates som deps, which has been done but not been released. Could that be the problem?
Not sure if this will help but I had a similar issue with eslint 6, so I downgraded to 5.12.1
docz need to upgrade gatsby package to the latest one as their deps uses an older version of eslint-config-react-app
which doesn't support eslint 6.
PS - check if you have any unmet peer deps
maybe i has a same problem https://github.com/doczjs/docz/issues/1180
New error using 2.0.0-rc.63
riha@riha-pc MINGW64 ~/Documents/webui (webui-docs)
$ yarn docz dev
yarn run v1.17.3
$ C:\Users\riha\Documents\webui\node_modules\.bin\docz dev
Building app
warn Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
success open and validate gatsby-configs - 1.249s
success load plugins - 0.526s
success onPreInit - 0.005s
success initialize cache - 0.021s
success copy gatsby files - 0.130s
success onPreBootstrap - 0.336s
warn Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
⠸ source and transform nodes
‼ warning Any cache was found with your props definitions
‼ warning We'll parse your components to get props from them
ERROR
Failed to process data server
ERROR
TypeError: Cannot read property 'filter' of undefined
at getTextValueOfClassMember (C:\Users\riha\Documents\webui\node_modules\react-docgen-typescript\lib\parser.js:571:10)
at computeComponentName (C:\Users\riha\Documents\webui\node_modules\react-docgen-typescript\src\parser.ts:927:5)
at Parser.getComponentInfo (C:\Users\riha\Documents\webui\node_modules\react-docgen-typescript\src\parser.ts:262:32)
at C:\Users\riha\Documents\webui\node_modules\react-docgen-typescript\src\parser.ts:1047:20
at Array.map (<anonymous>)
at C:\Users\riha\Documents\webui\node_modules\react-docgen-typescript\src\parser.ts:1046:12
at Array.reduce (<anonymous>)
at parseWithProgramProvider (C:\Users\riha\Documents\webui\node_modules\react-docgen-typescript\src\parser.ts:1035:6)
at Object.parseWithProgramProvider (C:\Users\riha\Documents\webui\node_modules\react-docgen-typescript\src\parser.ts:176:14)
at files.map.filepath (C:\Users\riha\Documents\webui\node_modules\docz-core\dist\index.js:2058:19)
at Array.map (<anonymous>)
at parseFiles (C:\Users\riha\Documents\webui\node_modules\docz-core\dist\index.js:2056:16)
at tsParser (C:\Users\riha\Documents\webui\node_modules\docz-core\dist\index.js:2067:16)
at docgen (C:\Users\riha\Documents\webui\node_modules\docz-core\dist\index.js:2082:30)
⠸ source and transform nodes
Looks like this might be the problem: https://github.com/styleguidist/react-docgen-typescript/issues/213
There is a PR up but it hasent been merged yet
The above Pr fixes the TypeError: Cannot read property 'filter' of undefined
error but we still see the original error of this issue with eslint-config-react-app
:-(
Is there any movement on this? I tried a clean install of docz and am still getting this error so it appears that the problem is not only isolated to my repo and the others that have commented here...
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Bug Report
Error: Cannot find module 'eslint-config-react-app' when running
yarn docz dev
Expected behavior It should load and work
Environment
Additional context/Screenshots
doczrc.js
package.json
Button.tsx Component
Button.mdx