Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup TypeScript Environment #291

Merged
merged 15 commits into from
Feb 16, 2019
Merged

Setup TypeScript Environment #291

merged 15 commits into from
Feb 16, 2019

Conversation

zaki-yama
Copy link
Collaborator

stomita
stomita previously approved these changes Feb 9, 2019
@zaki-yama zaki-yama changed the title [WIP] Setup TypeScript Environment Setup TypeScript Environment Feb 10, 2019
@zaki-yama zaki-yama self-assigned this Feb 10, 2019
@@ -7,6 +7,7 @@
'rules': {
'jsx-quotes': [2, 'prefer-single'],
'no-nested-ternary': 0,
'no-undef': 0,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stomita
After updating babel-eslint, no-undef errors occured.

The result of `yarn run lint:src`
yarn run v1.9.4
$ eslint --ext .js src/scripts/**

/Users/yamazaki/workspace/TypeScript/react-lightning-design-system/src/scripts/AutoAlign.js
  103:12  error  'propTypes' is not defined               no-undef
  113:12  error  'contextTypes' is not defined            no-undef
  118:5   error  'state' is not defined                   no-undef
  134:5   error  'requestRecalcAlignment' is not defined  no-undef
  147:5   error  'recalcAlignment' is not defined         no-undef

/Users/yamazaki/workspace/TypeScript/react-lightning-design-system/src/scripts/Checkbox.js
  18:7  warning  Form controls using a label to identify them must be programmatically associated with the control using htmlFor  jsx-a11y/label-has-for

/Users/yamazaki/workspace/TypeScript/react-lightning-design-system/src/scripts/ComponentSettings.js
   8:10  error  'propTypes' is not defined          no-undef
  15:10  error  'childContextTypes' is not defined  no-undef

/Users/yamazaki/workspace/TypeScript/react-lightning-design-system/src/scripts/DateInput.js
  17:10  error  'propTypes' is not defined  no-undef

/Users/yamazaki/workspace/TypeScript/react-lightning-design-system/src/scripts/Lookup.js
   30:10  error  'propTypes' is not defined              no-undef
   98:10  error  'propTypes' is not defined              no-undef
  154:3   error  'onLookupIconClick' is not defined      no-undef
  158:3   error  'onInputKeyDown' is not defined         no-undef
  185:3   error  'onInputChange' is not defined          no-undef
  190:3   error  'onInputBlur' is not defined            no-undef
  200:3   error  'onScopeMenuClick' is not defined       no-undef
  206:3   error  'onMenuItemClick' is not defined        no-undef
  216:3   error  'handleLookupSearchRef' is not defined  no-undef
  328:10  error  'propTypes' is not defined              no-undef
  490:10  error  'propTypes' is not defined              no-undef
  530:10  error  'isFormElement' is not defined          no-undef

/Users/yamazaki/workspace/TypeScript/react-lightning-design-system/src/scripts/Picklist.js
   24:3  error  'onClick' is not defined              no-undef
   31:3  error  'onPicklistItemClick' is not defined  no-undef
   57:3  error  'onPicklistClose' is not defined      no-undef
   63:3  error  'onBlur' is not defined               no-undef
   77:3  error  'onKeydown' is not defined            no-undef
  234:3  error  'renderPicklistItem' is not defined   no-undef

/Users/yamazaki/workspace/TypeScript/react-lightning-design-system/src/scripts/Pill.js
  82:15  warning  'icon.category' PropType is defined but prop is never used  react/no-unused-prop-types

/Users/yamazaki/workspace/TypeScript/react-lightning-design-system/src/scripts/Radio.js
  8:5  warning  Form controls using a label to identify them must be programmatically associated with the control using htmlFor  jsx-a11y/label-has-for

/Users/yamazaki/workspace/TypeScript/react-lightning-design-system/src/scripts/Tabs.js
  184:10  warning  'title' PropType is defined but prop is never used            react/no-unused-prop-types
  189:9   warning  'menu' PropType is defined but prop is never used             react/no-unused-prop-types
  190:14  warning  'menuItems' PropType is defined but prop is never used        react/no-unused-prop-types
  191:13  warning  'menuIcon' PropType is defined but prop is never used         react/no-unused-prop-types
  197:20  warning  'tabItemRenderer' PropType is defined but prop is never used  react/no-unused-prop-types
  249:3   error    'onTabClick' is not defined                                   no-undef
  257:3   error    'onTabKeyDown' is not defined                                 no-undef

/Users/yamazaki/workspace/TypeScript/react-lightning-design-system/src/scripts/Toggle.js
  11:7  warning  Form controls using a label to identify them must be programmatically associated with the control using htmlFor  jsx-a11y/label-has-for

✖ 37 problems (28 errors, 9 warnings)

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Most of the errors seemed to be at where using class property.
I haven't found out why, but I'd like to deal with it in the next PR, when I update all other eslint-related packages.

Package                                   Current Wanted Latest Package Type    URL
eslint                                    3.8.1   3.8.1  5.13.0 devDependencies https://eslint.org
eslint-config-airbnb                      12.0.0  12.0.0 17.1.0 devDependencies https://github.com/airbnb/javascript
eslint-plugin-import                      1.16.0  1.16.0 2.16.0 devDependencies https://github.com/benmosher/eslint-plugin-import
eslint-plugin-jsx-a11y                    2.2.3   2.2.3  6.2.1  devDependencies https://github.com/evcohen/eslint-plugin-jsx-a11y#readme
eslint-plugin-react                       6.4.1   6.4.1  7.12.4 devDependencies https://github.com/yannickcr/eslint-plugin-react

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you using yarn to build ? It should also be updated the yarn.lock to stabilize the dependency.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, it is not caused by the dependency updates, but the parser. It seems OK by disabling it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Thank you for checking.

@zaki-yama
Copy link
Collaborator Author

@stomita
I confirmed that I place a dummy .ts in src/ folder and successfully compiled with build script.
Please review.

@@ -7,6 +7,7 @@
'rules': {
'jsx-quotes': [2, 'prefer-single'],
'no-nested-ternary': 0,
'no-undef': 0,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, it is not caused by the dependency updates, but the parser. It seems OK by disabling it.

@stomita stomita merged commit f6a8534 into 3.0 Feb 16, 2019
@zaki-yama zaki-yama mentioned this pull request Feb 20, 2019
10 tasks
@zaki-yama zaki-yama deleted the setup-typescript-environment branch March 18, 2019 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants