| 301 | }; |
| 302 | |
| 303 | const isInitialStateConvertible = classPath => { |
| 304 | const specPath = ReactUtils.directlyGetCreateClassSpec(classPath); |
| 305 | if (!specPath) { |
| 306 | return false; |
| 307 | } |
| 308 | const result = isGetInitialStateConstructorSafe(findGetInitialState(specPath)); |
| 309 | if (!result) { |
| 310 | console.warn( |
| 311 | file.path + ': `' + ReactUtils.directlyGetComponentName(classPath) + '` ' + |
| 312 | 'was skipped because of potential shadowing issues were found in ' + |
| 313 | 'the React component. Rename variable declarations of `props` and/or `context` ' + |
| 314 | 'in your `getInitialState` and re-run this script.' |
| 315 | ); |
| 316 | } |
| 317 | return result; |
| 318 | }; |
| 319 | |
| 320 | const canConvertToClass = classPath => { |
| 321 | const specPath = ReactUtils.directlyGetCreateClassSpec(classPath); |
no test coverage detected